Add MsgJsonFormat custom event formatter that outputs JSON with _msg as the first field, required by VictoriaLogs for full-text search. HTTP middleware stores interpolated "METHOD /path" in thread-local buffer for the formatter to read on span-close events.
23 lines
807 B
Rust
23 lines
807 B
Rust
//! Observability primitives: tracing subscriber, metrics, OTLP export.
|
|
//!
|
|
//! Call `observability::init_tracing_subscriber(level)` once at startup.
|
|
//! All services then use `tracing::info!`, `tracing::warn!`, etc. directly.
|
|
|
|
pub mod tracing_fmt;
|
|
pub mod tracing_init;
|
|
pub mod msg_json_fmt;
|
|
pub mod metrics_middleware;
|
|
pub mod prometheus_exporter;
|
|
pub mod otlp;
|
|
pub mod tracing_middleware;
|
|
|
|
pub use tracing_fmt::{init_tracing_subscriber, instance_id};
|
|
pub use msg_json_fmt::set_span_msg;
|
|
pub use metrics_middleware::{MetricsMiddleware, HttpMetrics};
|
|
pub use prometheus_exporter::{
|
|
install_recorder, prometheus_handler, spawn_http_metrics_poller,
|
|
HttpMetricsSnapshot, HttpSnapshotGuard, render_to_hashmap,
|
|
};
|
|
pub use otlp::{init_otlp, OtelGuard};
|
|
pub use tracing_middleware::TracingSpanMiddleware;
|