From 0fd57a9066c12a96877e92d05a460cc6939ae902 Mon Sep 17 00:00:00 2001 From: Andriy Biletsky Date: Fri, 15 Nov 2024 01:31:35 +0700 Subject: [PATCH] Fix cache hit metric call --- app/query/cache.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/query/cache.go b/app/query/cache.go index 91621323..f17a0e2a 100644 --- a/app/query/cache.go +++ b/app/query/cache.go @@ -58,7 +58,9 @@ func (c *QueryCache) Retrieve(query *Query, getter func() (any, error)) (*Cached metrics.SturdyQueryCacheErrorCount.WithLabelValues(cacheReq.Method).Inc() return nil, fmt.Errorf("failed to cache.get: %w", err) } - metrics.SturdyQueryCacheHitCount.WithLabelValues(cacheReq.Method).Inc() + + metrics.SturdyQueryCacheMissCount.WithLabelValues(cacheReq.Method).Inc() + if getter == nil { log.Warnf("nil getter provided for %s", query.Method()) metrics.SturdyQueryCacheErrorCount.WithLabelValues(cacheReq.Method).Inc()