From 64e297b94af7cee8008d15169e9f45a450d95f07 Mon Sep 17 00:00:00 2001 From: Andrew Davis <1709934+Savid@users.noreply.github.com> Date: Fri, 14 Jul 2023 13:09:17 +1000 Subject: [PATCH] fix(processor): dropped metrics --- pkg/processor/metrics.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/processor/metrics.go b/pkg/processor/metrics.go index 066c9896..796d0a19 100644 --- a/pkg/processor/metrics.go +++ b/pkg/processor/metrics.go @@ -6,7 +6,7 @@ type Metrics struct { name string itemsQueued *prometheus.GaugeVec - itemsDropped *prometheus.CounterVec + itemsDropped *prometheus.GaugeVec itemsExported *prometheus.CounterVec } @@ -23,7 +23,7 @@ func NewMetrics(namespace, name string) (*Metrics, error) { Namespace: namespace, Help: "Number of items queued", }, []string{"processor"}), - itemsDropped: prometheus.NewCounterVec(prometheus.CounterOpts{ + itemsDropped: prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "items_dropped_total", Namespace: namespace, Help: "Number of items dropped", @@ -59,7 +59,7 @@ func (m *Metrics) SetItemsQueued(count float64) { } func (m *Metrics) SetItemsDropped(count float64) { - m.itemsDropped.WithLabelValues(m.name).Add(count) + m.itemsDropped.WithLabelValues(m.name).Set(count) } func (m *Metrics) IncItemsExportedBy(count float64) {