-
Notifications
You must be signed in to change notification settings - Fork 363
fix: add missing metric tracking of pulsar_client_consumer_acks
for AckIDList method
#1396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
AckIDList
method 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 |
Motivation
Fixes #1393
The metric
pulsar_client_consumer_acks
was not being incremented when using theAckIDList
method, 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.go
to properly track acknowledgments inAckIDList
methodTestAckIDListWillIncreaseAckCounterMetrics
test to verify that the ack counter metrics are properly incremented when usingAckIDList
test_setup_test.go
with Prometheus metrics server to support metric testingThe fix ensures that the
pulsar_client_consumer_acks
metric 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
yes
was chosen, please highlight the changesDocumentation