Skip to content

feat(inkless:switch): expose DisklessWithoutRemoteStorageCount metric for legacy topics#618

Merged
giuseppelillo merged 2 commits into
mainfrom
jeqo/kc-152-diskless-without-rs-metric
May 28, 2026
Merged

feat(inkless:switch): expose DisklessWithoutRemoteStorageCount metric for legacy topics#618
giuseppelillo merged 2 commits into
mainfrom
jeqo/kc-152-diskless-without-rs-metric

Conversation

@jeqo

@jeqo jeqo commented May 28, 2026

Copy link
Copy Markdown
Contributor

Adds a gauge metric counting diskless topics that have remote.storage.enable explicitly set to false. Topics where RS is absent (never configured) are not counted — the controller will auto-enable RS on next interaction.

Logs a warning with topic names on snapshot load, letting operators fix at their pace.

Changes

  • ControllerMetadataMetrics: new DisklessWithoutRemoteStorageCount gauge
  • ControllerMetadataMetricsPublisher: counts topics in publishSnapshot() where RS is explicitly false; advisory-only, refreshed on snapshot (default: every hour or 20MB of metadata)
  • Tests: metric gauge test + publisher snapshot test with mixed RS states

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a controller metric to surface diskless topics that do not have remote.storage.enable=true, with snapshot-time warning logs listing affected topics.

Changes:

  • Registers DisklessWithoutRemoteStorageCount as a KafkaController gauge.
  • Computes the new count during snapshot publication and logs affected diskless topics.
  • Adds metric-name and gauge wiring tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetadataMetrics.java Adds storage and registration for the new gauge metric.
metadata/src/main/java/org/apache/kafka/controller/metrics/ControllerMetadataMetricsPublisher.java Counts diskless topics without remote storage during snapshot publication and logs warnings.
metadata/src/test/java/org/apache/kafka/controller/metrics/ControllerMetadataMetricsTest.java Verifies metric registration and gauge value wiring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeqo jeqo force-pushed the jeqo/kc-152-diskless-without-rs-metric branch from a3081ba to 55d22c3 Compare May 28, 2026 09:55
@jeqo jeqo requested a review from Copilot May 28, 2026 09:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

@jeqo jeqo force-pushed the jeqo/kc-152-diskless-without-rs-metric branch 2 times, most recently from 1d7a72e to eace6c7 Compare May 28, 2026 10:19
@jeqo jeqo requested a review from Copilot May 28, 2026 10:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

@jeqo jeqo force-pushed the jeqo/kc-152-diskless-without-rs-metric branch from eace6c7 to 60a5234 Compare May 28, 2026 10:33
@jeqo jeqo requested a review from Copilot May 28, 2026 10:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

… for legacy topics

Adds a gauge metric counting diskless topics where remote.storage.enable
is explicitly set to false. Topics with remote.storage.enable absent
(never configured) are not counted — the controller will auto-enable on
next interaction.

Logs a warning with topic names on snapshot load (capped at 20),
letting operators fix at their pace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeqo jeqo force-pushed the jeqo/kc-152-diskless-without-rs-metric branch from 60a5234 to 1b3cc19 Compare May 28, 2026 10:47
@jeqo jeqo requested a review from Copilot May 28, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment on lines +79 to +80
private static final MetricName DISKLESS_WITHOUT_REMOTE_STORAGE_COUNT = getMetricName(
"KafkaController", "DisklessWithoutRemoteStorageCount");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added as fixup

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@jeqo jeqo marked this pull request as ready for review May 28, 2026 11:00
@jeqo jeqo requested a review from giuseppelillo May 28, 2026 11:00
@giuseppelillo giuseppelillo merged commit f6fab21 into main May 28, 2026
10 checks passed
@giuseppelillo giuseppelillo deleted the jeqo/kc-152-diskless-without-rs-metric branch May 28, 2026 13:17
giuseppelillo pushed a commit that referenced this pull request May 29, 2026
… for legacy topics (#618)

* feat(inkless:switch): expose DisklessWithoutRemoteStorageCount metric for legacy topics

Adds a gauge metric counting diskless topics where remote.storage.enable
is explicitly set to false. Topics with remote.storage.enable absent
(never configured) are not counted — the controller will auto-enable on
next interaction.

Logs a warning with topic names on snapshot load (capped at 20),
letting operators fix at their pace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fixup! feat(inkless:switch): expose DisklessWithoutRemoteStorageCount metric for legacy topics

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
giuseppelillo pushed a commit that referenced this pull request May 29, 2026
… for legacy topics (#618)

* feat(inkless:switch): expose DisklessWithoutRemoteStorageCount metric for legacy topics

Adds a gauge metric counting diskless topics where remote.storage.enable
is explicitly set to false. Topics with remote.storage.enable absent
(never configured) are not counted — the controller will auto-enable on
next interaction.

Logs a warning with topic names on snapshot load (capped at 20),
letting operators fix at their pace.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fixup! feat(inkless:switch): expose DisklessWithoutRemoteStorageCount metric for legacy topics

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants