Skip to content

[ISSUE #10899] Fix missing message-out metrics for KV POP - #10900

Open
majialoong wants to merge 2 commits into
apache:developfrom
majialoong:ISSUE-10899
Open

[ISSUE #10899] Fix missing message-out metrics for KV POP#10900
majialoong wants to merge 2 commits into
apache:developfrom
majialoong:ISSUE-10899

Conversation

@majialoong

Copy link
Copy Markdown
Contributor

Which Issue(s) This PR Fixes

Brief Description

Fix missing BrokerStats and OTel message-out metrics in KV POP, restoring Consume TPS and aligning the statistics with traditional POP.

How Did You Test This Change?

Added unit tests and performed local KV POP verification. Confirmed the updated Consume TPS through mqadmin consumerProgress and the related statistics in stats.log.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Fix missing BrokerStats and OTel message-out metrics in KV POP consumption path. The recordPopMessageOut method is correctly placed in handleGetMessageResult and properly distinguishes between normal and retry topics using KeyBuilder.parseNormalTopic. System topic/group detection follows existing patterns.

Comprehensive test coverage including normal topic, V1/V2 retry topic, and edge cases (empty/not-found results). Tests verify that retry topics are correctly parsed to the underlying normal topic for the LABEL_TOPIC attribute.

LGTM — clean, well-tested fix that restores parity between KV POP and traditional POP metrics.


Automated review by github-manager-bot

@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.35%. Comparing base (97a7975) to head (829ce50).

Files with missing lines Patch % Lines
...apache/rocketmq/broker/pop/PopConsumerService.java 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10900      +/-   ##
=============================================
- Coverage      48.46%   48.35%   -0.12%     
+ Complexity     13584    13554      -30     
=============================================
  Files           1380     1380              
  Lines         101195   101213      +18     
  Branches       13130    13133       +3     
=============================================
- Hits           49040    48937     -103     
- Misses         46188    46285      +97     
- Partials        5967     5991      +24     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RockteMQ-AI RockteMQ-AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Adds missing message-out metrics recording for KV POP consumption in PopConsumerService. The new recordPopMessageOut method correctly tracks message count, size, topic, consumer group, and retry status via both BrokerStatsManager and OpenTelemetry metrics.

Well-structured fix with proper test coverage. LGTM.


Automated review by github-manager-bot

@majialoong

Copy link
Copy Markdown
Contributor Author

Hi @lizhimins , please take a look at this PR when have time, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Consume TPS and message-out metrics are missing when KV POP is enabled

3 participants