From 89e806bc198d01c6fa7ac4e2803fbace151bbdda Mon Sep 17 00:00:00 2001 From: Benno Zeeman Date: Thu, 30 May 2024 10:44:28 +0200 Subject: [PATCH] fix(networking): upnp feature gates for metrics --- sn_networking/src/metrics/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sn_networking/src/metrics/mod.rs b/sn_networking/src/metrics/mod.rs index dce5b14bb5..8603218202 100644 --- a/sn_networking/src/metrics/mod.rs +++ b/sn_networking/src/metrics/mod.rs @@ -8,14 +8,14 @@ use crate::target_arch::sleep; use libp2p::metrics::{Metrics as Libp2pMetrics, Recorder}; -use prometheus_client::{ - metrics::{counter::Counter, family::Family, gauge::Gauge}, - registry::Registry, -}; +#[cfg(feature = "upnp")] +use prometheus_client::metrics::{counter::Counter, family::Family}; +use prometheus_client::{metrics::gauge::Gauge, registry::Registry}; use sysinfo::{Pid, ProcessRefreshKind, System}; use tokio::time::Duration; // Implementation to record `libp2p::upnp::Event` metrics +#[cfg(feature = "upnp")] mod upnp; const UPDATE_INTERVAL: Duration = Duration::from_secs(15);