feat(backend): added heuristics metrics builder
This commit is contained in:
parent
9e59d5e1ab
commit
321c07d914
1 changed files with 22 additions and 0 deletions
22
backend/pkg/metrics/heuristics/metrics.go
Normal file
22
backend/pkg/metrics/heuristics/metrics.go
Normal 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,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue