//! 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 metrics_middleware;
pub mod prometheus_exporter;
pub mod otlp;
pub mod tracing_middleware;
pub mod redis_metrics;

pub use tracing_fmt::{init_tracing_subscriber, instance_id};
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;
pub use redis_metrics::{
    MetricsSnapshot,
    spawn_redis_metrics_flusher,
    query_instance_metrics, query_all_instance_metrics, export_all_metrics_csv,
    FlatInstanceMetrics,
};
