pub fn trace<T>(root_name: &str, f: impl FnOnce() -> T) -> TExpand description
Runs f as a trace named root_name (for example "GET /checkout" or "job:reindex"): every
span, http_span and record_span inside it, on this thread, nests beneath this root.
When f took at least Configuration.trace_capture_threshold (1 second by default) the whole
trace is sent to ForgeOps, so fast calls cost nothing on the wire. Sent even if f panics.
Called inside an already-open trace it just records a span instead. Errors captured inside it
carry its trace id (see current_trace_id).
This crate has no web framework integration, so nothing starts a trace automatically: wrap
whatever you want traced, typically a request handler or a background job. To continue a trace
another service started, use continue_trace with its traceparent header.
let status = forge_ops_tracker::trace("GET /checkout", || handle_request());