Return policy and op-policy-related fields plus delivery_limit when management stats are disabled (backport #15651)#15652
Merged
michaelklishin merged 4 commits intov4.2.xfrom Mar 6, 2026
Conversation
When `management_agent.disable_metrics_collector` and `management.disable_stats` are both set to `true`, the HTTP API returns minimal queue information that excludes policy-related fields and `delivery_limit`. This causes `policy`, `operator_policy`, `effective_policy_definition`, and `delivery_limit` to be `null` in API responses, even though these are configuration metadata rather than statistics. This change adds these four fields to the `format/2` function in both `rabbit_classic_queue` and `rabbit_quorum_queue` modules. The fields now appear in the type-specific formatting that runs regardless of metrics collection status. The three policy fields use existing `i/2` function implementations that call `rabbit_policy` module functions. For `delivery_limit`, this change adds an `i(delivery_limit, Q)` function to `rabbit_quorum_queue` that extracts the delivery limit from the queue's `x-delivery-limit` argument, returning `unlimited` when not set. Fixes #15182 (cherry picked from commit 7f4334b)
The changes in #15182 missed streams. `stats_disabled_via_config` (a test group) unintentionally overridden `disable_management_stats` due to how the parameter merging works. On top of that, add more tests and refactor the implementation to be a bit more defensive and consistent. (cherry picked from commit a8fb664)
Author
|
Cherry-pick of fa753a1 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
…re enabled `rabbit_queue_type:format/2` now conditionally emits policy fields only when management stats are disabled: the stats augmentation code path provides them. 1. `format/2` now conditionally emits policy fields based on whether the management plugin stats are enabled 2. `combine/2` acts as the next layer of protection against duplicate keys: it drops the `format/2`-originating keys that are duplicates 3. `prepare_for_encoding/1` is the new name for `format_nulls/1` that reflects its expanded scope: another deduplication pass References #15182. (cherry picked from commit fa753a1) # Conflicts: # deps/rabbitmq_management/src/rabbit_mgmt_wm_user_queues.erl
(cherry picked from commit 1824d3f)
2f41015 to
0017600
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.
This is #15183 by @lukebakken with a few follow-up changes from me.
Closes #15182.
This is an automatic backport of pull request #15651 done by Mergify.