pub struct PrometheusLayer {
pub service_name: String,
}Expand description
Prometheus metrics layer for Axum.
Records http_requests_total (counter) and
http_requests_duration_seconds (histogram) for every request, labeled
by method, path (the matched route — bounded cardinality), service
and status. Requests to /metrics are excluded.
System metrics (CPU, memory, swap, disks) are not collected here.
Use spawn_system_metrics_collector at startup instead.
Fields§
§service_name: StringService name used as a label on every metric.
Trait Implementations§
Source§impl Clone for PrometheusLayer
impl Clone for PrometheusLayer
Source§fn clone(&self) -> PrometheusLayer
fn clone(&self) -> PrometheusLayer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PrometheusLayer
impl RefUnwindSafe for PrometheusLayer
impl Send for PrometheusLayer
impl Sync for PrometheusLayer
impl Unpin for PrometheusLayer
impl UnsafeUnpin for PrometheusLayer
impl UnwindSafe for PrometheusLayer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more