From 0d121dbe76f0cb80827ae20e4137c2923dc5f4fe Mon Sep 17 00:00:00 2001 From: phil Date: Mon, 2 Feb 2026 12:30:59 -0500 Subject: [PATCH] address earlier pr comments --- slingshot/src/server.rs | 2 +- spacedust/src/main.rs | 9 +++------ ufos/src/main.rs | 9 +++------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/slingshot/src/server.rs b/slingshot/src/server.rs index ad9dd72..e0819e7 100644 --- a/slingshot/src/server.rs +++ b/slingshot/src/server.rs @@ -755,7 +755,7 @@ pub async fn serve( ) .await } else { - run(TcpListener::bind(bind.to_string()), app, shutdown).await + run(TcpListener::bind(bind), app, shutdown).await } } diff --git a/spacedust/src/main.rs b/spacedust/src/main.rs index 1e26bd8..aae1554 100644 --- a/spacedust/src/main.rs +++ b/spacedust/src/main.rs @@ -138,7 +138,7 @@ async fn main() -> Result<(), String> { } fn install_metrics_server( - bind_metrics: std::net::SocketAddr, + bind: std::net::SocketAddr, ) -> Result<(), metrics_exporter_prometheus::BuildError> { log::info!("installing metrics server..."); PrometheusBuilder::new() @@ -146,11 +146,8 @@ fn install_metrics_server( .set_bucket_duration(std::time::Duration::from_secs(300))? .set_bucket_count(std::num::NonZero::new(12).unwrap()) // count * duration = 60 mins. stuff doesn't happen that fast here. .set_enable_unit_suffix(false) // this seemed buggy for constellation (sometimes wouldn't engage) - .with_http_listener(bind_metrics) + .with_http_listener(bind) .install()?; - log::info!( - "metrics server installed! listening on http://{}", - bind_metrics - ); + log::info!("metrics server installed! listening on {bind}"); Ok(()) } diff --git a/ufos/src/main.rs b/ufos/src/main.rs index 9f5cafe..20f7cfe 100644 --- a/ufos/src/main.rs +++ b/ufos/src/main.rs @@ -165,19 +165,16 @@ async fn go( Ok(()) } -fn install_metrics_server(bind_metrics: std::net::SocketAddr) -> anyhow::Result<()> { +fn install_metrics_server(bind: std::net::SocketAddr) -> anyhow::Result<()> { log::info!("installing metrics server..."); PrometheusBuilder::new() .set_quantiles(&[0.5, 0.9, 0.99, 1.0])? .set_bucket_duration(Duration::from_secs(60))? .set_bucket_count(std::num::NonZero::new(10).unwrap()) // count * duration = 10 mins. stuff doesn't happen that fast here. .set_enable_unit_suffix(false) // this seemed buggy for constellation (sometimes wouldn't engage) - .with_http_listener(bind_metrics) + .with_http_listener(bind) .install()?; - log::info!( - "metrics server installed! listening on http://{}", - bind_metrics - ); + log::info!("metrics server installed! listening on {bind}"); Ok(()) } -- 2.51.2