Skip to content

Commit

Permalink
fix: listen address config ignored
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 committed Oct 23, 2024
1 parent 210a234 commit 980fb67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/exposition/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ 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 980fb67

Please sign in to comment.