kafka: Add topic partition size metric#23028
Open
piochelepiotr wants to merge 3 commits intomasterfrom
Open
Conversation
Add kafka.log.partition.size metric from the kafka.log:type=Log,name=Size JMX bean, tagged with topic and partition. Reports the on-disk size in bytes of each topic partition log per broker. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
✨ Fix all issues with BitsAI or with Cursor
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
chnn
approved these changes
Mar 24, 2026
The partition size metric only exists when topics have data, which may not be the case in the CI test environment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test Kafka uses confluentinc/cp-kafka which does not support the KAFKA_CREATE_TOPICS env var. Add a kafka-init container that creates the marvel and dc topics so kafka.log:type=Log,name=Size beans exist. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
urseberry
approved these changes
Mar 24, 2026
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.
Summary
kafka.log.partition.sizemetric fromkafka.log:type=Log,name=Size,topic=<topic>,partition=<partition>JMX beantopic,partition, andkafka_cluster_idMotivation
Topic/partition disk usage is useful for capacity planning and identifying hot partitions. This data is already exposed via JMX but wasn't collected by the integration.
Test plan
kafka.log.partition.sizeis emitted with correcttopicandpartitiontags🤖 Generated with Claude Code