diff --git a/Cargo.lock b/Cargo.lock index 76433e18e6..ba207d60a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5082,7 +5082,6 @@ dependencies = [ "kona-genesis", "kona-protocol", "kona-registry", - "metrics", "notify", "op-alloy-network", "op-alloy-rpc-types-engine", diff --git a/bin/node/Cargo.toml b/bin/node/Cargo.toml index 595ea54c31..496290040b 100644 --- a/bin/node/Cargo.toml +++ b/bin/node/Cargo.toml @@ -27,7 +27,7 @@ kona-disc = { workspace = true, features = ["metrics"] } kona-derive = { workspace = true, features = ["metrics"] } kona-engine = { workspace = true, features = ["metrics"] } kona-registry = { workspace = true, features = ["tabled"] } -kona-sources = { workspace = true, features = ["metrics"] } +kona-sources = { workspace = true } kona-node-service = { workspace = true, features = ["metrics"] } kona-providers-alloy = { workspace = true, features = ["metrics"] } diff --git a/crates/node/engine/Cargo.toml b/crates/node/engine/Cargo.toml index 3c2fe8eb91..66ec2bd4bb 100644 --- a/crates/node/engine/Cargo.toml +++ b/crates/node/engine/Cargo.toml @@ -63,4 +63,4 @@ metrics-exporter-prometheus.workspace = true rstest.workspace = true [features] -metrics = [ "dep:metrics", "kona-sources/metrics" ] +metrics = [ "dep:metrics" ] diff --git a/crates/node/service/Cargo.toml b/crates/node/service/Cargo.toml index 0e4be6c506..b20dbfeb48 100644 --- a/crates/node/service/Cargo.toml +++ b/crates/node/service/Cargo.toml @@ -88,6 +88,5 @@ metrics = [ "kona-gossip/metrics", "kona-providers-alloy/metrics", "kona-rpc/metrics", - "kona-sources/metrics", "libp2p/metrics", ] diff --git a/crates/node/sources/Cargo.toml b/crates/node/sources/Cargo.toml index f2207aa18a..ee1336e471 100644 --- a/crates/node/sources/Cargo.toml +++ b/crates/node/sources/Cargo.toml @@ -49,12 +49,8 @@ rustls-pemfile = { workspace = true, features = ["std"] } tokio = { workspace = true, features = ["full"] } notify.workspace = true -# `metrics` feature -metrics = { workspace = true, optional = true } - [features] default = [] -metrics = [ "dep:metrics" ] [dev-dependencies] tokio.workspace = true diff --git a/crates/node/sources/src/lib.rs b/crates/node/sources/src/lib.rs index f58ed7bcd0..5876f0d52e 100644 --- a/crates/node/sources/src/lib.rs +++ b/crates/node/sources/src/lib.rs @@ -7,15 +7,9 @@ #![cfg_attr(not(test), warn(unused_crate_dependencies))] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -#[macro_use] -extern crate tracing; - mod sync; pub use sync::{L2ForkchoiceState, SyncStartError, find_starting_forkchoice}; -mod metrics; -pub use metrics::Metrics; - mod signer; pub use signer::{ BlockSigner, BlockSignerError, BlockSignerHandler, BlockSignerStartError, CertificateError, diff --git a/crates/node/sources/src/metrics.rs b/crates/node/sources/src/metrics.rs deleted file mode 100644 index ef726afe48..0000000000 --- a/crates/node/sources/src/metrics.rs +++ /dev/null @@ -1,26 +0,0 @@ -//! Metrics for the sources. - -/// Container for metrics. -#[derive(Debug, Clone)] -pub struct Metrics; - -impl Metrics { - /// Identifier for the gauge that tracks runtime loader values. - pub const RUNTIME_LOADER: &str = "kona_node_runtime_loader"; - - /// Initializes metrics for the sources crate. - /// - /// This does two things: - /// * Describes various metrics. - /// * Initializes metrics to 0 so they can be queried immediately. - #[cfg(feature = "metrics")] - pub fn init() { - Self::describe(); - } - - /// Describes metrics used in [`kona_sources`][crate]. - #[cfg(feature = "metrics")] - pub fn describe() { - metrics::describe_gauge!(Self::RUNTIME_LOADER, "Runtime configuration metadata"); - } -} diff --git a/crates/node/sources/src/sync/mod.rs b/crates/node/sources/src/sync/mod.rs index ea45918dcc..d5288faa0d 100644 --- a/crates/node/sources/src/sync/mod.rs +++ b/crates/node/sources/src/sync/mod.rs @@ -10,6 +10,7 @@ pub use forkchoice::L2ForkchoiceState; mod error; pub use error::SyncStartError; use op_alloy_network::Optimism; +use tracing::info; /// Searches for the latest [`L2ForkchoiceState`] that we can use to start the sync process with. ///