From f78a83db31845f205edf4a4e05c1503128e4c48e Mon Sep 17 00:00:00 2001 From: Zahari Dichev Date: Mon, 20 Jan 2025 14:02:11 +0000 Subject: [PATCH] metrics: remove authority label on inbound http metrics Signed-off-by: Zahari Dichev --- linkerd/app/admin/src/stack.rs | 1 - linkerd/app/core/src/metrics.rs | 6 ------ linkerd/app/inbound/src/http/router.rs | 1 - linkerd/app/inbound/src/http/tests.rs | 1 - linkerd/app/integration/src/tests/telemetry.rs | 4 +--- 5 files changed, 1 insertion(+), 12 deletions(-) diff --git a/linkerd/app/admin/src/stack.rs b/linkerd/app/admin/src/stack.rs index 7f36f5d392..99833088d0 100644 --- a/linkerd/app/admin/src/stack.rs +++ b/linkerd/app/admin/src/stack.rs @@ -269,7 +269,6 @@ impl Param for Permitted { fn param(&self) -> metrics::EndpointLabels { metrics::InboundEndpointLabels { tls: self.http.tcp.tls.clone(), - authority: None, target_addr: self.http.tcp.addr.into(), policy: self.permit.labels.clone(), } diff --git a/linkerd/app/core/src/metrics.rs b/linkerd/app/core/src/metrics.rs index 8c3f99e7fe..4a1e4a7d6f 100644 --- a/linkerd/app/core/src/metrics.rs +++ b/linkerd/app/core/src/metrics.rs @@ -66,7 +66,6 @@ pub enum EndpointLabels { #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct InboundEndpointLabels { pub tls: tls::ConditionalServerTls, - pub authority: Option, pub target_addr: SocketAddr, pub policy: RouteAuthzLabels, } @@ -317,11 +316,6 @@ impl FmtLabels for EndpointLabels { impl FmtLabels for InboundEndpointLabels { fn fmt_labels(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - if let Some(a) = self.authority.as_ref() { - Authority(a).fmt_labels(f)?; - write!(f, ",")?; - } - ( (TargetAddr(self.target_addr), TlsAccept::from(&self.tls)), &self.policy, diff --git a/linkerd/app/inbound/src/http/router.rs b/linkerd/app/inbound/src/http/router.rs index c431a33378..70004fea08 100644 --- a/linkerd/app/inbound/src/http/router.rs +++ b/linkerd/app/inbound/src/http/router.rs @@ -391,7 +391,6 @@ impl Param for Logical { fn param(&self) -> metrics::EndpointLabels { metrics::InboundEndpointLabels { tls: self.tls.clone(), - authority: self.logical.as_ref().map(|d| d.as_http_authority()), target_addr: self.addr.into(), policy: self.permit.labels.clone(), } diff --git a/linkerd/app/inbound/src/http/tests.rs b/linkerd/app/inbound/src/http/tests.rs index f5dbe169e8..5cbfba583d 100644 --- a/linkerd/app/inbound/src/http/tests.rs +++ b/linkerd/app/inbound/src/http/tests.rs @@ -646,7 +646,6 @@ async fn grpc_response_class() { .get_response_total( &metrics::EndpointLabels::Inbound(metrics::InboundEndpointLabels { tls: Target::meshed_h2().1, - authority: Some("foo.svc.cluster.local:5550".parse().unwrap()), target_addr: "127.0.0.1:80".parse().unwrap(), policy: metrics::RouteAuthzLabels { route: metrics::RouteLabels { diff --git a/linkerd/app/integration/src/tests/telemetry.rs b/linkerd/app/integration/src/tests/telemetry.rs index 02a3adc059..0f619d1595 100644 --- a/linkerd/app/integration/src/tests/telemetry.rs +++ b/linkerd/app/integration/src/tests/telemetry.rs @@ -57,9 +57,7 @@ impl Fixture { let client = client::new(proxy.inbound, "tele.test.svc.cluster.local"); let tcp_dst_labels = metrics::labels().label("direction", "inbound"); let tcp_src_labels = tcp_dst_labels.clone().label("target_addr", orig_dst); - let labels = tcp_dst_labels - .clone() - .label("authority", "tele.test.svc.cluster.local"); + let labels = tcp_dst_labels.clone().label("target_port", orig_dst.port()); let tcp_src_labels = tcp_src_labels.label("peer", "src"); let tcp_dst_labels = tcp_dst_labels.label("peer", "dst"); Fixture {