Skip to content

[v2.x] Emit RecordsFailedProcessing when the record processor throws - #1839

Merged
chenylee-aws merged 2 commits into
awslabs:v2.xfrom
chenylee-aws:v2.x-records-skipped-metric
Oct 30, 2026
Merged

chenylee-aws merged 2 commits into
awslabs:v2.xfrom
chenylee-aws:v2.x-records-skipped-metric

Conversation

@chenylee-aws

@chenylee-aws chenylee-aws commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

  • When processRecords() throws, emit a RecordsFailedProcessing metric with the number of records in that batch, at shard and application level. Since KCL doesn't retry here, it's an upper bound on records impacted by record processor failures.
  • Emit RecordsProcessed only after processRecords() returns. It was emitted before the handoff, so records in a failed batch were also counted as processed. It now counts the records delivered to the record processor (after records at or below the checkpoint are filtered out), and failed batches are counted only in RecordsFailedProcessing.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@chenylee-aws
chenylee-aws force-pushed the v2.x-records-skipped-metric branch 2 times, most recently from d2bcfeb to 809a219 Compare October 29, 2026 18:32
@chenylee-aws
chenylee-aws marked this pull request as ready for review October 29, 2026 20:38
lucienlu-aws
lucienlu-aws previously approved these changes Oct 29, 2026
@chenylee-aws
chenylee-aws force-pushed the v2.x-records-skipped-metric branch from 2ee502e to ee05c14 Compare October 29, 2026 23:37
@chenylee-aws chenylee-aws changed the title [v2.x] Emit RecordsSkipped when the record processor throws [v2.x] Emit RecordsFailedProcessing when the record processor throws Oct 29, 2026
@chenylee-aws
chenylee-aws force-pushed the v2.x-records-skipped-metric branch 2 times, most recently from dbd5eca to 7c3010a Compare October 29, 2026 23:41
When processRecords() throws, emit RecordsFailedProcessing with the number of records in the batch at shard and application level. KCL does not retry at this point, so it is an upper bound on records impacted by record processor failures.
RecordsProcessed was emitted before the handoff, so records in a batch where processRecords() threw were also counted as processed. Emit it after processRecords() returns. It now counts records delivered to the record processor (after checkpoint filtering), and failed batches are counted only in RecordsFailedProcessing.
@chenylee-aws
chenylee-aws force-pushed the v2.x-records-skipped-metric branch from 080f0a2 to dc095ae Compare October 29, 2026 23:59
@chenylee-aws
chenylee-aws merged commit a0de648 into awslabs:v2.x Oct 30, 2026
@chenylee-aws
chenylee-aws deleted the v2.x-records-skipped-metric branch October 30, 2026 20:26
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.

3 participants