fix: kafka delay metrics reporting when offsets caught up#17975
Open
alexr17 wants to merge 4 commits intoapache:masterfrom
Open
fix: kafka delay metrics reporting when offsets caught up#17975alexr17 wants to merge 4 commits intoapache:masterfrom
alexr17 wants to merge 4 commits intoapache:masterfrom
Conversation
lokeshj1703
reviewed
Jan 22, 2026
Collaborator
lokeshj1703
left a comment
There was a problem hiding this comment.
@alexr17 Thanks for working on this! I have minor comments.
hudi-utilities/src/test/java/org/apache/hudi/utilities/sources/helpers/TestKafkaOffsetGen.java
Show resolved
Hide resolved
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/helpers/KafkaOffsetGen.java
Show resolved
Hide resolved
2f46494 to
c997148
Compare
ec4cbbc to
66d7d2b
Compare
lokeshj1703
approved these changes
Feb 2, 2026
Contributor
Author
|
@hudi-bot run azure |
Use range-based assertion instead of exact value because Kafka's message distribution across partitions is non-deterministic when messages don't have explicit partition keys. The test now validates: - Delay count is positive (lag exists) - Delay count is reasonable (≤ total messages)
nsivabalan
approved these changes
Feb 2, 2026
Contributor
Author
|
@hudi-bot run azure |
yihua
reviewed
Feb 6, 2026
Comment on lines
+321
to
+323
| // Always emit the Kafka delay count metric (even when 0) | ||
| metrics.updateStreamerSourceDelayCount(METRIC_NAME_KAFKA_DELAY_COUNT, kafkaDelayCount); | ||
|
|
Contributor
There was a problem hiding this comment.
nit: do we want to account for else branch below to account for EARLIEST and GROUP where the delay count should also be calculated?
Another nit: if the check point string does not follow the format (checkTopicCheckpoint(lastCheckpointStr)), after the change it can fail the calculation.
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the issue this Pull Request addresses
kafka delay metric not reporting when count drops to zero
Summary and Changelog
Always report the metric
Impact
Consistently reports the kafka delay metric
Risk Level
Low
Documentation Update
None
Contributor's checklist