Skip to content

Commit

Permalink
fix(metrics): do not bind to localhost as it causes issues with conta…
Browse files Browse the repository at this point in the history
…iners
  • Loading branch information
RolandSherwin committed Oct 5, 2023
1 parent 54962dd commit d506379
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sn_networking/src/metrics_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d506379

Please sign in to comment.