Skip to content

Improve kafka error report#418

Merged
CarlosGamero merged 3 commits intomainfrom
bugfix/fix_error_report
Mar 18, 2026
Merged

Improve kafka error report#418
CarlosGamero merged 3 commits intomainfrom
bugfix/fix_error_report

Conversation

@CarlosGamero
Copy link
Collaborator

@CarlosGamero CarlosGamero commented Mar 18, 2026

We’ve recently noticed that Platformatic AggregatedErrors are not being properly displayed in Bugsnag. At the moment, we only see the aggregated error message (e.g., “fetch failed 7 times”), which isn’t very helpful for identifying the root cause.

The full error details are available in the logs, but it would be much more useful to have them in Bugsnag. This would save us from switching tools and manually searching through logs to investigate issues.

Summary by CodeRabbit

  • Refactor

    • Improved error handling in the Kafka service for more consistent logging and error reporting.
  • Chores

    • Bumped Kafka dependency versions to ^1.30.0 across the Kafka packages.

@CarlosGamero CarlosGamero self-assigned this Mar 18, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 70844e67-3a42-47a7-8ced-240a950dd828

📥 Commits

Reviewing files that changed from the base of the PR and between cb27fb5 and 9ce8e80.

📒 Files selected for processing (1)
  • packages/kafka/load-tests/package.json

📝 Walkthrough

Walkthrough

Compute and reuse a single resolved error log in AbstractKafkaService.handlerError and update errorReporter context to include the resolved error; bump @platformatic/kafka in two package.json files (packages/kafka and packages/kafka/load-tests) from earlier versions to ^1.30.0.

Changes

Cohort / File(s) Summary
Error handling
packages/kafka/lib/AbstractKafkaService.ts
handlerError now computes resolvedErrorLog once and reuses it for the logger call and the errorReporter.report context (includes error: resolvedErrorLog.error). No public API changes.
Dependency bumps
packages/kafka/package.json, packages/kafka/load-tests/package.json
Updated @platformatic/kafka dependency to ^1.30.0 in both package manifests (previously ^1.29.0 and 1.28.0 respectively).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • kibertoad
  • kjamrog

Poem

🐰 I nibbled code in morning light,
One resolved log, concise and bright,
No duplicate calls in the glen,
Errors reported neat again,
I hop — dependencies set right 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Improve kafka error report' directly describes the main change in the PR, which improves how Kafka errors are reported (specifically by sending full aggregated error details to Bugsnag). It is concise, clear, and accurately represents the primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/fix_error_report
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@CarlosGamero CarlosGamero marked this pull request as ready for review March 18, 2026 12:09
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/kafka/lib/AbstractKafkaService.ts`:
- Line 134: The current spread `context: { ...context, error:
resolvedErrorLog.error }` in AbstractKafkaService always overwrites any
caller-provided context.error; change it to preserve an existing error by using
a conditional merge (e.g., set error to context.error if present, otherwise
resolvedErrorLog.error) so you don't clobber upstream metadata — update the
expression used where the context is constructed in AbstractKafkaService to
`error: context.error ?? resolvedErrorLog.error` (or equivalent conditional
logic).

In `@packages/kafka/package.json`:
- Line 56: Update the dependency version for "@platformatic/kafka" in the
load-tests package.json so it matches the main package: change the pinned
version "1.28.0" (in the load-tests package.json's dependencies) to "^1.30.0" to
keep both packages using the same "@platformatic/kafka" release.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e8257fa7-b3b9-4a77-998a-0c14c0788a04

📥 Commits

Reviewing files that changed from the base of the PR and between 5bf142e and cb27fb5.

📒 Files selected for processing (2)
  • packages/kafka/lib/AbstractKafkaService.ts
  • packages/kafka/package.json

@CarlosGamero CarlosGamero merged commit ce72b58 into main Mar 18, 2026
7 checks passed
@CarlosGamero CarlosGamero deleted the bugfix/fix_error_report branch March 18, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants