Expand description
Observability (o11y) helpers for the NEAR codebase.
This crate contains all sorts of utilities to enable a more convenient observability implementation in the NEAR codebase.
The are three infrastructures:
tracing
, for structured, hierarchical logging of events (seedefault_subscriber
function function in particular)metrics
– convenience wrappers around prometheus metric, for reporting statistics.io-tracer
– custom infrastructure for observing DB accesses in particular (mostly for parameter estimator)
Re-exports
pub use tracing;
pub use tracing_appender;
pub use tracing_subscriber;
pub use context::*;
Modules
- Custom tracing subscriber implementation that produces IO traces.
- A fork of the lighthouse_metrics crate used to implement prometheus
Macros
- A macro that lets attach
handle()
functions to the tracing context that generated the actix message being processed. Creates a DEBUG-level span with the handler type name and the message type name as attributes. - Internal use only.
- A macro that lets attach
handle()
functions to the tracing context that generated the actix message being processed. Creates a TRACE-level span with the handler type name and the message type name as attributes. - Asserts that the condition is true, logging an error otherwise.
Structs
- The resource representing a registered subscriber.
- Configures exporter of span and trace data.
Enums
- Whether to use colored log format. Option
Auto
enables color output only if the logging is done to a terminal andNO_COLOR
environment variable is not set.
Constants
- The default value for the
RUST_LOG
environment variable if one isn’t specified otherwise.
Traits
Functions
- Constructs a subscriber set to the option appropriate for the NEAR code.
- Constructs a subscriber set to the option appropriate for the NEAR code.
- Prints backtrace to stderr.
- Constructs new filters for the logging and opentelemetry layers.