pub struct TraceStore { /* private fields */ }Expand description
Thread-safe store of recent request traces.
Bounded to capacity entries; oldest entries are evicted when the cap is
reached. All public methods take &self to allow sharing across tasks via
Arc<TraceStore>.
Implementations§
Source§impl TraceStore
impl TraceStore
Sourcepub fn upsert(&self, trace: RequestTrace)
pub fn upsert(&self, trace: RequestTrace)
Insert or update a trace. Evicts the oldest entry when at capacity.
Sourcepub fn stage_started(&self, request_id: &str, stage_index: usize)
pub fn stage_started(&self, request_id: &str, stage_index: usize)
Record a stage start event.
Sourcepub fn stage_finished(
&self,
request_id: &str,
stage_index: usize,
success: bool,
)
pub fn stage_finished( &self, request_id: &str, stage_index: usize, success: bool, )
Record a stage finish event.
Sourcepub fn get(&self, request_id: &str) -> Option<RequestTrace>
pub fn get(&self, request_id: &str) -> Option<RequestTrace>
Look up a trace by request id.
Trait Implementations§
Source§impl Debug for TraceStore
impl Debug for TraceStore
Auto Trait Implementations§
impl !Freeze for TraceStore
impl RefUnwindSafe for TraceStore
impl Send for TraceStore
impl Sync for TraceStore
impl Unpin for TraceStore
impl UnsafeUnpin for TraceStore
impl UnwindSafe for TraceStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request