Skip to content

Commit

Permalink
fix: listen address config ignored (#362)
Browse files Browse the repository at this point in the history
The metrics listener address mistakenly ignored the configured
listen address.

Changes the listener initialization to use the configured value.
  • Loading branch information
brayniac authored Oct 23, 2024
1 parent 210a234 commit 4d2d253
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/exposition/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ struct AppState {
}

pub async fn serve(config: Arc<Config>, samplers: Arc<Box<[Box<dyn Sampler>]>>) {
let state = Arc::new(AppState { config, samplers });
let state = Arc::new(AppState {
config: config.clone(),
samplers,
});

let app: Router = app(state);

let listener = TcpListener::bind("0.0.0.0:4242")
let listener = TcpListener::bind(config.general().listen())
.await
.expect("failed to listen");

Expand Down

0 comments on commit 4d2d253

Please sign in to comment.