Bug
MaxPodHitCount is defined in pkg/kvcache/metrics/collector.go:44 and actively used in pkg/kvcache/kvblock/instrumented_index.go:90, but it is not included in the Collectors() slice at collector.go:78-84.
Since Register() calls metrics.Registry.MustRegister(Collectors()...), MaxPodHitCount is never registered with the Prometheus registry. This means the metric is silently dropped — no scrape error, no panic, but the data is never exposed.
Impact
kvcache_index_max_pod_hit_count_total is invisible to Prometheus/Grafana
- Operators cannot monitor per-pod cache hit distribution
- The
recordHitMetrics goroutine in instrumented_index.go:71 runs on every Lookup call but its output is discarded
Root Cause
MaxPodHitCount was likely added after the initial Collectors() list was written and was not appended to the slice.
Additionally, logMetrics() does not log MaxPodHitCount, so the periodic metrics beat also omits this value.
Fix
- Add
MaxPodHitCount to the Collectors() return slice
- Add
MaxPodHitCount to logMetrics() output
- Add test coverage for
MaxPodHitCount in collector_test.go
Bug
MaxPodHitCountis defined inpkg/kvcache/metrics/collector.go:44and actively used inpkg/kvcache/kvblock/instrumented_index.go:90, but it is not included in theCollectors()slice atcollector.go:78-84.Since
Register()callsmetrics.Registry.MustRegister(Collectors()...),MaxPodHitCountis never registered with the Prometheus registry. This means the metric is silently dropped — no scrape error, no panic, but the data is never exposed.Impact
kvcache_index_max_pod_hit_count_totalis invisible to Prometheus/GrafanarecordHitMetricsgoroutine ininstrumented_index.go:71runs on everyLookupcall but its output is discardedRoot Cause
MaxPodHitCountwas likely added after the initialCollectors()list was written and was not appended to the slice.Additionally,
logMetrics()does not logMaxPodHitCount, so the periodic metrics beat also omits this value.Fix
MaxPodHitCountto theCollectors()return sliceMaxPodHitCounttologMetrics()outputMaxPodHitCountincollector_test.go