dr_metrix_axum/lib.rs
1//! # metrics-axum
2//!
3//! Axum integration for the metrics-exporter workspace.
4//!
5//! Provides:
6//! - **`PrometheusMetrics`** — shared state holding the registry, HTTP request
7//! metrics, and database collector handles. Drop-in for Axum's `State`.
8//! - **`HttpMetricsLayer`** — a Tower layer / middleware that automatically
9//! records `http_requests_total`, `http_request_duration_seconds`, and
10//! `http_requests_in_flight` for every request.
11//! - **`metrics_handler`** — an Axum handler that encodes and serves the
12//! Prometheus text exposition format on `GET /metrics`.
13//! - **`health_handler`** — a simple `GET /health` liveness probe.
14//! - Helpers to register the default Prometheus **process collector** and an
15//! optional **Tokio runtime collector** so they appear alongside the
16//! database metrics.
17
18pub mod handler;
19pub mod http_metrics;
20pub mod layer;
21pub mod state;
22
23pub use handler::{health_handler, metrics_handler};
24pub use layer::HttpMetricsLayer;
25pub use state::PrometheusMetrics;