From 9e1531635175f136e188a42e88ce350bfe91946b Mon Sep 17 00:00:00 2001 From: terencechain Date: Thu, 2 Feb 2023 07:43:25 -0800 Subject: [PATCH] Enhance block arrival delay metrics by adding a gauge (#11897) * Enhance block arrival delay metrics * Remove histograms * Revert histogram * Rm new line --------- Co-authored-by: Nishant Das --- beacon-chain/sync/metrics.go | 4 ++++ beacon-chain/sync/validate_beacon_blocks.go | 1 + 2 files changed, 5 insertions(+) diff --git a/beacon-chain/sync/metrics.go b/beacon-chain/sync/metrics.go index 0575c12a7..b12331e15 100644 --- a/beacon-chain/sync/metrics.go +++ b/beacon-chain/sync/metrics.go @@ -89,6 +89,10 @@ var ( Buckets: []float64{100, 250, 500, 750, 1000, 1500, 2000, 4000, 8000, 12000, 16000, 20000, 24000}, }, ) + arrivalBlockPropagationGauge = promauto.NewGauge(prometheus.GaugeOpts{ + Name: "block_arrival_latency_milliseconds_gauge", + Help: "Captures blocks propagation time. Blocks arrival in milliseconds", + }) // Attestation processing granular error tracking. attBadBlockCount = promauto.NewCounter(prometheus.CounterOpts{ diff --git a/beacon-chain/sync/validate_beacon_blocks.go b/beacon-chain/sync/validate_beacon_blocks.go index 3b9cf8388..b1e314a97 100644 --- a/beacon-chain/sync/validate_beacon_blocks.go +++ b/beacon-chain/sync/validate_beacon_blocks.go @@ -352,6 +352,7 @@ func captureArrivalTimeMetric(genesisTime uint64, currentSlot primitives.Slot) e } ms := prysmTime.Now().Sub(startTime) / time.Millisecond arrivalBlockPropagationHistogram.Observe(float64(ms)) + arrivalBlockPropagationGauge.Set(float64(ms)) return nil }