Commit 2f6012d
committed
obs(redis): lua pool metrics — r1 review fixes
Round-1 fixes on commit f7354b4:
1. coderabbit CRITICAL @ JSON:1749 — row ID 24 collision
The new "Lua VM Pool" row reused id:24, which the existing
"Hot Path (legacy PR #560)" row also uses for one of its
nested panels. Grafana requires unique IDs across the entire
dashboard; collisions cause import failures / ambiguous UI
refs. Changed the row's id to 33 (max existing was 32). Codex
P2 raised the same finding.
2. coderabbit MAJOR @ JSON:1817 — missing node_id template filter
All four new Lua VM Pool queries hardcoded {job="elastickv"}
and ignored the $node_id template variable that every other
panel in this dashboard threads through. Operators picking a
specific node in the dropdown got cluster-wide data on this
row only. Added node_id=~"$node_id" to all 8 query strings
(idle, max_idle, hits, misses, drops_rate, drops_range, and
the saturation ratio's numerator + denominator).
3. gemini medium @ lua_pool.go:86 — AlreadyRegisteredError absorption
RegisterLuaPool now wraps the loop with errors.As(err,
*prometheus.AlreadyRegisteredError) and skips. Test harnesses
that share a registry across sub-tests (and any hypothetical
hot-reload path in main.go) can now retry without tripping a
spurious slog.Warn. Other registration errors (invalid metric
name, label conflict) still propagate.
Test:
go test -race -count=1 -run TestRegisterLuaPool ./monitoring
-- green.
golangci-lint run --config=.golangci.yaml ./monitoring ./adapter .
-- 0 issues.
python3 -c "import json; json.load(open(
'monitoring/grafana/dashboards/elastickv-redis-summary.json'))"
-- JSON valid.
New test TestRegisterLuaPool_IdempotentOnDoubleRegister locks in
the idempotent-double-register contract per CLAUDE.md's
test-with-fix convention.1 parent 05da85d commit 2f6012d
2 files changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
103 | 122 | | |
104 | 123 | | |
105 | 124 | | |
| |||
0 commit comments