-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[MINOR] Publish HUDI version metrics as integers #17466
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
…rs via the metric system. These metrics can be used to track the versions of HUDI in production. Added HoodieVersion class and its unit test, The HoodieVersion class provides semantic versioning information for HUDI code.
| if (config.isMetricsOn()) { | ||
| // report userName and hudi version | ||
| final String version = HoodieVersion.get(); | ||
| metrics.getMetrics().registerGauge(metrics.getMetricsName("userName", System.getProperty("user.name")), 1); | ||
| metrics.getMetrics().registerGauge(metrics.getMetricsName("version", StringUtils.isNullOrEmpty(version) ? "0.14.x" : version), 1); | ||
| metrics.getMetrics().registerGauge("version.major", HoodieVersion.majorAsInt()); | ||
| metrics.getMetrics().registerGauge("version.minor", HoodieVersion.minorAsInt()); | ||
| metrics.getMetrics().registerGauge("version.patch", HoodieVersion.patchAsInt()); | ||
| } |
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.
Could the logic be put into HoodieMetrics class, similar to HoodieMetrics#emitIndexTypeMetrics?
| metrics.getMetrics().registerGauge("version.major", HoodieVersion.majorAsInt()); | ||
| metrics.getMetrics().registerGauge("version.minor", HoodieVersion.minorAsInt()); | ||
| metrics.getMetrics().registerGauge("version.patch", HoodieVersion.patchAsInt()); |
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.
Are these still needed if the full version is published?
Describe the issue this Pull Request addresses
This PR provides the HoodieVersion class and publishes the major, minor, and patch version of HUDI as integers via the metric system. These metrics can be used to track the versions of HUDI running in production.
Summary and Changelog
Summary:
HoodieVersionclass that provides semantic versioning information for HUDI codeChangelog:
New HoodieVersion class (hudi-common/src/main/java/org/apache/hudi/HoodieVersion.java):
get()major(),minor(),patch()majorAsInt(),minorAsInt(),patchAsInt()New TestHoodieVersion test class (hudi-common/src/test/java/org/apache/hudi/TestHoodieVersion.java):
Updated BaseHoodieWriteClient (hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java):
Impact
Public API Changes: None - This is additive only
User-Facing Changes:
version.major,version.minor,version.patch(as integers)Performance Impact: Negligible - metrics are registered once during client initialization
Risk Level
Low
The changes are additive and do not modify existing behavior. The HoodieVersion class is straightforward with comprehensive unit tests. Metrics registration happens during client initialization and has minimal overhead.
Verification:
Documentation Update
None required. This is an internal metrics improvement. The version information is already documented as part of commit metadata.
Contributor's checklist