diff --git a/crates/ethereum/node/src/launch.rs b/crates/ethereum/node/src/launch.rs index eb699cea2d..029e3960d9 100644 --- a/crates/ethereum/node/src/launch.rs +++ b/crates/ethereum/node/src/launch.rs @@ -89,7 +89,7 @@ where .inspect(|_| { info!(target: "reth::cli", "Database opened"); }) - .with_prometheus().await? + .with_prometheus_server().await? .inspect(|this| { debug!(target: "reth::cli", chain=%this.chain_id(), genesis=?this.genesis_hash(), "Initializing genesis"); }) @@ -97,7 +97,7 @@ where .inspect(|this| { info!(target: "reth::cli", "\n{}", this.chain_spec().display_hardforks()); }) - .with_metrics() + .with_metrics_task() // passing FullNodeTypes as type parameter here so that we can build // later the components. .with_blockchain_db::()? diff --git a/crates/node/builder/src/launch/common.rs b/crates/node/builder/src/launch/common.rs index b141768d5f..a2b2818616 100644 --- a/crates/node/builder/src/launch/common.rs +++ b/crates/node/builder/src/launch/common.rs @@ -454,8 +454,10 @@ where self.right().static_file_provider() } + /// This launches the prometheus endpoint. + /// /// Convenience function to [`Self::start_prometheus_endpoint`] - pub async fn with_prometheus(self) -> eyre::Result { + pub async fn with_prometheus_server(self) -> eyre::Result { self.start_prometheus_endpoint().await?; Ok(self) } @@ -486,7 +488,12 @@ where /// Creates a new `WithMeteredProvider` container and attaches it to the /// launch context. - pub fn with_metrics(self) -> LaunchContextWith>> { + /// + /// This spawns a metrics task that listens for metrics related events and updates metrics for + /// prometheus. + pub fn with_metrics_task( + self, + ) -> LaunchContextWith>> { let (metrics_sender, metrics_receiver) = unbounded_channel(); let with_metrics = diff --git a/crates/node/builder/src/launch/mod.rs b/crates/node/builder/src/launch/mod.rs index fb22e79084..c18381a2de 100644 --- a/crates/node/builder/src/launch/mod.rs +++ b/crates/node/builder/src/launch/mod.rs @@ -135,7 +135,7 @@ where .inspect(|_| { info!(target: "reth::cli", "Database opened"); }) - .with_prometheus().await? + .with_prometheus_server().await? .inspect(|this| { debug!(target: "reth::cli", chain=%this.chain_id(), genesis=?this.genesis_hash(), "Initializing genesis"); }) @@ -143,7 +143,7 @@ where .inspect(|this| { info!(target: "reth::cli", "\n{}", this.chain_spec().display_hardforks()); }) - .with_metrics() + .with_metrics_task() // passing FullNodeTypes as type parameter here so that we can build // later the components. .with_blockchain_db::()?