Skip to content

Kafka Connect: Add metric for partial commit failures - #16433

Merged
laskoviymishka merged 2 commits into
apache:mainfrom
yadavay-amzn:fix/16392-partial-commit-metric
Jun 17, 2026
Merged

Kafka Connect: Add metric for partial commit failures#16433
laskoviymishka merged 2 commits into
apache:mainfrom
yadavay-amzn:fix/16392-partial-commit-metric

Conversation

@yadavay-amzn

@yadavay-amzn yadavay-amzn commented May 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #16392.

Summary

Adds an AtomicLong counter to Coordinator that increments each time commit(partialCommit=true) catches a RuntimeException. This gives operators visibility into how often partial commits are failing on overloaded clusters.

Changes

  • Coordinator.java: Added partialCommitFailures counter, incremented in the existing partialCommit catch block. Exposed via package-private partialCommitFailureCount() for testability.
  • TestCoordinator.java: Added testPartialCommitFailureMetric() — mocks a CommitFailedException on append, verifies counter starts at 0 and increments to 1 after a failed partial commit cycle.

Follow-up

The counter can be wired to a Kafka Connect Sensor/MBean for JMX exposure in a separate PR.

@yadavay-amzn

Copy link
Copy Markdown
Contributor Author

@laskoviymishka Could you take a look when you get a chance? This is a small addition (7 lines of production code) — adds a counter for partial commit failures so operators can monitor retry pressure. Thanks!

@yadavay-amzn
yadavay-amzn force-pushed the fix/16392-partial-commit-metric branch from b4b7ce0 to ad51fc2 Compare June 17, 2026 01:01

@laskoviymishka laskoviymishka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice and clean! No objections here :)

:shipit:

@yadavay-amzn

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and approving @laskoviymishka !
cc @AnatolyPopov

@laskoviymishka
laskoviymishka merged commit de4f1ab into apache:main Jun 17, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kafka Connect: Add metric for partial commit failures

2 participants