From 802d93efff09fff9ae6b1083ba4a213f28fcad43 Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Thu, 18 Apr 2024 14:18:41 -0700 Subject: [PATCH] fix(http): fix outbound HTTP metrics naming (#2903) 31d7464ef introduced a naming regression, so that metrics that 'outbound_http_' became 'outbound_http_http_'. This change fixes this regression. --- linkerd/app/outbound/src/metrics.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/linkerd/app/outbound/src/metrics.rs b/linkerd/app/outbound/src/metrics.rs index 34f2706592..7a7fef5a47 100644 --- a/linkerd/app/outbound/src/metrics.rs +++ b/linkerd/app/outbound/src/metrics.rs @@ -84,10 +84,13 @@ where impl PromMetrics { pub fn register(registry: &mut prom::Registry) -> Self { - Self { - http: crate::http::HttpMetrics::register(registry.sub_registry_with_prefix("http")), - opaq: crate::opaq::OpaqMetrics::register(registry.sub_registry_with_prefix("tcp")), - } + // NOTE: HTTP metrics are scoped internally, since this configures both + // HTTP and gRPC scopes. + let http = crate::http::HttpMetrics::register(registry); + + let opaq = crate::opaq::OpaqMetrics::register(registry.sub_registry_with_prefix("tcp")); + + Self { http, opaq } } }