Skip to content

feat: Logging improvement - #364

Merged
CarlosGamero merged 6 commits into
mainfrom
feat/logging_improvement
Dec 3, 2025
Merged

feat: Logging improvement#364
CarlosGamero merged 6 commits into
mainfrom
feat/logging_improvement

Conversation

@CarlosGamero

@CarlosGamero CarlosGamero commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Chores

    • Patch version bumped to 0.7.9.
  • Refactor

    • Enhanced internal message-processing logs for better observability, including clearer indications when no valid messages are received and counts of processed messages.
    • No end-user visible behavior changes expected.

✏️ Tip: You can customize this high-level summary in your review settings.

@CarlosGamero CarlosGamero self-assigned this Dec 3, 2025
@coderabbitai

coderabbitai Bot commented Dec 3, 2025

Copy link
Copy Markdown

Walkthrough

Added debug logging to the Kafka consumer's consume method (records origin, topic, validation outcomes and valid message counts) and removed the firstMessage assignment that may now be referenced without definition. Also bumped package version from 0.7.8 to 0.7.9.

Changes

Cohort / File(s) Change Summary
Kafka Consumer Logging
packages/kafka/lib/AbstractKafkaConsumer.ts
Added debug logs at the start of consume and after message validation (including "Consuming message(s)" and "Received not valid message(s)"); removed the firstMessage assignment while the variable appears still referenced downstream.
Version Bump
packages/kafka/package.json
Updated package version from 0.7.8 to 0.7.9.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas needing attention:
    • Verify whether firstMessage is still used after its assignment was removed; ensure no undefined access or restore intended initialization.
    • Confirm new debug statements use appropriate log levels and do not leak sensitive data.
    • Ensure version bump matches release policy.

Possibly related PRs

Suggested reviewers

  • kibertoad

Poem

🐰
I nibble logs at break of dawn,
Counting topics, origins drawn.
A firstMessage hid from sight—
Hop back, check the trail tonight!

Pre-merge checks and finishing touches

✅ 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 'feat: Logging improvement' accurately reflects the main changes in the PR, which add debug logging statements to the consume method in AbstractKafkaConsumer.ts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/logging_improvement

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de010f6 and 81430e3.

📒 Files selected for processing (1)
  • packages/kafka/lib/AbstractKafkaConsumer.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/kafka/lib/AbstractKafkaConsumer.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: general (22.x, @message-queue-toolkit/schemas) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/outbox-core) / build
  • GitHub Check: general (20.x, @message-queue-toolkit/core) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/sqs) / build
  • GitHub Check: general (20.x, @message-queue-toolkit/sns) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/core) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/redis-message-deduplication-store) / build
  • GitHub Check: general (20.x, @message-queue-toolkit/amqp) / build
  • GitHub Check: general (24.x, @message-queue-toolkit/sqs) / build
  • GitHub Check: general (20.x, @message-queue-toolkit/sqs) / build
  • GitHub Check: general (24.x, @message-queue-toolkit/sns) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/sns) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/s3-payload-store) / build
  • GitHub Check: kafka (24.x) / build
  • GitHub Check: kafka (22.x) / build

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 December 3, 2025 17:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2077222 and e55dde2.

📒 Files selected for processing (2)
  • packages/kafka/lib/AbstractKafkaConsumer.ts (2 hunks)
  • packages/kafka/package.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (16)
  • GitHub Check: general (20.x, @message-queue-toolkit/sns) / build
  • GitHub Check: general (20.x, @message-queue-toolkit/outbox-core) / build
  • GitHub Check: general (20.x, @message-queue-toolkit/amqp) / build
  • GitHub Check: general (24.x, @message-queue-toolkit/schemas) / build
  • GitHub Check: general (24.x, @message-queue-toolkit/amqp) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/redis-message-deduplication-store) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/amqp) / build
  • GitHub Check: general (24.x, @message-queue-toolkit/s3-payload-store) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/core) / build
  • GitHub Check: general (24.x, @message-queue-toolkit/sqs) / build
  • GitHub Check: general (24.x, @message-queue-toolkit/outbox-core) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/sns) / build
  • GitHub Check: general (22.x, @message-queue-toolkit/sqs) / build
  • GitHub Check: general (20.x, @message-queue-toolkit/sqs) / build
  • GitHub Check: kafka (24.x) / build
  • GitHub Check: kafka (22.x) / build
🔇 Additional comments (3)
packages/kafka/package.json (1)

3-3: LGTM: Version bump aligns with logging enhancements.

The patch version increment from 0.7.8 to 0.7.9 is appropriate for the non-breaking logging improvements added to the Kafka consumer.

packages/kafka/lib/AbstractKafkaConsumer.ts (2)

281-289: LGTM: Conditional logging improves observability.

The conditional logging correctly handles both scenarios (no valid messages vs. valid messages received) and improves debugging capability. The early return on Line 283 ensures subsequent code only executes when valid messages exist.


292-293: AI summary inconsistency: firstMessage assignment is present.

The AI-generated summary incorrectly states that the firstMessage assignment was removed. However, Line 292 clearly shows this assignment still exists and is correctly placed after the validMessages.length check (Line 281), making it safe.

Comment thread packages/kafka/lib/AbstractKafkaConsumer.ts Outdated
@CarlosGamero
CarlosGamero merged commit 5378488 into main Dec 3, 2025
31 checks passed
@CarlosGamero
CarlosGamero deleted the feat/logging_improvement branch December 3, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants