package metrics import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" ) type State struct { AlertState *prometheus.GaugeVec } func NewStateMetrics(r prometheus.Registerer) *State { return &State{ AlertState: promauto.With(r).NewGaugeVec(prometheus.GaugeOpts{ Namespace: Namespace, Subsystem: Subsystem, Name: "alerts", Help: "How many alerts by state.", }, []string{"state"}), } }