package cushion import "github.com/prometheus/client_golang/prometheus" type Metrics struct { CushionSuccessfulAcksTotal *prometheus.CounterVec CushionFailedAcksTotal *prometheus.CounterVec } func NewMetrics() *Metrics { m := &Metrics{ CushionSuccessfulAcksTotal: prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "cushion_successful_acks_total", Help: "total number of successful cushion acks", }, []string{"tenant_id", "db_name"}), CushionFailedAcksTotal: prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "cushion_failed_acks_total", Help: "total number of failed cushion acks", }, []string{"tenant_id", "db_name"}), } prometheus.MustRegister( m.CushionSuccessfulAcksTotal, m.CushionFailedAcksTotal, ) return m } func (m *Metrics) Reset() { m.CushionFailedAcksTotal.Reset() m.CushionSuccessfulAcksTotal.Reset() }