mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Update axum prometheus-metrics example (#2516)
Co-authored-by: Dudin.Roman <Roman@HPROMAN>
This commit is contained in:
co-authored by
Dudin.Roman
parent
dd3ff101e2
commit
94901e0fe7
@@ -110,8 +110,8 @@ async fn track_metrics(req: Request, next: Next) -> impl IntoResponse {
|
||||
("status", status),
|
||||
];
|
||||
|
||||
metrics::increment_counter!("http_requests_total", &labels);
|
||||
metrics::histogram!("http_requests_duration_seconds", latency, &labels);
|
||||
metrics::counter!("http_requests_total", &labels).increment(1);
|
||||
metrics::histogram!("http_requests_duration_seconds", &labels).record(latency);
|
||||
|
||||
response
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user