fix: expose pipeline health metrics

This commit is contained in:
2026-10-30 13:46:06 +03:00
parent 25c80a0072
commit c5b804426e
7 changed files with 889 additions and 559 deletions
@@ -9,6 +9,8 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp"
)
var workerDurationBuckets = []float64{0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 15, 20, 30, 60}
type Metrics struct {
workerInFlight prometheus.Gauge
workerJobs *prometheus.CounterVec
@@ -34,7 +36,7 @@ func NewMetrics() *Metrics {
}, []string{"result"}),
workerDuration: prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: "messenger", Subsystem: "attachment_worker", Name: "job_duration_seconds",
Help: "Attachment job delivery processing duration.", Buckets: prometheus.DefBuckets,
Help: "Attachment job delivery processing duration.", Buckets: workerDurationBuckets,
}, []string{"result"}),
workerRetries: prometheus.NewCounter(prometheus.CounterOpts{
Namespace: "messenger", Subsystem: "attachment_worker", Name: "retries_total",