Skip to content

Add RetentionSizeInPercent and LocalRetentionSizeInPercent metrics for storage monitoring#21468

Open
manangupta111 wants to merge 1 commit intoapache:trunkfrom
manangupta111:KAFKA-20157
Open

Add RetentionSizeInPercent and LocalRetentionSizeInPercent metrics for storage monitoring#21468
manangupta111 wants to merge 1 commit intoapache:trunkfrom
manangupta111:KAFKA-20157

Conversation

@manangupta111
Copy link

Introduces ⁠ RetentionSizeInPercent ⁠ and ⁠ LocalRetentionSizeInPercent ⁠ JMX metrics to express partition storage as a percentage of configured retention limits. No existing metrics or behavior are changed.

This PR implements KIP-1257: Partition Size Percentage Metrics for Storage Monitoring.

JMX Metric names

kafka.log.remote:type=RemoteLogManager,name=RetentionSizeInPercent,topic=<topic>,partition=<partition>
kafka.log.remote:type=RemoteLogManager,name=LocalRetentionSizeInPercent,topic=<topic>,partition=<partition>

Testing

•⁠ ⁠Unit tests covering percentage calculations and edge cases
•⁠ ⁠Tests for zero and negative (unlimited) retention configurations
•⁠ ⁠Tests for metric lifecycle (registration, update, cancellation)
•⁠ ⁠Tests verifying metrics are reset on task cancellation

@github-actions github-actions bot added triage PRs from the community storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature labels Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant