Skip to content

Commit

Permalink
Fix cache hit metric call
Browse files Browse the repository at this point in the history
  • Loading branch information
anbsky committed Nov 14, 2024
1 parent 11f4f61 commit 0fd57a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/query/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 0fd57a9

Please sign in to comment.