mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: clarify metrics and prometheus (#9603)
This commit is contained in:
@ -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>()?
|
||||
|
||||
@ -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 =
|
||||
|
||||
@ -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>()?
|
||||
|
||||
Reference in New Issue
Block a user