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`