chore: clarify metrics and prometheus (#9603)

This commit is contained in:
Matthias Seitz
2024-07-18 12:26:10 +02:00
committed by GitHub
parent 0585bb28a1
commit 9e1ea9718a
3 changed files with 13 additions and 6 deletions

View File

@ -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::<T>()?

View File

@ -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<Self> {
pub async fn with_prometheus_server(self) -> eyre::Result<Self> {
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<Attached<WithConfigs, WithMeteredProvider<DB>>> {
///
/// This spawns a metrics task that listens for metrics related events and updates metrics for
/// prometheus.
pub fn with_metrics_task(
self,
) -> LaunchContextWith<Attached<WithConfigs, WithMeteredProvider<DB>>> {
let (metrics_sender, metrics_receiver) = unbounded_channel();
let with_metrics =

View File

@ -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::<T>()?