From 5201fc6c34422327fddab62fb84d3d45eb8eeba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jev=20Bj=C3=B6rsell?= Date: Mon, 15 Apr 2024 14:39:55 -0700 Subject: [PATCH 1/2] fix: Inaccurate Bucket Intervals for block_interval_seconds Metric --- consensus/metrics.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/consensus/metrics.go b/consensus/metrics.go index cafa2ab6bc..835cd9137f 100644 --- a/consensus/metrics.go +++ b/consensus/metrics.go @@ -183,7 +183,8 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { Namespace: namespace, Subsystem: MetricsSubsystem, Name: "block_interval_seconds", - Help: "Time between this and the last block.", + Buckets: []float64{10, 11, 12, 13, 14, 15, 20, 25, 30, 40, 50, 60}, + Help: "Histogram of time intervals in seconds between consecutive blocks, capturing the distribution of block times as observed by this node.", }, labels).With(labelsAndValues...), NumTxs: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ Namespace: namespace, From fa79396b080b759a3084c2a3e8c180fcfcf1b4c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jev=20Bj=C3=B6rsell?= Date: Wed, 17 Apr 2024 08:19:33 -0700 Subject: [PATCH 2/2] Update consensus/metrics.go Adjust buckets as per @cmwaters suggestion. Co-authored-by: Callum Waters --- consensus/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/metrics.go b/consensus/metrics.go index 835cd9137f..0ef29778c2 100644 --- a/consensus/metrics.go +++ b/consensus/metrics.go @@ -183,7 +183,7 @@ func PrometheusMetrics(namespace string, labelsAndValues ...string) *Metrics { Namespace: namespace, Subsystem: MetricsSubsystem, Name: "block_interval_seconds", - Buckets: []float64{10, 11, 12, 13, 14, 15, 20, 25, 30, 40, 50, 60}, + Buckets: []float64{10, 11, 12, 13, 14, 15, 20, 30, 60}, Help: "Histogram of time intervals in seconds between consecutive blocks, capturing the distribution of block times as observed by this node.", }, labels).With(labelsAndValues...), NumTxs: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{