diff --git a/services/api/src/middleware/logger.rs b/services/api/src/middleware/logger.rs index eaf26c8b..4da52995 100644 --- a/services/api/src/middleware/logger.rs +++ b/services/api/src/middleware/logger.rs @@ -41,10 +41,19 @@ pub async fn logger(request: Request, next: Next) -> Response { let elapsed = start.elapsed().as_millis(); info!( - "handled request for {} {} in {}ms", - method, endpoint, elapsed + "{} handled request for {} {} in {}ms", + response.status(), + method, + endpoint, + elapsed + ); + histogram!( + "pk_http_requests", + (elapsed as f64) / 1_000_f64, + "method" => method.to_string(), + "route" => endpoint.clone(), + "status" => response.status().to_string() ); - histogram!("pk_http_requests", (elapsed as f64) / 1_000_f64, "method" => method.to_string(), "endpoint" => endpoint.clone()); if elapsed > MIN_LOG_TIME { warn!(