Expand description
A crate providing macros for creating spans in various detail levels. coarse! should be used for top-level operations, whereas
detail! should be used in plumbing crates unless their operations are likely to cost a lot of time.
Applications opt in through this crate’s tracing feature or the corresponding feature on gix.
Plumbing crates use gix_trace directly, and applications using gix can use its trace reexport.
Enable forest to collect and print trace trees; its module documentation explains connecting worker spans to their parent.
§Feature Flags
-
default— There is no default feature: applications opt in throughgixor this crate directly. -
tracing— Implementtracingwith thetracingcrate, which provides applications with valuable performance details if they opt-in to it.Note that this may have overhead as well, thus instrumentations should be used stategically, only providing coarse tracing by default and adding details only where needed while marking them with the appropriate level.
-
tracing-detail— If enabled, detailed tracing is also emitted, which can greatly increase insights but at a cost. -
forest— Collect spans and events into trees and process or print completed trees synchronously. -
forest-ansi— Colorize the forest’s pretty-printed output with ANSI escape sequences. -
forest-cpu-time— Measure user and kernel CPU time in forest spans on Linux, macOS, FreeBSD, and OpenBSD. Sampling adds overhead on span entry and exit. Other platforms report CPU time as unavailable.
Modules§
- event
- field
tracing SpanandEventkey-value data.- forest
forest - Collect related tracing spans and events into trees, then process each completed root.
Macros§
- coarse
- Create a new coarse span.
- debug
- Emit a debug event.
- detail
- Create a new detail span.
- error
- Emit an error event.
- event
tracing - Create an event with the given level.
- info
- Emit an info event.
- span
tracing - A macro to create a span.
- trace
- Emit a trace event.
- warn
- Emit a warn event.
Structs§
- Forest
Layer forest - A
tracing_subscriber::Layerthat collects and processes trace data while preserving contextual coherence. - Span
tracing - An entered span which will exit on drop.
Enums§
- Level
- The level at which the tracing item should be created.
Constants§
- MAX_
LEVEL tracing-detail - The maximum allowed level for tracing items, as compiled in.
Functions§
- in_
thread - Capture the current span and subscriber, restoring both while the returned closure runs.