From 253cca2b9e4b7912f32d66a5d285593a97c82be3 Mon Sep 17 00:00:00 2001 From: Marcin S Date: Tue, 27 Dec 2022 13:52:42 -0500 Subject: [PATCH] Use `polkadot-node-metrics` where possible See https://github.com/paritytech/polkadot/issues/6015. (Doesn't close yet, there might be more we can do.) --- Cargo.lock | 7 +++++-- node/core/candidate-validation/Cargo.toml | 5 +++-- node/core/candidate-validation/src/metrics.rs | 2 +- node/core/chain-api/Cargo.toml | 2 +- node/core/chain-api/src/metrics.rs | 2 +- node/core/runtime-api/Cargo.toml | 2 +- node/core/runtime-api/src/metrics.rs | 2 +- node/network/approval-distribution/Cargo.toml | 4 ++-- node/network/approval-distribution/src/metrics.rs | 2 +- node/network/bridge/Cargo.toml | 5 +++-- node/network/bridge/src/metrics.rs | 2 +- 11 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b27ac8837cbc..6fd266c59cfd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5856,6 +5856,7 @@ dependencies = [ "env_logger 0.9.0", "futures", "log", + "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -6151,6 +6152,7 @@ dependencies = [ "futures-timer", "parity-scale-codec", "parking_lot 0.12.1", + "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -6305,6 +6307,7 @@ dependencies = [ "futures-timer", "parity-scale-codec", "polkadot-node-core-pvf", + "polkadot-node-metrics", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -6325,10 +6328,10 @@ dependencies = [ "futures", "maplit", "parity-scale-codec", + "polkadot-node-metrics", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", - "polkadot-node-subsystem-util", "polkadot-primitives", "sc-client-api", "sc-consensus-babe", @@ -6486,11 +6489,11 @@ version = "0.9.33" dependencies = [ "futures", "lru", + "polkadot-node-metrics", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", "polkadot-node-subsystem-types", - "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-primitives-test-helpers", "sp-api", diff --git a/node/core/candidate-validation/Cargo.toml b/node/core/candidate-validation/Cargo.toml index 56fa0e08115d..28731e1f25b8 100644 --- a/node/core/candidate-validation/Cargo.toml +++ b/node/core/candidate-validation/Cargo.toml @@ -16,8 +16,8 @@ parity-scale-codec = { version = "3.1.5", default-features = false, features = [ polkadot-primitives = { path = "../../../primitives" } polkadot-parachain = { path = "../../../parachain" } polkadot-node-primitives = { path = "../../primitives" } -polkadot-node-subsystem = {path = "../../subsystem" } -polkadot-node-subsystem-util = { path = "../../subsystem-util" } +polkadot-node-subsystem = { path = "../../subsystem" } +polkadot-node-metrics = { path = "../../metrics" } [target.'cfg(not(any(target_os = "android", target_os = "unknown")))'.dependencies] polkadot-node-core-pvf = { path = "../pvf" } @@ -27,5 +27,6 @@ sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master futures = { version = "0.3.21", features = ["thread-pool"] } assert_matches = "1.4.0" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } +polkadot-node-subsystem-util = { path = "../../subsystem-util" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../../primitives/test-helpers" } diff --git a/node/core/candidate-validation/src/metrics.rs b/node/core/candidate-validation/src/metrics.rs index 64112c6a387b..344d95029256 100644 --- a/node/core/candidate-validation/src/metrics.rs +++ b/node/core/candidate-validation/src/metrics.rs @@ -15,7 +15,7 @@ // along with Polkadot. If not, see . use super::{ValidationFailed, ValidationResult}; -use polkadot_node_subsystem_util::metrics::{self, prometheus}; +use polkadot_node_metrics::metrics::{self, prometheus}; #[derive(Clone)] pub(crate) struct MetricsInner { diff --git a/node/core/chain-api/Cargo.toml b/node/core/chain-api/Cargo.toml index 571b840120f7..ec4d0bc9a3d6 100644 --- a/node/core/chain-api/Cargo.toml +++ b/node/core/chain-api/Cargo.toml @@ -9,8 +9,8 @@ futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-primitives = { path = "../../../primitives" } +polkadot-node-metrics = { path = "../../metrics" } polkadot-node-subsystem = {path = "../../subsystem" } -polkadot-node-subsystem-util = { path = "../../subsystem-util" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/chain-api/src/metrics.rs b/node/core/chain-api/src/metrics.rs index 23f455729e16..34c258b84563 100644 --- a/node/core/chain-api/src/metrics.rs +++ b/node/core/chain-api/src/metrics.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use polkadot_node_subsystem_util::metrics::{self, prometheus}; +use polkadot_node_metrics::metrics::{self, prometheus}; #[derive(Clone)] pub(crate) struct MetricsInner { diff --git a/node/core/runtime-api/Cargo.toml b/node/core/runtime-api/Cargo.toml index b342e8aad980..7d8ed54e812b 100644 --- a/node/core/runtime-api/Cargo.toml +++ b/node/core/runtime-api/Cargo.toml @@ -12,9 +12,9 @@ lru = "0.8" sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-primitives = { path = "../../../primitives" } +polkadot-node-metrics = { path = "../../metrics" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-types = { path = "../../subsystem-types" } -polkadot-node-subsystem-util = { path = "../../subsystem-util" } [dev-dependencies] sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/runtime-api/src/metrics.rs b/node/core/runtime-api/src/metrics.rs index c6affaf38914..d9459d1ad57b 100644 --- a/node/core/runtime-api/src/metrics.rs +++ b/node/core/runtime-api/src/metrics.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use polkadot_node_subsystem_util::metrics::{self, prometheus}; +use polkadot_node_metrics::metrics::{self, prometheus}; #[derive(Clone)] pub(crate) struct MetricsInner { diff --git a/node/network/approval-distribution/Cargo.toml b/node/network/approval-distribution/Cargo.toml index 4138446b1851..6df854072aa6 100644 --- a/node/network/approval-distribution/Cargo.toml +++ b/node/network/approval-distribution/Cargo.toml @@ -5,10 +5,10 @@ authors.workspace = true edition.workspace = true [dependencies] -polkadot-node-primitives = { path = "../../primitives" } +polkadot-node-metrics = { path = "../../metrics" } polkadot-node-network-protocol = { path = "../protocol" } +polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } -polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-primitives = { path = "../../../primitives" } rand = "0.8" diff --git a/node/network/approval-distribution/src/metrics.rs b/node/network/approval-distribution/src/metrics.rs index b14e54c57403..47bae7065a05 100644 --- a/node/network/approval-distribution/src/metrics.rs +++ b/node/network/approval-distribution/src/metrics.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use polkadot_node_subsystem_util::metrics::{prometheus, Metrics as MetricsTrait}; +use polkadot_node_metrics::metrics::{prometheus, Metrics as MetricsTrait}; /// Approval Distribution metrics. #[derive(Default, Clone)] diff --git a/node/network/bridge/Cargo.toml b/node/network/bridge/Cargo.toml index 56208ba6a3a3..2d68cdb4d808 100644 --- a/node/network/bridge/Cargo.toml +++ b/node/network/bridge/Cargo.toml @@ -14,10 +14,10 @@ parity-scale-codec = { version = "3.1.5", default-features = false, features = [ sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } +polkadot-node-metrics = { path = "../../metrics"} +polkadot-node-network-protocol = { path = "../protocol" } polkadot-node-subsystem = {path = "../../subsystem" } polkadot-overseer = { path = "../../overseer" } -polkadot-node-network-protocol = { path = "../protocol" } -polkadot-node-subsystem-util = { path = "../../subsystem-util"} parking_lot = "0.12.0" bytes = "1" fatality = "0.0.6" @@ -26,6 +26,7 @@ thiserror = "1" [dev-dependencies] assert_matches = "1.4.0" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } +polkadot-node-subsystem-util = { path = "../../subsystem-util"} sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } futures-timer = "3" diff --git a/node/network/bridge/src/metrics.rs b/node/network/bridge/src/metrics.rs index 52b3629a66ad..5ca392ee33f8 100644 --- a/node/network/bridge/src/metrics.rs +++ b/node/network/bridge/src/metrics.rs @@ -15,7 +15,7 @@ // along with Polkadot. If not, see . use super::{PeerSet, ProtocolVersion}; -use polkadot_node_subsystem_util::metrics::{self, prometheus}; +use polkadot_node_metrics::metrics::{self, prometheus}; /// Metrics for the network bridge. #[derive(Clone, Default)]