Skip to main content

renacer_core/
lib.rs

1//! renacer-core: Zero-dependency tracing primitives
2//!
3//! Extracted from renacer to break the renacer→aprender→realizr→renacer
4//! circular dependency (PMAT-284). This crate provides:
5//!
6//! - [`SpanRecord`] — Parquet-compatible span schema (W3C Trace Context)
7//! - [`LazySpan`] — Deferred span construction (zero overhead when unused)
8//! - [`SpanPool`] — Memory pool for span allocations
9//! - [`TraceContext`] / [`LamportClock`] — W3C trace context + causal ordering
10//!
11//! # Design
12//!
13//! This crate has NO dependencies on aprender, realizr, or trueno.
14//! It can be used by any crate in the stack for uniform instrumentation.
15//!
16//! # Usage in realizr
17//!
18//! ```ignore
19//! use renacer_core::LazySpan;
20//!
21//! let span = LazySpan::new()
22//!     .with_name_static("decode_step")
23//!     .with_attribute_static("m", state.m.to_string())
24//!     .timed();  // starts timing
25//! // ... GPU work ...
26//! span.finish(); // records duration
27//! ```
28
29pub mod lazy_span;
30pub mod phase_timer;
31pub mod span_pool;
32pub mod span_record;
33pub mod trace_context;
34
35pub use lazy_span::LazySpan;
36pub use phase_timer::PhaseTimer;
37pub use span_pool::SpanPool;
38pub use span_record::{SpanKind, SpanRecord, StatusCode};
39pub use trace_context::{LamportClock, TraceContext};