suryaprasanna opened a new pull request, #17518:
URL: https://github.com/apache/hudi/pull/17518
### Describe the issue this Pull Request addresses
This PR adds new metrics to track log block compaction statistics during
write operations. Currently, metrics for log files compacted and log records
compacted exist, but metrics for total log blocks compacted are missing,
limiting observability into compaction behavior.
### Summary and Changelog
Users gain better observability into compaction operations with new
metrics tracking log blocks compacted.
**Changes:**
- Added `TOTAL_LOG_BLOCKS_COMPACTED_STR` and
`TOTAL_LOG_RECORDS_COMPACTED_STR` metric constants
- Added `getTotalLogBlocksCompacted()` method in `HoodieCommitMetadata` to
aggregate log blocks across write stats
- Registered `totalLogRecordsCompacted` metric for all write operations
- Registered `totalLogBlocksCompacted` metric when
`isCompactionLogBlockMetricsOn()` is enabled
### Impact
**New metrics** - Two new metrics are published:
- `totalLogRecordsCompacted` - always published for compaction operations
- `totalLogBlocksCompacted` - published when log block metrics are enabled
No breaking changes to existing APIs or metrics.
### Risk Level
**None** - This change only adds new metrics without modifying existing
behavior or metrics.
### Documentation Update
None - These are additional metrics following existing patterns. No new
configuration is introduced; they use the existing
`hoodie.metrics.compaction.log.block.metrics.on` config.
- The config description must be updated if new configs are added or the
default value of the configs are changed.
- Any new feature or user-facing change requires updating the Hudi website.
Please follow the
[instruction](https://hudi.apache.org/contribute/developer-setup#website)
to make changes to the website. -->
### Contributor's checklist
- [x] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [x] Enough context is provided in the sections above
- [x] Adequate tests were added if applicable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]