fix: harden typed metrics review findings
This commit is contained in:
@@ -5,6 +5,7 @@ use axum::{
|
||||
body::{Body, to_bytes},
|
||||
http::{Request, StatusCode, header},
|
||||
middleware,
|
||||
response::IntoResponse,
|
||||
routing::get,
|
||||
};
|
||||
use crank_observability::{
|
||||
@@ -32,10 +33,12 @@ async fn http_metrics_use_matched_routes_and_closed_labels() {
|
||||
.route(
|
||||
"/api/admin/workspaces/{workspace_id}/operations/{operation_id}",
|
||||
get(|| async {
|
||||
(
|
||||
StatusCode::NO_CONTENT,
|
||||
[("x-trace-id", "0123456789abcdef0123456789abcdef")],
|
||||
)
|
||||
let mut response = StatusCode::NO_CONTENT.into_response();
|
||||
response.extensions_mut().insert(
|
||||
crank_metrics::ExemplarTraceId::parse("0123456789abcdef0123456789abcdef")
|
||||
.unwrap(),
|
||||
);
|
||||
response
|
||||
}),
|
||||
)
|
||||
.layer(middleware::from_fn(record_http_request));
|
||||
|
||||
Reference in New Issue
Block a user