pub struct Trace {
pub trace_id_high: u64,
pub trace_id_low: u64,
pub origin: MetaString,
pub payload: PayloadFields,
pub attributes: Arc<FastHashMap<MetaString, AttributeValue>>,
pub priority: Option<i32>,
pub dropped_trace: bool,
pub sampling_mechanism: u32,
pub decision_maker: Option<MetaString>,
pub otlp_sampling_rate: Option<f64>,
/* private fields */
}Expand description
A trace event.
A trace is a collection of spans that represent a distributed trace.
Fields§
§trace_id_high: u64Upper 8 bytes of the 128-bit trace ID (big-endian). Zero for 64-bit-only sources.
trace_id_low: u64Lower 8 bytes of the 128-bit trace ID (big-endian).
origin: MetaStringTrace origin string (for example, "lambda", "rum").
payload: PayloadFieldsPayload-level metadata (promoted from the tracer payload or OTLP resource).
attributes: Arc<FastHashMap<MetaString, AttributeValue>>Trace chunk-level or resource-level attributes.
priority: Option<i32>Sampling priority set by the tracer or a sampler.
dropped_trace: boolWhether this trace was dropped during sampling.
sampling_mechanism: u32The mechanism by which the sampling decision was made.
decision_maker: Option<MetaString>Identifier of the component that made the final sampling decision.
otlp_sampling_rate: Option<f64>Effective OTLP sampling rate (_dd.otlp_sr), if set.
Implementations§
Source§impl Trace
impl Trace
Sourcepub fn new(spans: Vec<Span>) -> Self
pub fn new(spans: Vec<Span>) -> Self
Creates a new Trace with the given spans.
All unified fields default to empty / zero. Callers should set them directly after construction.
Sourcepub fn spans_mut(&mut self) -> &mut [Span]
pub fn spans_mut(&mut self) -> &mut [Span]
Returns a mutable reference to the spans in this trace.
Sourcepub fn set_spans(&mut self, spans: Vec<Span>)
pub fn set_spans(&mut self, spans: Vec<Span>)
Replaces the spans in this trace with the given spans.
Sourcepub fn retain_spans<F>(&mut self, f: F) -> usize
pub fn retain_spans<F>(&mut self, f: F) -> usize
Retains only the spans specified by the predicate.
Returns the number of spans retained. If no spans match, the trace is left unchanged.
Trait Implementations§
impl StructuralPartialEq for Trace
Auto Trait Implementations§
impl Freeze for Trace
impl RefUnwindSafe for Trace
impl Send for Trace
impl Sync for Trace
impl Unpin for Trace
impl UnsafeUnpin for Trace
impl UnwindSafe for Trace
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> 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::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more