Crate unc_o11y

Source
Expand description

Observability (o11y) helpers for the Utility codebase.

This crate contains all sorts of utilities to enable a more convenient observability implementation in the UNC codebase.

The are three unc-infra.tructures:

  • tracing, for structured, hierarchical logging of events (see default_subscriber function function in particular)
  • metrics – convenience wrappers around prometheus metric, for reporting statistics.
  • io-tracer – custom unc-infra.tructure for observing DB accesses in particular (mostly for parameter estimator)

Re-exports§

pub use env_filter::BuildEnvFilterError;
pub use env_filter::EnvFilterBuilder;
pub use tracing;
pub use tracing_appender;
pub use tracing_subscriber;
pub use context::*;

Modules§

context
Custom tracing subscriber implementation that produces IO traces.
env_filter
log_config
macros
metrics
A fork of the lighthouse_metrics crate used to implement prometheus
testonly

Macros§

handler_debug_span
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.
handler_span
Internal use only.
handler_trace_span
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.
io_trace
log_assert
Asserts that the condition is true, logging an error otherwise.
log_assert_fail
The same as ‘log_assert’ but always fails.

Structs§

Options
Configures exporter of span and trace data.

Enums§

OpenTelemetryLevel

Traits§

OpenTelemetrySpanExt
Utility functions to allow tracing Spans to accept and return OpenTelemetry Contexts.

Functions§

default_subscriber
Constructs a subscriber set to the option appropriate for the UNC code.
default_subscriber_with_opentelemetry
Constructs a subscriber set to the option appropriate for the UNC code.
print_backtrace
Prints backtrace to stderr.
reload
Constructs new filters for the logging and opentelemetry layers.
reload_log_config