Skip to content

Commit 75c2dee

Browse files
committed
Make end-to-end latency a summary again
It was changed to a histogram due to performance considerations (calculating a summary can be expensive). However, summaries are just so much nicer. If the prformance becomes a problem, I'd rather do sampling instead (only observe the latency for every Nth message)
1 parent 22d6226 commit 75c2dee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/metrics/metrics.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var (
3232
MessagesConsumed *prometheus.CounterVec
3333
MessagesConsumedOutOfOrder *prometheus.CounterVec
3434
PublishingLatency *prometheus.SummaryVec
35-
EndToEndLatency *prometheus.HistogramVec
35+
EndToEndLatency *prometheus.SummaryVec
3636
)
3737

3838
func RegisterMetrics(globalLabels prometheus.Labels) {
@@ -66,10 +66,10 @@ func RegisterMetrics(globalLabels prometheus.Labels) {
6666
}, []string{"protocol"})
6767
}
6868
if EndToEndLatency == nil {
69-
EndToEndLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{
69+
EndToEndLatency = promauto.NewSummaryVec(prometheus.SummaryOpts{
7070
Name: "omq_end_to_end_latency_seconds",
7171
Help: "Time from sending a message to receiving the message",
72-
Buckets: []float64{.001, .002, .003, .004, .005, .006, .007, 0.008, .009, 0.01, 0.025, 0.05, 0.1, 0.5, 1, 2, 3, 4, 5, 10, 20, 30, 60},
72+
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.95: 0.005, 0.99: 0.001},
7373
ConstLabels: globalLabels,
7474
}, []string{"protocol"})
7575
}

0 commit comments

Comments
 (0)