From d50637924aa2419f2bddaa1de3ebe190f54de104 Mon Sep 17 00:00:00 2001 From: Roland Sherwin Date: Thu, 5 Oct 2023 13:35:03 +0530 Subject: [PATCH] fix(metrics): do not bind to localhost as it causes issues with containers --- sn_networking/src/metrics_service.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sn_networking/src/metrics_service.rs b/sn_networking/src/metrics_service.rs index f5ee44f143..5da6fc7a41 100644 --- a/sn_networking/src/metrics_service.rs +++ b/sn_networking/src/metrics_service.rs @@ -19,8 +19,8 @@ use std::{ const METRICS_CONTENT_TYPE: &str = "application/openmetrics-text;charset=utf-8;version=1.0.0"; pub(crate) fn run_metrics_server(registry: Registry) { - // Serve on localhost. - let addr = ([127, 0, 0, 1], 0).into(); + // The server should not bind to localhost/127.0.0.1 as it will not accept connections from containers. + let addr = ([0, 0, 0, 0], 0).into(); tokio::spawn(async move { let server = Server::bind(&addr).serve(MakeMetricService::new(registry));