KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace#21219
KAFKA-XXXXX: Improve consumer rebalance warning log with exception stack trace#21219dhruvildave235 wants to merge 2 commits intoapache:trunkfrom
Conversation
|
Thanks for the review! |
There was a problem hiding this comment.
Pull request overview
This PR improves observability in consumer rebalance error handling by logging the full exception object instead of just the exception message. This enables stack traces to be captured in logs, making it easier to diagnose rebalance-related issues in production environments.
Key changes:
- Modified the
log.warn()call inConsumerMembershipManager.consumerRebalanceListenerCallbackCompleted()to pass the exception object as the last parameter instead ofe.getMessage() - Updated the log message text from a more verbose description to a more concise format
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...nts/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java
Outdated
Show resolved
Hide resolved
...nts/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java
Show resolved
Hide resolved
...nts/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerMembershipManager.java
Outdated
Show resolved
Hide resolved
|
Thanks for the review. I’ve fixed the indentation and updated the log message to follow Kafka’s positional placeholder style. The exception object is now passed to preserve stack traces. Please let me know if anything else is needed. |
|
Hi maintainers, just a gentle ping on this PR. |
|
Hi maintainers 👋 All CI checks have passed and the PR has CI approval. Thanks! |
|
Seems to be AI generated... The error message is international as-is; no need to include the stack trace. Closing this PR. |
What changed
Improved the consumer rebalance warning log by logging the full exception object instead of only the message.
Why
This improves observability and makes it easier to diagnose rebalance-related issues in production environments.
Testing
./gradlew :clients:compileJava