o_sfu_telemetry/lib.rs
1//! telemetry setup, metric catalog and diagnostics schema
2//!
3//! `o-sfu-telemetry` keeps runtime observability contracts in one crate
4//! the server initializes tracing from `TelemetryConfig`, records process-local
5//! metrics through typed helpers and renders diagnostics or Prometheus output
6//! from the metric catalog
7//!
8//! ```
9//! use o_sfu_telemetry::{
10//! metrics::{HttpRoute, RoomGaugeValues, RuntimeMetrics},
11//! prometheus::render_prometheus,
12//! };
13//!
14//! let metrics = RuntimeMetrics::default();
15//! let request = metrics.track_http_request(HttpRoute::Noop);
16//! let body = render_prometheus(&metrics, RoomGaugeValues::default());
17//! drop(request);
18//! assert!(body.contains("osfu_http_noop_requests_total"));
19//! ```
20//!
21//! process-global tracing setup lives behind `init_tracing`
22//! code that only needs counters, diagnostics or schema names can use those
23//! modules without installing a tracing subscriber
24
25mod config;
26pub mod diagnostics;
27pub mod graph;
28pub mod metrics;
29pub mod prometheus;
30pub mod schema;
31mod setup;
32
33pub use config::{
34 DEFAULT_MEDIA_QUALITY_INTERVAL, DEFAULT_TELEMETRY_DEPLOYMENT_ENVIRONMENT,
35 DEFAULT_TELEMETRY_SERVICE_NAME, TelemetryConfig, TelemetryLogFormat, TelemetryResource,
36 TraceExportConfig,
37};
38pub use setup::{
39 TelemetryHandle, activated_span, http_request_span, init_tracing, ws_handshake_span,
40 ws_upgrade_span,
41};