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>,
/* 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.
Implementations§
Source§impl Trace
impl Trace
Sourcepub fn new(spans: Vec<Span>, ingest_info: TraceIngestInfo) -> Self
pub fn new(spans: Vec<Span>, ingest_info: TraceIngestInfo) -> Self
Creates a new Trace with the given spans, ingested through the protocol described by ingest_info.
All other unified fields default to empty / zero. Callers should set them directly after construction.
Sourcepub fn ingest_info(&self) -> TraceIngestInfo
pub fn ingest_info(&self) -> TraceIngestInfo
Returns the protocol this trace was ingested through.
Fixed at construction, so later changes to spans or attributes cannot reclassify the trace.
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§
Source§impl Attributes for Trace
impl Attributes for Trace
type Text = MetaString
type Bytes = Vec<u8>
type Values = SalukiValues
Source§fn attribute_str(&self, key: &str) -> Option<&str>
fn attribute_str(&self, key: &str) -> Option<&str>
None if it is missing or not a
string.Source§fn attribute_f64(&self, key: &str) -> Option<f64>
fn attribute_f64(&self, key: &str) -> Option<f64>
None if it is missing or not a
number. Integers are converted to f64.Source§impl AttributesIter for Trace
impl AttributesIter for Trace
Source§fn attributes(
&self,
) -> impl Iterator<Item = (&str, AttributeRef<'_, SalukiValues>)>
fn attributes( &self, ) -> impl Iterator<Item = (&str, AttributeRef<'_, SalukiValues>)>
(key, value) attribute pairs, each key at most onceSource§impl AttributesMut for Trace
impl AttributesMut for Trace
Source§fn retain_attributes(
&mut self,
f: impl FnMut(&str, &mut AttributeValue) -> bool,
)
fn retain_attributes( &mut self, f: impl FnMut(&str, &mut AttributeValue) -> bool, )
f returns true; f may mutate the values it keeps.
Like [AttributesIter::attributes], f sees each key once.Source§fn attribute_mut(&mut self, key: &str) -> Option<&mut AttributeValue>
fn attribute_mut(&mut self, key: &str) -> Option<&mut AttributeValue>
None if it is missingSource§fn set_attribute(&mut self, key: MetaString, value: AttributeValue)
fn set_attribute(&mut self, key: MetaString, value: AttributeValue)
key, replacing any existing value for that keySource§fn remove_attribute(&mut self, key: &str) -> Option<AttributeValue>
fn remove_attribute(&mut self, key: &str) -> Option<AttributeValue>
key, returning its value if it was presentSource§impl EventKind for Trace
impl EventKind for Trace
Source§const EVENT_TYPE: EventType = EventType::Trace
const EVENT_TYPE: EventType = EventType::Trace
Source§fn into_event(self) -> Event
fn into_event(self) -> Event
Event.Source§fn try_from_event(event: Event) -> Result<Self, Event>
fn try_from_event(event: Event) -> Result<Self, Event>
Source§fn try_from_event_ref(event: &Event) -> Option<&Self>
fn try_from_event_ref(event: &Event) -> Option<&Self>
Source§fn try_from_event_mut(event: &mut Event) -> Option<&mut Self>
fn try_from_event_mut(event: &mut Event) -> Option<&mut Self>
Source§impl TraceChunk for Trace
impl TraceChunk for Trace
type Span = Span
Source§fn origin(&self) -> &str
fn origin(&self) -> &str
_dd.origin value shared by every span in the chunk, empty if unsetSource§fn priority(&self) -> Option<i32>
fn priority(&self) -> Option<i32>
None if no decision was madeSource§fn sampling_mechanism(&self) -> Option<u32>
fn sampling_mechanism(&self) -> Option<u32>
None if unsetSource§fn dropped_trace(&self) -> bool
fn dropped_trace(&self) -> bool
priority. Senders should base sampling decisions on [Self::priority], not on this
flag.Source§impl TraceChunkMut for Trace
impl TraceChunkMut for Trace
Source§fn set_origin(&mut self, value: MetaString)
fn set_origin(&mut self, value: MetaString)
_dd.origin value shared by every span in the chunk, empty to unset itSource§fn set_priority(&mut self, priority: i32)
fn set_priority(&mut self, priority: i32)
Source§fn set_sampling_mechanism(&mut self, mechanism: u32)
fn set_sampling_mechanism(&mut self, mechanism: u32)
Source§fn set_dropped_trace(&mut self, value: bool)
fn set_dropped_trace(&mut self, value: bool)
TraceChunk::dropped_trace]. Senders don’t need to
set it: it is ignored on send paths, and the agent overwrites it.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