pub struct ScopeFrame { /* private fields */ }Expand description
One frame on the per-task / per-thread scope stack.
Implementations§
Source§impl ScopeFrame
impl ScopeFrame
Sourcepub fn new(
fields: Vec<ScopeField>,
kind: ScopeKind,
tail_capacity: u16,
) -> ScopeFrame
pub fn new( fields: Vec<ScopeField>, kind: ScopeKind, tail_capacity: u16, ) -> ScopeFrame
Construct a frame with the supplied declared fields and tail buffer capacity.
Sourcepub fn set_traceparent_sampled(&mut self, sampled: bool)
pub fn set_traceparent_sampled(&mut self, sampled: bool)
Update the inbound traceparent.sampled decision (set by the
HTTP middleware at request entry). Spec 13 § 6.
Sourcepub fn set_span_identity(&mut self, name: &'static str, target: &'static str)
pub fn set_span_identity(&mut self, name: &'static str, target: &'static str)
Set the bridged tracing span identity for obs::SpanTrace
rendering. Spec 13 § 9.
Sourcepub fn traceparent_sampled(&self) -> Option<bool>
pub fn traceparent_sampled(&self) -> Option<bool>
Inbound traceparent.sampled decision, when set.
Sourcepub fn fields(&self) -> &[ScopeField]
pub fn fields(&self) -> &[ScopeField]
Read-only view of the declared fields.
Sourcepub fn seen_error(&self) -> bool
pub fn seen_error(&self) -> bool
true if the scope has observed an >= ERROR envelope.
Sourcepub fn mark_error(&mut self)
pub fn mark_error(&mut self)
Mark this frame’s tail buffer as needing flush.
Sourcepub fn tail_capacity(&self) -> u16
pub fn tail_capacity(&self) -> u16
Capacity of the tail buffer (in envelopes).
Sourcepub fn push_tail(&mut self, env: ObsEnvelope)
pub fn push_tail(&mut self, env: ObsEnvelope)
Push an envelope onto the ring buffer. No-op for Context.
Sourcepub fn drain_tail(&mut self) -> Vec<ObsEnvelope>
pub fn drain_tail(&mut self) -> Vec<ObsEnvelope>
Drain and return the buffered envelopes (callers flush on scope-end-with-error).
Sourcepub fn tail_snapshot(&self) -> Vec<ObsEnvelope>
pub fn tail_snapshot(&self) -> Vec<ObsEnvelope>
Snapshot of currently-buffered envelopes (test-only).
Sourcepub fn as_span_frame(&self) -> Option<SpanFrame<'_>>
pub fn as_span_frame(&self) -> Option<SpanFrame<'_>>
Render the frame as a SpanFrame for SpanTrace.
Trait Implementations§
Source§impl Clone for ScopeFrame
impl Clone for ScopeFrame
Source§fn clone(&self) -> ScopeFrame
fn clone(&self) -> ScopeFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ScopeFrame
impl RefUnwindSafe for ScopeFrame
impl Send for ScopeFrame
impl Sync for ScopeFrame
impl Unpin for ScopeFrame
impl UnsafeUnpin for ScopeFrame
impl UnwindSafe for ScopeFrame
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
T in a tonic::Request