Skip to content

Commit 87ae301

Browse files
Remove unused logging metrics (#7997)
@chong-he noticed that the INFO/WARN/ERRO log counts on our dashboards had stopped working. Since switching to `tracing` we are now tracking total events _per crate_, and the global counters are unused. Per-crate metrics are here: https://github.com/sigp/lighthouse/blob/cfb1f7331064b758c6786e4e1dc15507af5ff5d1/common/logging/src/tracing_metrics_layer.rs#L61-L63 Delete the unused global counters from the source. We can sum across the per-crate metric in our dashboards to restore the previous functionality. Co-Authored-By: Michael Sproul <[email protected]>
1 parent 5815681 commit 87ae301

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

common/logging/src/lib.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use metrics::{IntCounter, Result as MetricsResult, try_create_int_counter};
2-
use std::sync::LazyLock;
31
use std::time::{Duration, Instant};
42
use tracing_subscriber::EnvFilter;
53

@@ -23,15 +21,6 @@ pub use utils::build_workspace_filter;
2321
/// The minimum interval between log messages indicating that a queue is full.
2422
const LOG_DEBOUNCE_INTERVAL: Duration = Duration::from_secs(30);
2523

26-
pub static INFOS_TOTAL: LazyLock<MetricsResult<IntCounter>> =
27-
LazyLock::new(|| try_create_int_counter("info_total", "Count of infos logged"));
28-
pub static WARNS_TOTAL: LazyLock<MetricsResult<IntCounter>> =
29-
LazyLock::new(|| try_create_int_counter("warn_total", "Count of warns logged"));
30-
pub static ERRORS_TOTAL: LazyLock<MetricsResult<IntCounter>> =
31-
LazyLock::new(|| try_create_int_counter("error_total", "Count of errors logged"));
32-
pub static CRITS_TOTAL: LazyLock<MetricsResult<IntCounter>> =
33-
LazyLock::new(|| try_create_int_counter("crit_total", "Count of crits logged"));
34-
3524
/// Provides de-bounce functionality for logging.
3625
#[derive(Default)]
3726
pub struct TimeLatch(Option<Instant>);

0 commit comments

Comments
 (0)