Skip to content

Commit

Permalink
ingestion: remove unecessary clone in duration tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
intarga committed Feb 27, 2025
1 parent ce22a14 commit 14e623d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ingestion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,18 +441,14 @@ async fn track_request_duration(req: Request, next: Next) -> impl IntoResponse {
} else {
req.uri().path().to_owned()
};
let method = req.method().clone();
let method = req.method().to_string();

let response = next.run(req).await;

let latency = start.elapsed().as_secs_f64();
let status = response.status().as_u16().to_string();

let labels = [
("method", method.to_string()),
("path", path),
("status", status),
];
let labels = [("method", method), ("path", path), ("status", status)];

metrics::histogram!("http_requests_duration_seconds", &labels).record(latency);

Expand Down

0 comments on commit 14e623d

Please sign in to comment.