Repository navigation
feat(metrics): emit conserver.redis.memory_used_bytes observable gauge - #175
Merged
Merged
Conversation
Adds a second observable gauge in the queue_metrics module that samples ``used_memory`` from ``INFO memory`` on every metric-export tick and emits it as ``conserver.redis.memory_used_bytes``. The metric exists so monitoring stacks that previously relied on an externally-deployed Redis exporter for memory pressure visibility can get the same signal from the conserver itself. One round-trip per pod per tick; negligible cost. Single series per pod, no per-key attributes — pod identity is already on the resource. Bootstrapped from worker_loop alongside the existing ``conserver.ingress_list.length`` gauge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a second observable gauge in
common/lib/queue_metrics.py:conserver.redis.memory_used_bytesINFO memory→used_memorySampled on every metric-export tick alongside
conserver.ingress_list.length. One round-trip per pod per tick; negligible cost.The metric exists so monitoring stacks can observe Redis memory pressure directly from the conserver process — useful when a deployment doesn't run a separate Redis exporter.
Test plan
New tests in
common/tests/test_queue_metrics.py:INFO memoryfailure → no observation, no exceptionused_memorykey → no observationused_memory(defensive) → no observationused_memory(some clients) → coerced to intAll 13 tests in the module pass.
Manual verification on a running deployment: roll the new image, confirm
conserver.redis.memory_used_bytesshows up in the metrics backend with one series per pod.🤖 Generated with Claude Code