add a pending approvals prometheus metric
parent
127a820268
commit
13dc40cf39
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/keel-hq/keel/pkg/store"
|
||||
"github.com/keel-hq/keel/types"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
@ -90,6 +91,15 @@ func New(opts *Opts) *DefaultManager {
|
|||
subMu: &sync.RWMutex{},
|
||||
}
|
||||
|
||||
prom_pending := prometheus.NewGaugeFunc(prometheus.GaugeOpts{
|
||||
Name: "keel_pending_approvals",
|
||||
Help: "number of the pending approvals",
|
||||
}, func() float64 {
|
||||
approvals, _ := man.List()
|
||||
return float64(len(approvals))
|
||||
})
|
||||
prometheus.MustRegister(prom_pending)
|
||||
|
||||
return man
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue