From 5846339dcf09928e4c345938ebe5154597f885f5 Mon Sep 17 00:00:00 2001 From: Brandon Kite Date: Thu, 20 Apr 2023 09:35:53 -0700 Subject: [PATCH] Capture metrics for graphql api (#1113) closes https://github.com/FuelLabs/fuel-core/issues/1036 based on #1090, but completes the work and squashes into a single commit for easy cherry-picking pulls in all changes from https://github.com/FuelLabs/fuel-core/pull/1114 --- Cargo.lock | 79 +++++++++++------ Cargo.toml | 49 +++++------ bin/e2e-test-client/Cargo.toml | 2 +- crates/fuel-core/src/graphql_api.rs | 2 + .../fuel-core/src/graphql_api/prometheus.rs | 85 +++++++++++++++++++ crates/fuel-core/src/graphql_api/service.rs | 6 ++ crates/metrics/Cargo.toml | 2 +- crates/metrics/src/core_metrics.rs | 8 +- crates/metrics/src/graphql_metrics.rs | 45 ++++++++++ crates/metrics/src/lib.rs | 1 + crates/metrics/src/p2p_metrics.rs | 5 +- crates/metrics/src/service.rs | 43 ++++++---- crates/metrics/src/txpool_metrics.rs | 9 +- crates/services/p2p/Cargo.toml | 1 + crates/services/p2p/src/gossipsub/config.rs | 3 +- deployment/charts/Chart.yaml | 2 +- tests/tests/metrics.rs | 2 +- 17 files changed, 256 insertions(+), 88 deletions(-) create mode 100644 crates/fuel-core/src/graphql_api/prometheus.rs create mode 100644 crates/metrics/src/graphql_metrics.rs diff --git a/Cargo.lock b/Cargo.lock index f92e27f380e..1c922a4396c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2505,7 +2505,7 @@ dependencies = [ [[package]] name = "fuel-core" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "assert_matches", @@ -2574,7 +2574,7 @@ dependencies = [ [[package]] name = "fuel-core-bft" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "parking_lot 0.12.1", @@ -2583,7 +2583,7 @@ dependencies = [ [[package]] name = "fuel-core-bin" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "clap 4.2.1", @@ -2605,7 +2605,7 @@ dependencies = [ [[package]] name = "fuel-core-chain-config" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "bech32 0.9.1", @@ -2624,7 +2624,7 @@ dependencies = [ [[package]] name = "fuel-core-client" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "cynic", @@ -2647,7 +2647,7 @@ dependencies = [ [[package]] name = "fuel-core-client-bin" -version = "0.17.8" +version = "0.17.9" dependencies = [ "clap 4.2.1", "fuel-core-client", @@ -2658,7 +2658,7 @@ dependencies = [ [[package]] name = "fuel-core-consensus-module" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "fuel-core-chain-config", @@ -2670,7 +2670,7 @@ dependencies = [ [[package]] name = "fuel-core-database" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "fuel-core-storage", @@ -2681,7 +2681,7 @@ dependencies = [ [[package]] name = "fuel-core-e2e-client" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "assert_cmd", @@ -2703,7 +2703,7 @@ dependencies = [ [[package]] name = "fuel-core-executor" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "fuel-core-chain-config", @@ -2714,7 +2714,7 @@ dependencies = [ [[package]] name = "fuel-core-importer" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "fuel-core-storage", @@ -2729,7 +2729,7 @@ dependencies = [ [[package]] name = "fuel-core-keygen" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "clap 4.2.1", @@ -2740,17 +2740,18 @@ dependencies = [ [[package]] name = "fuel-core-metrics" -version = "0.17.8" +version = "0.17.9" dependencies = [ "axum", "lazy_static", "once_cell", - "prometheus-client", + "prometheus-client 0.18.1", + "prometheus-client 0.20.0", ] [[package]] name = "fuel-core-p2p" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "async-trait", @@ -2778,7 +2779,8 @@ dependencies = [ "libp2p-websocket", "libp2p-yamux", "postcard", - "prometheus-client", + "prometheus-client 0.18.1", + "prometheus-client 0.20.0", "rand 0.8.5", "serde", "serde_with", @@ -2791,7 +2793,7 @@ dependencies = [ [[package]] name = "fuel-core-poa" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "async-trait", @@ -2809,7 +2811,7 @@ dependencies = [ [[package]] name = "fuel-core-producer" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "async-trait", @@ -2825,7 +2827,7 @@ dependencies = [ [[package]] name = "fuel-core-relayer" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "async-trait", @@ -2853,7 +2855,7 @@ dependencies = [ [[package]] name = "fuel-core-services" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "async-trait", @@ -2866,7 +2868,7 @@ dependencies = [ [[package]] name = "fuel-core-storage" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "fuel-core-types", @@ -2877,7 +2879,7 @@ dependencies = [ [[package]] name = "fuel-core-sync" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "async-trait", @@ -2920,7 +2922,7 @@ dependencies = [ [[package]] name = "fuel-core-trace" -version = "0.17.8" +version = "0.17.9" dependencies = [ "ctor", "tracing", @@ -2930,7 +2932,7 @@ dependencies = [ [[package]] name = "fuel-core-txpool" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "async-trait", @@ -2952,7 +2954,7 @@ dependencies = [ [[package]] name = "fuel-core-types" -version = "0.17.8" +version = "0.17.9" dependencies = [ "anyhow", "derive_more", @@ -4175,7 +4177,7 @@ dependencies = [ "libp2p-core 0.38.0", "libp2p-swarm", "log", - "prometheus-client", + "prometheus-client 0.18.1", "prost", "prost-build", "prost-codec", @@ -4286,7 +4288,7 @@ dependencies = [ "libp2p-identify", "libp2p-kad", "libp2p-swarm", - "prometheus-client", + "prometheus-client 0.18.1", ] [[package]] @@ -5691,6 +5693,29 @@ dependencies = [ "prometheus-client-derive-text-encode", ] +[[package]] +name = "prometheus-client" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e227aeb6c2cfec819e999c4773b35f8c7fa37298a203ff46420095458eee567e" +dependencies = [ + "dtoa", + "itoa 1.0.6", + "parking_lot 0.12.1", + "prometheus-client-derive-encode", +] + +[[package]] +name = "prometheus-client-derive-encode" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b6a5217beb0ad503ee7fa752d451c905113d70721b937126158f3106a48cc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "prometheus-client-derive-text-encode" version = "0.3.0" diff --git a/Cargo.toml b/Cargo.toml index 21a01434725..0030e1d1292 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,32 +45,32 @@ homepage = "https://fuel.network/" keywords = ["blockchain", "cryptocurrencies", "fuel-vm", "vm"] license = "BUSL-1.1" repository = "https://github.com/FuelLabs/fuel-core" -version = "0.17.8" +version = "0.17.9" [workspace.dependencies] # Workspace members -fuel-core = { version = "0.17.8", path = "./crates/fuel-core", default-features = false } -fuel-core-client-bin = { version = "0.17.8", path = "./bin/client" } -fuel-core-bin = { version = "0.17.8", path = "./bin/fuel-core" } -fuel-core-keygen = { version = "0.17.8", path = "./bin/keygen" } -fuel-core-chain-config = { version = "0.17.8", path = "./crates/chain-config" } -fuel-core-client = { version = "0.17.8", path = "./crates/client" } -fuel-core-database = { version = "0.17.8", path = "./crates/database" } -fuel-core-metrics = { version = "0.17.8", path = "./crates/metrics" } -fuel-core-services = { version = "0.17.8", path = "./crates/services" } -fuel-core-consensus-module = { version = "0.17.8", path = "./crates/services/consensus_module" } -fuel-core-bft = { version = "0.17.8", path = "./crates/services/consensus_module/bft" } -fuel-core-poa = { version = "0.17.8", path = "./crates/services/consensus_module/poa" } -fuel-core-executor = { version = "0.17.8", path = "./crates/services/executor" } -fuel-core-importer = { version = "0.17.8", path = "./crates/services/importer" } -fuel-core-p2p = { version = "0.17.8", path = "./crates/services/p2p" } -fuel-core-producer = { version = "0.17.8", path = "./crates/services/producer" } -fuel-core-relayer = { version = "0.17.8", path = "./crates/services/relayer" } -fuel-core-sync = { version = "0.17.8", path = "./crates/services/sync" } -fuel-core-txpool = { version = "0.17.8", path = "./crates/services/txpool" } -fuel-core-storage = { version = "0.17.8", path = "./crates/storage" } -fuel-core-trace = { version = "0.17.8", path = "./crates/trace" } -fuel-core-types = { version = "0.17.8", path = "./crates/types", default-features = false } +fuel-core = { version = "0.17.9", path = "./crates/fuel-core", default-features = false } +fuel-core-client-bin = { version = "0.17.9", path = "./bin/client" } +fuel-core-bin = { version = "0.17.9", path = "./bin/fuel-core" } +fuel-core-keygen = { version = "0.17.9", path = "./bin/keygen" } +fuel-core-chain-config = { version = "0.17.9", path = "./crates/chain-config" } +fuel-core-client = { version = "0.17.9", path = "./crates/client" } +fuel-core-database = { version = "0.17.9", path = "./crates/database" } +fuel-core-metrics = { version = "0.17.9", path = "./crates/metrics" } +fuel-core-services = { version = "0.17.9", path = "./crates/services" } +fuel-core-consensus-module = { version = "0.17.9", path = "./crates/services/consensus_module" } +fuel-core-bft = { version = "0.17.9", path = "./crates/services/consensus_module/bft" } +fuel-core-poa = { version = "0.17.9", path = "./crates/services/consensus_module/poa" } +fuel-core-executor = { version = "0.17.9", path = "./crates/services/executor" } +fuel-core-importer = { version = "0.17.9", path = "./crates/services/importer" } +fuel-core-p2p = { version = "0.17.9", path = "./crates/services/p2p" } +fuel-core-producer = { version = "0.17.9", path = "./crates/services/producer" } +fuel-core-relayer = { version = "0.17.9", path = "./crates/services/relayer" } +fuel-core-sync = { version = "0.17.9", path = "./crates/services/sync" } +fuel-core-txpool = { version = "0.17.9", path = "./crates/services/txpool" } +fuel-core-storage = { version = "0.17.9", path = "./crates/storage" } +fuel-core-trace = { version = "0.17.9", path = "./crates/trace" } +fuel-core-types = { version = "0.17.9", path = "./crates/types", default-features = false } fuel-core-tests = { version = "0.0.0", path = "./tests" } fuel-core-xtask = { version = "0.0.0", path = "./xtask" } @@ -99,8 +99,9 @@ mockall = "0.11" test-case = "2.2" axum = "0.5" lazy_static = "1.4" +libp2p-prom-client = { package = "prometheus-client", version = "0.18" } once_cell = "1.16" -prometheus-client = "0.18" +prometheus-client = "0.20" itertools = "0.10" insta = "1.8" tempfile = "3.4" diff --git a/bin/e2e-test-client/Cargo.toml b/bin/e2e-test-client/Cargo.toml index 898eb052830..b71b844f21c 100644 --- a/bin/e2e-test-client/Cargo.toml +++ b/bin/e2e-test-client/Cargo.toml @@ -33,6 +33,6 @@ insta = { workspace = true } tempfile = { workspace = true } [features] -default = ["fuel-core?/default"] +default = ["fuel-core?/default", "fuel-core?/metrics"] p2p = ["fuel-core?/p2p"] dev-deps = ["fuel-core/test-helpers"] diff --git a/crates/fuel-core/src/graphql_api.rs b/crates/fuel-core/src/graphql_api.rs index 4d7e8d9d848..da25221728a 100644 --- a/crates/fuel-core/src/graphql_api.rs +++ b/crates/fuel-core/src/graphql_api.rs @@ -11,6 +11,8 @@ use std::net::SocketAddr; mod honeycomb; pub mod ports; +#[cfg(feature = "metrics")] +pub(crate) mod prometheus; pub mod service; #[derive(Clone, Debug)] diff --git a/crates/fuel-core/src/graphql_api/prometheus.rs b/crates/fuel-core/src/graphql_api/prometheus.rs new file mode 100644 index 00000000000..78e1fd6e485 --- /dev/null +++ b/crates/fuel-core/src/graphql_api/prometheus.rs @@ -0,0 +1,85 @@ +use async_graphql::{ + extensions::{ + Extension, + ExtensionContext, + ExtensionFactory, + NextParseQuery, + NextRequest, + }, + parser::types::{ + ExecutableDocument, + OperationType, + Selection, + }, + Response, + ServerResult, + Variables, +}; +use fuel_core_metrics::graphql_metrics::GRAPHQL_METRICS; +use std::{ + sync::Arc, + time::Instant, +}; +use tokio::sync::RwLock; + +pub(crate) struct PrometheusExtension {} + +impl ExtensionFactory for PrometheusExtension { + fn create(&self) -> Arc { + Arc::new(PrometheusExtInner { + operation_name: RwLock::new(None), + }) + } +} + +pub(crate) struct PrometheusExtInner { + operation_name: RwLock>, +} + +#[async_trait::async_trait] +impl Extension for PrometheusExtInner { + async fn request( + &self, + ctx: &ExtensionContext<'_>, + next: NextRequest<'_>, + ) -> Response { + let start_time = Instant::now(); + let result = next.run(ctx).await; + + let op_name = self.operation_name.read().await; + if let Some(op) = &*op_name { + GRAPHQL_METRICS.graphql_observe(op, start_time.elapsed().as_secs_f64()); + } + + result + } + + async fn parse_query( + &self, + ctx: &ExtensionContext<'_>, + query: &str, + variables: &Variables, + next: NextParseQuery<'_>, + ) -> ServerResult { + let document = next.run(ctx, query, variables).await?; + let is_schema = document + .operations + .iter() + .filter(|(_, operation)| operation.node.ty == OperationType::Query) + .any(|(_, operation)| operation.node.selection_set.node.items.iter().any(|selection| matches!(&selection.node, Selection::Field(field) if field.node.name.node == "__schema"))); + if !is_schema { + if let Some((_, def)) = document.operations.iter().next() { + if let Some(Selection::Field(e)) = + &def.node.selection_set.node.items.get(0).map(|n| &n.node) + { + // only track query if there's a single selection set + if def.node.selection_set.node.items.len() == 1 { + *self.operation_name.write().await = + Some(e.node.name.node.to_string()); + } + } + } + } + Ok(document) + } +} diff --git a/crates/fuel-core/src/graphql_api/service.rs b/crates/fuel-core/src/graphql_api/service.rs index f343ad4eb75..ad3eb2e9b46 100644 --- a/crates/fuel-core/src/graphql_api/service.rs +++ b/crates/fuel-core/src/graphql_api/service.rs @@ -1,3 +1,5 @@ +#[cfg(feature = "metrics")] +use crate::graphql_api::prometheus::PrometheusExtension; use crate::{ fuel_core_graphql_api::ports::{ BlockProducerPort, @@ -170,6 +172,10 @@ pub fn new_service( } else { builder.extension(Tracing) }; + + #[cfg(feature = "metrics")] + let builder = builder.extension(PrometheusExtension {}); + let schema = builder.finish(); let router = Router::new() diff --git a/crates/metrics/Cargo.toml b/crates/metrics/Cargo.toml index ba0a9480c09..c5bbc2d5d53 100644 --- a/crates/metrics/Cargo.toml +++ b/crates/metrics/Cargo.toml @@ -13,6 +13,6 @@ description = "Fuel metrics" [dependencies] axum = { workspace = true } lazy_static = { workspace = true } +libp2p-prom-client = { workspace = true } once_cell = { workspace = true } prometheus-client = { workspace = true } - diff --git a/crates/metrics/src/core_metrics.rs b/crates/metrics/src/core_metrics.rs index f26e9b38c42..0b037f3cb89 100644 --- a/crates/metrics/src/core_metrics.rs +++ b/crates/metrics/src/core_metrics.rs @@ -43,22 +43,22 @@ pub fn init(mut metrics: DatabaseMetrics) -> DatabaseMetrics { metrics.registry.register( "Database_Writes", "Number of database write operations", - Box::new(metrics.write_meter.clone()), + metrics.write_meter.clone(), ); metrics.registry.register( "Database_Reads", "Number of database read operations", - Box::new(metrics.read_meter.clone()), + metrics.read_meter.clone(), ); metrics.registry.register( "Bytes_Read", "Histogram containing values of amount of bytes read per operation", - Box::new(metrics.bytes_read.clone()), + metrics.bytes_read.clone(), ); metrics.registry.register( "Bytes_Written", "Histogram containing values of amount of bytes written per operation", - Box::new(metrics.bytes_written.clone()), + metrics.bytes_written.clone(), ); metrics diff --git a/crates/metrics/src/graphql_metrics.rs b/crates/metrics/src/graphql_metrics.rs new file mode 100644 index 00000000000..0a2d6641db9 --- /dev/null +++ b/crates/metrics/src/graphql_metrics.rs @@ -0,0 +1,45 @@ +use lazy_static::lazy_static; +use prometheus_client::{ + encoding::EncodeLabelSet, + metrics::{ + family::Family, + histogram::Histogram, + }, + registry::Registry, +}; + +#[derive(Clone, Debug, Hash, PartialEq, Eq, EncodeLabelSet)] +pub struct Label { + // the graphql path + path: String, +} + +pub struct GraphqlMetrics { + pub registry: Registry, + requests: Family, +} + +impl GraphqlMetrics { + fn new() -> Self { + let mut registry = Registry::default(); + let requests = Family::::new_with_constructor(|| { + Histogram::new(BUCKETS.iter().cloned()) + }); + registry.register("graphql_request_duration_seconds", "", requests.clone()); + Self { registry, requests } + } + + pub fn graphql_observe(&self, query: &str, time: f64) { + let histogram = self.requests.get_or_create(&Label { + path: query.to_string(), + }); + histogram.observe(time); + } +} + +lazy_static! { + pub static ref GRAPHQL_METRICS: GraphqlMetrics = GraphqlMetrics::new(); + // recommended bucket defaults for API response times + static ref BUCKETS: Vec = + vec![0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0]; +} diff --git a/crates/metrics/src/lib.rs b/crates/metrics/src/lib.rs index 82a2af36186..186106f320a 100644 --- a/crates/metrics/src/lib.rs +++ b/crates/metrics/src/lib.rs @@ -1,6 +1,7 @@ #![deny(unused_crate_dependencies)] pub mod core_metrics; +pub mod graphql_metrics; pub mod p2p_metrics; pub mod service; pub mod txpool_metrics; diff --git a/crates/metrics/src/p2p_metrics.rs b/crates/metrics/src/p2p_metrics.rs index 7a2bd18baca..b93375073ff 100644 --- a/crates/metrics/src/p2p_metrics.rs +++ b/crates/metrics/src/p2p_metrics.rs @@ -1,10 +1,9 @@ use lazy_static::lazy_static; -use once_cell::race::OnceBox; -use prometheus_client::{ +use libp2p_prom_client::{ metrics::counter::Counter, registry::Registry, }; -use std::boxed::Box; +use once_cell::race::OnceBox; pub struct P2PMetrics { pub gossip_sub_registry: OnceBox, diff --git a/crates/metrics/src/service.rs b/crates/metrics/src/service.rs index ddc322156e2..57fa456818b 100644 --- a/crates/metrics/src/service.rs +++ b/crates/metrics/src/service.rs @@ -1,4 +1,5 @@ use crate::{ + graphql_metrics::GRAPHQL_METRICS, p2p_metrics::P2P_METRICS, txpool_metrics::TXPOOL_METRICS, }; @@ -9,31 +10,30 @@ use axum::{ Response, }, }; +use libp2p_prom_client::encoding::text::encode as libp2p_encode; use prometheus_client::encoding::text::encode; -use std::vec; pub fn encode_metrics_response() -> impl IntoResponse { - let mut encoded = vec![]; - - if let Option::Some(value) = P2P_METRICS.gossip_sub_registry.get() { - if encode(&mut encoded, value).is_err() { - return Response::builder() - .status(503) - .body(Body::from("")) - .unwrap() + // encode libp2p metrics using older prometheus + let mut libp2p_bytes = Vec::::new(); + if let Some(value) = P2P_METRICS.gossip_sub_registry.get() { + if libp2p_encode(&mut libp2p_bytes, value).is_err() { + return error_body() } } - if encode(&mut encoded, &P2P_METRICS.peer_metrics).is_err() { - return Response::builder() - .status(503) - .body(Body::from("")) - .unwrap() + if libp2p_encode(&mut libp2p_bytes, &P2P_METRICS.peer_metrics).is_err() { + return error_body() } + + let mut encoded = String::from_utf8_lossy(&libp2p_bytes).into_owned(); + + // encode the rest of the fuel-core metrics using latest prometheus if encode(&mut encoded, &TXPOOL_METRICS.registry).is_err() { - return Response::builder() - .status(503) - .body(Body::from("")) - .unwrap() + return error_body() + } + + if encode(&mut encoded, &GRAPHQL_METRICS.registry).is_err() { + return error_body() } Response::builder() @@ -41,3 +41,10 @@ pub fn encode_metrics_response() -> impl IntoResponse { .body(Body::from(encoded)) .unwrap() } + +fn error_body() -> Response { + Response::builder() + .status(503) + .body(Body::from("")) + .unwrap() +} diff --git a/crates/metrics/src/txpool_metrics.rs b/crates/metrics/src/txpool_metrics.rs index dea926f5384..b06ebd2dd38 100644 --- a/crates/metrics/src/txpool_metrics.rs +++ b/crates/metrics/src/txpool_metrics.rs @@ -3,10 +3,7 @@ use prometheus_client::{ metrics::histogram::Histogram, registry::Registry, }; -use std::{ - boxed::Box, - default::Default, -}; +use std::default::Default; pub struct TxPoolMetrics { // Attaches each Metric to the Registry @@ -36,13 +33,13 @@ impl Default for TxPoolMetrics { metrics.registry.register( "Tx_Gas_Price_Histogram", "A Histogram keeping track of all gas prices for each tx in the mempool", - Box::new(metrics.gas_price_histogram.clone()), + metrics.gas_price_histogram.clone(), ); metrics.registry.register( "Tx_Size_Histogram", "A Histogram keeping track of the size of txs", - Box::new(metrics.tx_size_histogram.clone()), + metrics.tx_size_histogram.clone(), ); metrics diff --git a/crates/services/p2p/Cargo.toml b/crates/services/p2p/Cargo.toml index e41f7afd601..54a015f2158 100644 --- a/crates/services/p2p/Cargo.toml +++ b/crates/services/p2p/Cargo.toml @@ -46,6 +46,7 @@ libp2p-kad = "=0.42.0" libp2p-mdns = "=0.42.0" libp2p-mplex = "=0.38.0" libp2p-noise = "=0.41.0" +libp2p-prom-client = { workspace = true } libp2p-request-response = "=0.23.0" libp2p-swarm = "=0.41.1" libp2p-tcp = "=0.38.0" diff --git a/crates/services/p2p/src/gossipsub/config.rs b/crates/services/p2p/src/gossipsub/config.rs index 77f0403e1f6..5f90c73a2dd 100644 --- a/crates/services/p2p/src/gossipsub/config.rs +++ b/crates/services/p2p/src/gossipsub/config.rs @@ -18,8 +18,7 @@ use libp2p::gossipsub::{ Topic, TopicScoreParams, }; - -use prometheus_client::registry::Registry; +use libp2p_prom_client::registry::Registry; use sha2::{ Digest, Sha256, diff --git a/deployment/charts/Chart.yaml b/deployment/charts/Chart.yaml index 2fdc7040885..44e6a030ed1 100644 --- a/deployment/charts/Chart.yaml +++ b/deployment/charts/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: ${fuel_core_service_name} description: ${fuel_core_service_name} Helm Chart type: application -appVersion: "0.17.8" +appVersion: "0.17.9" version: 0.1.0 diff --git a/tests/tests/metrics.rs b/tests/tests/metrics.rs index b45df5d969d..504bafcecdf 100644 --- a/tests/tests/metrics.rs +++ b/tests/tests/metrics.rs @@ -72,7 +72,7 @@ async fn test_metrics_endpoint() { srv.stop_and_await().await.unwrap(); // Gt check exists because testing can be weird with multiple instances running - assert_eq!(categories.len(), 16); + assert!(categories.len() >= 16); for index in [2, 6, 7, 8, 11, 12, 13] { let value = categories[index].split(' ').collect::>()[1]