MQ-1154 Add metrics() method to Queue binding#6246
Open
KennethRuan wants to merge 1 commit intocloudflare:mainfrom
Open
MQ-1154 Add metrics() method to Queue binding#6246KennethRuan wants to merge 1 commit intocloudflare:mainfrom
KennethRuan wants to merge 1 commit intocloudflare:mainfrom
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
sdnts
reviewed
Mar 5, 2026
sdnts
reviewed
Mar 5, 2026
Author
|
I have read the CLA Document and I hereby sign the CLA |
7f7bc65 to
640cb4c
Compare
jasnell
reviewed
Mar 5, 2026
jasnell
reviewed
Mar 5, 2026
jasnell
approved these changes
Mar 5, 2026
a0e4962 to
ce9f7b5
Compare
jasnell
approved these changes
Mar 18, 2026
4 tasks
ce9f7b5 to
9824741
Compare
9824741 to
1c84049
Compare
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 new
metrics()method to theWorkerQueuebinding. The method returns consumer backlog information via a GET subrequest to the/metricsendpoint on the upstream Queues service.Changes
This PR introduces changes to
queue.c++andqueue.hto implement themetrics()method. The new method definition is gated behind thequeues_metrics_apicompat flag and returns the following response type:The upstream changes can be found here:
https://gitlab.cfdata.org/cloudflare/mq/queue-broker-worker/-/merge_requests/1734
https://gitlab.cfdata.org/cloudflare/mq/queue-broker-worker/-/merge_requests/1759
Testing
bazel test //src/workerd/api/tests:queue-test@- queue send/sendBatch tests + error-codes tests passbazel test //src/workerd/api/tests:queue-test@all-compat-flagsbazel test //src/workerd/api/tests:queue-metrics-test@- tests new api with flag enabled + flag disabledbazel test //src/workerd/api/tests:queue-metrics-test@all-compat-flags