Expand description
In-memory tracing::Subscriber that holds spans and events for
inspection by a console UI.
Open spans live in a sharded slab; closed spans flow through a
lock-free spillway channel into a background Driver that
commits them to a shared BTreeMap. Filtering is pluggable via
EnabledPredicate; the default LevelPredicate enables
everything at or below a given level.
Structs§
- Cache
Config - Optional knobs for the cache + driver. Pass to
crate::SpanCache::with_config/crate::SpanCache::with_predicate_and_config; the no-config constructors useCacheConfig::default. - Chance
Handle - Remote control for a
ChancePredicate’s active percentage. Cloning shares the same atomic — multiple owners observe and mutate the same value. Reads areRelaxedsince per-span freshness is not required; updates are visible to the next roll. - Chance
Predicate - Predicate wrapper that probabilistically denies root spans before
they get to the inner predicate. Root spans (the ones whose
Attributescarrytracing::span::Attributes::is_root()— typicallytracing::span!(parent: None, …)) are gated by a runtime-tunable percentage; descendants and events pass straight through to the inner predicate. - Driver
- Event
Record - One captured event.
metadataandrecorded_atareOptionpurely soEventRecordcan implementDefaultfor the internal object pool — they are alwaysSomeonce an event has been published through the subscriber. Helper accessorsmetadata()/recorded_at()fall back to safe defaults rather than panic. - Level
Handle - Remote control for a
LevelPredicate’s active level. Cloning shares the same atomic — multiple owners (e.g. one per administrative connection) all see and mutate the same value. - Level
Predicate - Default predicate: enables everything at or below the current
LevelFiltersetting (includingOFFfor “disable everything”). - Reuse
Ref - A pool-backed owned reference.
Deref/DerefMutgive access to the innerT; on drop the value is reset and handed back to the source shard if room is available andtry_locksucceeds — otherwise dropped. - Span
Cache - A
tracing::Subscriberthat holds spans in memory for inspection. - Span
Record
Enums§
- Field
Value - Each captured field value.
Strkeeps a&'static str(zero-copy for literal field arguments),SmallStringkeeps the stack-inline-up-to-24-byteCompactString(no heap for short dynamic strings),SharedStringkeeps anArc<String>for callers that want sharing, andStringis the unrestricted owned fallback. - Interest
- Mirror of
tracing::subscriber::Interest— kept as our own type so the predicate trait isn’t bound to tracing’s exact type.
Constants§
- DEFAULT_
LANE_ COUNT - Default number of in-flight slab shards (must be a power of two).
Traits§
Type Aliases§
- Field
List - A field list small enough to keep inline for the typical span. Spans or events with > 8 fields spill to the heap.