From 05672a3b592ccf57951481716e4eee621f590c71 Mon Sep 17 00:00:00 2001 From: Mohammad Alhussan Date: Thu, 11 Jan 2024 18:05:19 +0100 Subject: [PATCH] Fix issue with per database metric not properly resetting --- collector.go | 2 ++ readme.md | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/collector.go b/collector.go index 01c6269..297daea 100644 --- a/collector.go +++ b/collector.go @@ -154,6 +154,7 @@ func (e *exporter) Collect(ch chan<- prometheus.Metric) { } func collectPerDatabaseGauge(stats *stats, vec *prometheus.GaugeVec, collectFunc func(*dbStats) []metricInfo, ch chan<- prometheus.Metric) { + vec.Reset() for _, dbs := range stats.dbStats { metricInfos := collectFunc(dbs) @@ -165,6 +166,7 @@ func collectPerDatabaseGauge(stats *stats, vec *prometheus.GaugeVec, collectFunc } func collectPerDatabaseCounter(stats *stats, vec *prometheus.CounterVec, collectFunc func(*dbStats) []metricInfo, ch chan<- prometheus.Metric) { + vec.Reset() for _, dbs := range stats.dbStats { metricInfos := collectFunc(dbs) diff --git a/readme.md b/readme.md index cc7cdd0..9bde945 100644 --- a/readme.md +++ b/readme.md @@ -122,6 +122,10 @@ ravendb_working_set_bytes 1.651195904e+09 ## Changelog +### 0.5.1 + +* Fixed issue with per database metric not properly resetting + ### 0.5.0 * Added database gauge metric: `ravendb_database_tasks`