-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: kafka delay metrics reporting when offsets caught up #17975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
lokeshj1703
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
|
@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)
|
@hudi-bot run azure |
yihua
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| // Always emit the Kafka delay count metric (even when 0) | ||
| metrics.updateStreamerSourceDelayCount(METRIC_NAME_KAFKA_DELAY_COUNT, kafkaDelayCount); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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