From b5ec4379d062a1ed3ead0b1a3f55645c7b6eb682 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sun, 23 Oct 2022 12:11:24 +0300 Subject: [PATCH] app/vmselect/promql: expose missing metric `vm_cache_size_max_bytes{type="promql/rollupResult"}` --- app/vmselect/promql/rollup_result_cache.go | 3 +++ docs/CHANGELOG.md | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/vmselect/promql/rollup_result_cache.go b/app/vmselect/promql/rollup_result_cache.go index fd81c4716..44f755559 100644 --- a/app/vmselect/promql/rollup_result_cache.go +++ b/app/vmselect/promql/rollup_result_cache.go @@ -152,6 +152,9 @@ func InitRollupResultCache(cachePath string) { metrics.GetOrCreateGauge(`vm_cache_size_bytes{type="promql/rollupResult"}`, func() float64 { return float64(fcs().BytesSize) }) + metrics.GetOrCreateGauge(`vm_cache_size_max_bytes{type="promql/rollupResult"}`, func() float64 { + return float64(fcs().MaxBytesSize) + }) metrics.GetOrCreateGauge(`vm_cache_requests_total{type="promql/rollupResult"}`, func() float64 { return float64(fcs().GetCalls) }) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index bb284e822..5a3038511 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -17,6 +17,8 @@ The following tip changes can be tested by building VictoriaMetrics components f * SECURITY: update Go builder to v1.19.3. This fixes [CVE-2022 security issue](https://github.com/golang/go/issues/56328). See [the changelog](https://github.com/golang/go/issues?q=milestone%3AGo1.19.3+label%3ACherryPickApproved). +* BUGFIX: `vmselect`: expose missing metric `vm_cache_size_max_bytes{type="promql/rollupResult"}` . This metric is used for monitoring rollup cache usage with the query `vm_cache_size_bytes{type="promql/rollupResult"} / vm_cache_size_max_bytes{type="promql/rollupResult"}` in the same way as this is done for other cache types. + ## [v1.79.4](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.79.4)