fix: harden typed metrics review findings

This commit is contained in:
2026-08-14 13:50:04 +03:00
parent 996a5461de
commit b7face0e94
30 changed files with 722 additions and 382 deletions
@@ -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));