lib/storage: fix metric vm_object_references{type="indexdb"} (#6937)

follow up
4ecc370acb

### Describe Your Changes

Please provide a brief description of the changes you made. Be as
specific as possible to help others understand the purpose and impact of
your modifications.

### Checklist

The following checks are **mandatory**:

- [ ] My change adheres [VictoriaMetrics contributing
guidelines](https://docs.victoriametrics.com/contributing/).
This commit is contained in:
Hui Wang 2024-09-05 22:42:49 +08:00 committed by GitHub
parent 49e57ea80e
commit b48f5f3e59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -25,6 +25,7 @@ See also [LTS releases](https://docs.victoriametrics.com/lts-releases/).
* BUGFIX: [vmagent dashboard](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/dashboards/vmagent.json): fix legend captions for stream aggregation related panels. Before they were displaying wrong label names. * BUGFIX: [vmagent dashboard](https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/dashboards/vmagent.json): fix legend captions for stream aggregation related panels. Before they were displaying wrong label names.
* BUGFIX: [vmgateway](https://docs.victoriametrics.com/vmgateway/): add missing `datadog`, `newrelic`, `opentelemetry` and `pushgateway` routes to the `JWT` authorization routes. Allows prefixed (`promtheus/graphite`) routes for query requests. * BUGFIX: [vmgateway](https://docs.victoriametrics.com/vmgateway/): add missing `datadog`, `newrelic`, `opentelemetry` and `pushgateway` routes to the `JWT` authorization routes. Allows prefixed (`promtheus/graphite`) routes for query requests.
* BUGFIX: [Single-node VictoriaMetrics](https://docs.victoriametrics.com/) and `vmstorage` in [VictoriaMetrics cluster](https://docs.victoriametrics.com/cluster-victoriametrics/): fix metric `vm_object_references{type="indexdb"}`. Previously, it was overcounted.
## [v1.103.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.103.0) ## [v1.103.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.103.0)

View file

@ -224,6 +224,9 @@ func (db *indexDB) UpdateMetrics(m *IndexDBMetrics) {
m.TagFiltersToMetricIDsCacheMisses += cs.Misses m.TagFiltersToMetricIDsCacheMisses += cs.Misses
m.IndexDBRefCount += uint64(db.refCount.Load()) m.IndexDBRefCount += uint64(db.refCount.Load())
// this shouldn't increase the MissingTSIDsForMetricID value,
// as we only count it as missingTSIDs if it can't be found in both the current and previous indexdb.
m.MissingTSIDsForMetricID += db.missingTSIDsForMetricID.Load() m.MissingTSIDsForMetricID += db.missingTSIDsForMetricID.Load()
m.DateRangeSearchCalls += db.dateRangeSearchCalls.Load() m.DateRangeSearchCalls += db.dateRangeSearchCalls.Load()
@ -252,7 +255,6 @@ func (db *indexDB) UpdateMetrics(m *IndexDBMetrics) {
m.GlobalSearchCalls += extDB.globalSearchCalls.Load() m.GlobalSearchCalls += extDB.globalSearchCalls.Load()
m.MissingMetricNamesForMetricID += extDB.missingMetricNamesForMetricID.Load() m.MissingMetricNamesForMetricID += extDB.missingMetricNamesForMetricID.Load()
m.IndexDBRefCount += uint64(extDB.refCount.Load())
}) })
} }