Repository navigation
[ISSUE #11654] fix(broker): label DLQ metric with consumer group and origin topic in handleRetryAndDLQ - #11655
Open
coderbruis wants to merge 1 commit into
Open
coderbruis wants to merge 1 commit into
coderbruis wants to merge 1 commit into
Conversation
…p and origin topic in handleRetryAndDLQ
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #11655 +/- ##
==========================================
Coverage 51.33% 51.33%
- Complexity 15036 15038 +2
==========================================
Files 1391 1391
Lines 103942 103944 +2
Branches 13643 13644 +1
==========================================
+ Hits 53354 53363 +9
+ Misses 44329 44318 -11
- Partials 6259 6263 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Which Issue(s) This PR Fixes
Brief Description
In
SendMessageProcessor#handleRetryAndDLQ, therocketmq_send_to_dlq_messages_totalmetric was labeled withrequestHeader.getProducerGroup()andrequestHeader.getTopic(). On this path they areCLIENT_INNER_PRODUCERand%RETRY%{group}.This PR labels it the same way as
AbstractSendMessageProcessor(theCONSUMER_SEND_MSG_BACKpath):consumer_group: the consumer group parsed from the retry topic (groupName, already used by the rest of this method).topic: the original topic fromPROPERTY_RETRY_TOPIC, falling back to the retry topic if the property is absent.is_system: computed from the two values above.Only the metric labels change. DLQ delivery logic is untouched.
Note: after this change, DLQ counts previously aggregated under
consumer_group="CLIENT_INNER_PRODUCER"will appear under the real consumer groups.How Did You Test This Change?
Added two cases to
SendMessageProcessorTest, driven throughprocessRequestwith a retry message that exceedsmaxReconsumeTimes:testSendRetryMessageToDLQ_metricLabeledWithConsumerGroupAndOriginTopic: withPROPERTY_RETRY_TOPIC, the labels are the consumer group and the original topic.testSendRetryMessageToDLQ_metricFallsBackToRetryTopicWithoutOriginTopic: without it, the topic label falls back to the retry topic.Results:
expected "FooBarGroup" but was "CLIENT_INNER_PRODUCER").SendMessageProcessorTestpass.mvn -pl broker -amcheckstyle passes.I also verified end to end with an embedded namesrv and broker. An orderly consumer with
maxReconsumeTimes=1producedconsumer_group="CLIENT_INNER_PRODUCER"before the fix andconsumer_group=<real group>after.