From e1bdf78949c20f4ea9a2484476aa5fc012c90ee3 Mon Sep 17 00:00:00 2001 From: William Wen <44139337+wenym1@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:46:22 +0800 Subject: [PATCH] fix(metrics): avoid port in connection metrics label (#12860) --- src/common/src/monitor/connection.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/src/monitor/connection.rs b/src/common/src/monitor/connection.rs index dbe75087dfa21..0c153a3931098 100644 --- a/src/common/src/monitor/connection.rs +++ b/src/common/src/monitor/connection.rs @@ -226,7 +226,7 @@ where } fn call(&mut self, uri: Uri) -> Self::Future { - let endpoint = format!("{:?}:{:?}", uri.host(), uri.port()); + let endpoint = format!("{:?}", uri.host()); let monitor = self.monitor.clone(); self.inner .call(uri) @@ -259,7 +259,7 @@ where result.map(|conn| { let remote_addr = conn.connect_info().remote_addr(); let endpoint = remote_addr - .map(|remote_addr| format!("{}:{}", remote_addr.ip(), remote_addr.port())) + .map(|remote_addr| format!("{}", remote_addr.ip())) .unwrap_or("unknown".to_string()); MonitoredConnection::new(conn, monitor.new_connection_monitor(endpoint)) })