Skip to content

Commit

Permalink
Add method label to janus_http_request_duration (#2465)
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave authored Jan 9, 2024
1 parent edc4c05 commit 16a0fbc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aggregator/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3155,6 +3155,7 @@ async fn send_request_to_helper<T: Encode>(
let domain = url.domain().unwrap_or_default().to_string();
let request_body = request.get_encoded();
let (auth_header, auth_value) = auth_token.request_authentication();
let method_string = method.as_str().to_string();

let start = Instant::now();
let response_result = http_client
Expand All @@ -3173,6 +3174,7 @@ async fn send_request_to_helper<T: Encode>(
KeyValue::new("status", "error"),
KeyValue::new("domain", domain),
KeyValue::new("endpoint", route_label),
KeyValue::new("method", method_string),
],
);
return Err(error.into());
Expand All @@ -3187,6 +3189,7 @@ async fn send_request_to_helper<T: Encode>(
KeyValue::new("status", "error"),
KeyValue::new("domain", domain),
KeyValue::new("endpoint", route_label),
KeyValue::new("method", method_string),
],
);
return Err(Error::Http(Box::new(
Expand All @@ -3202,6 +3205,7 @@ async fn send_request_to_helper<T: Encode>(
KeyValue::new("status", "success"),
KeyValue::new("domain", domain),
KeyValue::new("endpoint", route_label),
KeyValue::new("method", method_string),
],
);
Ok(response_body)
Expand All @@ -3213,6 +3217,7 @@ async fn send_request_to_helper<T: Encode>(
KeyValue::new("status", "error"),
KeyValue::new("domain", domain),
KeyValue::new("endpoint", route_label),
KeyValue::new("method", method_string),
],
);
Err(error.into())
Expand Down

0 comments on commit 16a0fbc

Please sign in to comment.