Skip to main content

write_trace_ids

Function write_trace_ids 

Source
fn write_trace_ids<S>(
    line: &mut String,
    ctx: &FmtContext<'_, S, FieldFormat>,
) -> Result
where S: Subscriber + for<'lookup> LookupSpan<'lookup>,
Expand description

Writes the IDs of the exported span closest to the event, if that span is sampled.

The OpenTelemetry layer stores each exported span’s ID, but not whether it is sampled, so the IDs come from the context the layer activates when an exported span is entered. That context belongs to the event only if it is the closest exported span’s own context, which isn’t the case for an event with an explicit parent or parent: None.