Add metrics for the postprocessing duration

This commit is contained in:
André Duffeck
2025-07-10 13:55:38 +02:00
parent 791b4df173
commit 4704cedd3b
3 changed files with 22 additions and 5 deletions

View File

@@ -22,6 +22,7 @@ type Metrics struct {
EventsRedelivered prometheus.Gauge
InProgress prometheus.Gauge
Finished *prometheus.CounterVec
Duration *prometheus.HistogramVec
}
// New initializes the available metrics.
@@ -63,6 +64,13 @@ func New() *Metrics {
Name: "finished",
Help: "Number of finished postprocessing events",
}, []string{"status"}),
Duration: promauto.NewHistogramVec(prometheus.HistogramOpts{
Namespace: Namespace,
Subsystem: Subsystem,
Name: "duration_seconds",
Help: "Duration of postprocessing operations in seconds",
Buckets: []float64{0.1, 0.5, 1, 2.5, 5, 10, 30, 60, 120, 300, 600, 1200},
}, []string{"status"}),
}
return m