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 <nishdas93@gmail.com>
This commit is contained in:
terencechain 2023-02-02 07:43:25 -08:00 committed by GitHub
parent 0d01debe9a
commit 9e15316351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -89,6 +89,10 @@ var (
Buckets: []float64{100, 250, 500, 750, 1000, 1500, 2000, 4000, 8000, 12000, 16000, 20000, 24000}, 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. // Attestation processing granular error tracking.
attBadBlockCount = promauto.NewCounter(prometheus.CounterOpts{ attBadBlockCount = promauto.NewCounter(prometheus.CounterOpts{

View File

@ -352,6 +352,7 @@ func captureArrivalTimeMetric(genesisTime uint64, currentSlot primitives.Slot) e
} }
ms := prysmTime.Now().Sub(startTime) / time.Millisecond ms := prysmTime.Now().Sub(startTime) / time.Millisecond
arrivalBlockPropagationHistogram.Observe(float64(ms)) arrivalBlockPropagationHistogram.Observe(float64(ms))
arrivalBlockPropagationGauge.Set(float64(ms))
return nil return nil
} }