Skip to content

Commit 57dd186

Browse files
committed
refactor: add fn to get socket addr using metrics port
1 parent 423f1c2 commit 57dd186

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

common/src/indexer_service/http/indexer_service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ impl IndexerService {
485485
.with_state(state),
486486
);
487487

488-
Self::serve_metrics(options.config.server.metrics_host_and_port);
488+
Self::serve_metrics(options.config.metrics.get_socket_addr());
489489

490490
info!(
491491
address = %options.config.service.host_and_port,

config/src/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ pub struct MetricsConfig {
270270
pub port: u16,
271271
}
272272

273+
impl MetricsConfig {
274+
pub fn get_socket_addr(&self) -> SocketAddr {
275+
SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(0, 0, 0, 0), self.port))
276+
}
277+
}
278+
273279
#[derive(Debug, Deserialize, Clone)]
274280
#[cfg_attr(test, derive(PartialEq))]
275281
pub struct SubgraphsConfig {

0 commit comments

Comments
 (0)