From dfd8bb8e34d7e149ba12f68f5dd6c32229ac2ef3 Mon Sep 17 00:00:00 2001 From: Luis Herasme Date: Fri, 16 Aug 2024 17:52:59 -0400 Subject: [PATCH] refactor: bind Prometheus listener to dynamic address --- ghost-crab/src/logs/prometheus.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost-crab/src/logs/prometheus.rs b/ghost-crab/src/logs/prometheus.rs index 24dabdf..5b604f3 100644 --- a/ghost-crab/src/logs/prometheus.rs +++ b/ghost-crab/src/logs/prometheus.rs @@ -120,7 +120,7 @@ impl Prometheus { tokio::spawn(async move { let app = Router::new().route("/metrics", get(metrics_handler)).with_state(state); - let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); + let listener = tokio::net::TcpListener::bind(address.as_str()).await.unwrap(); println!("Metrics server listening on {:?}", listener); axum::serve(listener, app).await.unwrap(); });