Expose per-queue delivered and acked totals in Prometheus metrics#1837
Open
Expose per-queue delivered and acked totals in Prometheus metrics#1837
Conversation
Add `detailed_queue_messages_delivered_total` and `detailed_queue_messages_acked_total` counters to the `queue_coarse_metrics` family, enabling per-queue latency calculations. Closes #1831 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use synchronous basic_get instead of async subscribe to avoid a race where server-side ack processing hasn't completed before metrics are fetched. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restore subscribe-based consumption (tests the push consumer path) and use should_eventually to retry the metrics assertion until server-side ack processing completes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Code Review No issues found. The new metrics follow the same pattern as existing metrics in the |
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.
WHAT is this pull request doing?
Adds
lavinmq_detailed_queue_messages_delivered_totalandlavinmq_detailed_queue_messages_acked_totalcounters to thequeue_coarse_metricsfamily on/metrics/detailed. These use the samedeliver_get_countandack_countcounters shown in the Overview API, now broken down per queue withqueueandvhostlabels. This enables per-queue latency calculations likelatency ≈ (ready + unacked) / ack_rate.Closes #1831
HOW can this pull request be tested?
make test SPEC=spec/api/prometheus_spec.cr— includes a new spec that publishes, consumes, and acks messages then verifies both new metrics appear with correct values.