Skip to content

Commit

Permalink
fix(processor): dropped metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Savid committed Jul 14, 2023
1 parent 6c01149 commit 64e297b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/processor/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type Metrics struct {
name string

itemsQueued *prometheus.GaugeVec
itemsDropped *prometheus.CounterVec
itemsDropped *prometheus.GaugeVec
itemsExported *prometheus.CounterVec
}

Expand All @@ -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",
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 64e297b

Please sign in to comment.