Repository navigation
fix: add missing metric tracking of pulsar_client_consumer_acks for AckIDList method - #1396
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where the pulsar_client_consumer_acks metric was not being tracked when using the AckIDList method. The fix ensures consistent metric tracking across all consumer acknowledgment methods for better observability.
- Added missing metrics tracking for
AckIDListmethod in consumer - Enhanced test infrastructure with Prometheus metrics server for metric validation
- Cleaned up test service startup script by removing unused environment variables
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pulsar/consumer_partition.go | Added metrics tracking for ack counter and processing time in AckIDList method |
| pulsar/consumer_test.go | Added test to verify AckIDList metrics tracking functionality |
| pulsar/test_setup_test.go | Created test infrastructure with Prometheus metrics server for metric testing |
| scripts/pulsar-test-service-start.sh | Removed unused PULSAR_MEM and PULSAR_STANDALONE_USE_ZOOKEEPER environment variables |
RobertIndie
marked this pull request as draft
July 22, 2025 05:48
RobertIndie
marked this pull request as ready for review
July 22, 2025 10:35
BewareMyPower
approved these changes
Jul 24, 2025
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.
Motivation
Fixes #1393
The metric
pulsar_client_consumer_ackswas not being incremented when using theAckIDListmethod, which is a bug that affects observability and monitoring of consumer acknowledgment behavior. This issue prevents proper tracking of batch acknowledgment operations.Modifications
pc.metrics.AcksCounter.Add(float64(len(msgIDs)))inconsumer_partition.goto properly track acknowledgments inAckIDListmethodTestAckIDListWillIncreaseAckCounterMetricstest to verify that the ack counter metrics are properly incremented when usingAckIDListtest_setup_test.gowith Prometheus metrics server to support metric testingThe fix ensures that the
pulsar_client_consumer_acksmetric correctly reflects all acknowledgment operations, including batch acknowledgments viaAckIDList, providing consistent observability across all consumer acknowledgment methods.Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If
yeswas chosen, please highlight the changesDocumentation