feat(backend): added heuristics metrics builder

This commit is contained in:
Alexander Zavorotynskiy 2023-03-14 11:23:15 +01:00
parent 9e59d5e1ab
commit 321c07d914

View file

@ -0,0 +1,22 @@
package heuristics
import "github.com/prometheus/client_golang/prometheus"
var heuristicsTotalEvents = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "heuristics",
Name: "events_total",
Help: "A counter displaying the number of all processed events",
},
[]string{"type"},
)
func IncreaseTotalEvents(eventType string) {
heuristicsTotalEvents.WithLabelValues(eventType).Inc()
}
func List() []prometheus.Collector {
return []prometheus.Collector{
heuristicsTotalEvents,
}
}