Add KafkaErrorDetector for producer/consumer error detection#9
Conversation
Detects: - ProducerFencedException - CommitFailedException - WakeupException - org.apache.kafka.common.errors Severity: ERROR Good first issue contribution (AbaSheger#1).
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new KafkaErrorDetector is implemented to identify Kafka runtime errors matching ProducerFencedException, CommitFailedException, WakeupException, and org.apache.kafka.common.errors patterns. The detector is registered in IssueClassifier and covered by comprehensive test cases. ChangesKafka Error Detection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/java/com/stacklens/detector/AllDetectorsTest.java (1)
263-290: ⚡ Quick winStrengthen Kafka positive tests with type/severity assertions.
These tests currently only check
isPresent(). Please also assertgetType()(and ideallygetSeverity()) so regressions in emitted metadata are caught, not just matching behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/com/stacklens/detector/AllDetectorsTest.java` around lines 263 - 290, Update the three Kafka tests (kafkaErrorDetector_detectsCommitFailedException, kafkaErrorDetector_detectsWakeupException, kafkaErrorDetector_detectsKafkaCommonErrors) to not only assert result.isPresent() but also validate the emitted Issue metadata: call result.get() and assert its getType() equals the expected Kafka type emitted by KafkaErrorDetector (use the detector's declared type constant or literal used by KafkaErrorDetector) and assert getSeverity() equals the expected severity value (use the severity constant from KafkaErrorDetector or the Severity enum value the detector is intended to produce). This ensures the tests verify Issue.getType() and Issue.getSeverity() in addition to presence.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/test/java/com/stacklens/detector/AllDetectorsTest.java`:
- Around line 263-290: Update the three Kafka tests
(kafkaErrorDetector_detectsCommitFailedException,
kafkaErrorDetector_detectsWakeupException,
kafkaErrorDetector_detectsKafkaCommonErrors) to not only assert
result.isPresent() but also validate the emitted Issue metadata: call
result.get() and assert its getType() equals the expected Kafka type emitted by
KafkaErrorDetector (use the detector's declared type constant or literal used by
KafkaErrorDetector) and assert getSeverity() equals the expected severity value
(use the severity constant from KafkaErrorDetector or the Severity enum value
the detector is intended to produce). This ensures the tests verify
Issue.getType() and Issue.getSeverity() in addition to presence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 14ebf4f5-e2c6-4859-9be6-0ed67e8ed4e8
📒 Files selected for processing (3)
src/main/java/com/stacklens/classifier/IssueClassifier.javasrc/main/java/com/stacklens/detector/KafkaErrorDetector.javasrc/test/java/com/stacklens/detector/AllDetectorsTest.java
Added class-level and method-level Javadoc to fix CodeRabbit's docstring coverage warning. Follows existing detector patterns.
|
Reviewed the Kafka detector changes. The implementation is scoped to Kafka producer/consumer error patterns, the detector is registered in the classifier, and CI is passing on the latest commit. There is one minor follow-up suggestion to strengthen a few positive tests with type/severity assertions, but it is not blocking this merge. Thanks for the contribution. |
|
Thanks again for adding the Kafka error detector. I verified the merged project locally with |
Closes #1
Added
KafkaErrorDetectorto detect common Kafka producer/consumer failures in Spring Boot logs.Changes
KafkaErrorDetector.java— detectsProducerFencedException,CommitFailedException,WakeupException,org.apache.kafka.common.errorsat ERROR severityIssueClassifier.java— registered new detectorAllDetectorsTest.java— 5 tests covering all patterns + negative case.Summary by CodeRabbit
New Features
Tests