$$$$$$$$$$
traceparent
& tracestate
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
│ │ │ │
version ◄────┘ │ │ │
trace-id ◄──────┘ │ │
parent-id ◄─────────────────────────────────────┘ │
trace-flags (01 = sampled) ◄──────────────────────────────────────┘
tracestate: key=value,vendorname1=opaqueValue1,vendorname2=opaqueValue2
use tracing::{event, info, Level};
// records an event outside of any span context:
event!(Level::INFO, "something happened");
info!(foo=blah, "something else happened")
info!(target:"otel::tracing", "Only exported to tracing")
use tracing::{span, Level};
let span = span!(Level::info, "my span");
// Enter the span, returning a guard object.
let _enter = span.enter();
let json = info_span!("json.parse").in_scope(||
serde_json::from_slice(&buf)
)?;
// Any trace events that occur before the guard is
// dropped will occur within the span.
// Dropping the guard will exit the span.
#[tracing::instrument]
pub fn my_function(my_arg: usize) {
// This event will be recorded inside a span named `my_function`
// with the field `my_arg`.
info!("inside my_function!");
}
Lets looks at some dashboards