Expand description
Custom tracing layer that captures plain trace events for invariants.
SimulationLayer subscribes to ordinary tracing events — the same
emissions production observability consumes. An event is captured iff:
- its level is
INFOor more severe, and - it is emitted inside a span carrying an
ipfield (the orchestrator wraps every process and workload task in such a span), and - it has a non-empty message, which becomes the event’s name.
Runner-injected fault events bypass tracing entirely: the orchestrator
drains them from the simulation engine and records them via
SimulationLayerHandle::record_sim_fault with source = "sim".
Simulation time is stamped from the layer’s internal clock, advanced by
the orchestrator via SimulationLayerHandle::set_sim_time_ms after each
step. Invariants are run by the orchestrator through
SimulationLayerHandle::run_invariants — never from inside tracing
dispatch.
Storage is held behind a parking_lot::Mutex to satisfy the
Send + Sync bound on tracing::Layer. moonpool simulations run
single-threaded so the mutex is uncontended.
Structs§
- Install
Guard - Drop-guard returned by
SimulationLayer::install. Restores the previous subscriber when dropped. - Simulation
Layer - A
tracing::Layerthat captures plain trace events emitted inside process/workload spans. - Simulation
Layer Handle - Cheap-to-clone handle to a
SimulationLayer’s captured state.