Repository navigation
feat(web-console): show stream partition count on the supervisors table - #20619
abhishekrb19 wants to merge 2 commits into
Conversation
The supervisor status API already reports partitions. Surface that count next to running tasks so operators can compare task count with topic partition count.
The new Partitions column changes the visible column counter from 10/10 to 11/11.
amaechler
left a comment
There was a problem hiding this comment.
Cool beans, I like that! No more digging into the Supervisor status to find your count somewhere in the JSON :) One idea / discussion about whether to add to Details instead.
|
|
||
| if (capabilities.hasOverlordAccess()) { | ||
| if (visibleColumns.shown('Running tasks', 'Details', 'Recent errors')) { | ||
| if (visibleColumns.shown('Running tasks', 'Partitions', 'Details', 'Recent errors')) { |
There was a problem hiding this comment.
Since Partitions is visible by default, users who hid Running tasks, Details and Recent errors to avoid the per-supervisor status calls get them back after upgrading: their stored visibility has no Partitions key, so shown('Partitions') is true. I reproduced this locally by setting supervisor-table-column-selection to {"Running tasks": false, "Details": false, "Recent errors": false}: the table shows Partitions and fires one /status request per supervisor on every refresh, where master makes none.
Options: pass ['Partitions'] as defaultHidden to LocalStorageBackedVisibility, or show the count inside the Details cell (see the comment below), which avoids the new gate entry altogether.
| }, | ||
| show: visibleColumns.shown('Running tasks'), | ||
| }, | ||
| { |
There was a problem hiding this comment.
But maybe easier than the above, have you considered putting this into Details instead of a new column? Details already branches on kafka/kinesis/rabbit and reads the same payload, so a second line Partitions: N under Lag: N would be a few lines, keeps the table at 10 columns, avoids an always-empty column for autocompact and scheduled_batch rows, and sidesteps the visibility issue above.
| show: visibleColumns.shown('Partitions'), | ||
| Cell: ({ value, original }) => { | ||
| const status = useContext(StatusContext); | ||
| if (!oneOf(original.type, 'kafka', 'kinesis', 'rabbit')) return null; |
There was a problem hiding this comment.
nit: this type check looks redundant. Only the seekable-stream report payloads have a numeric partitions, so isNumberLike(partitions) already returns null for other supervisor types. Dropping it also avoids a third copy of the stream type list in this file.
| if (!oneOf(original.type, 'kafka', 'kinesis', 'rabbit')) return null; | ||
| const partitions = status[value]?.payload?.partitions; | ||
| return isNumberLike(partitions) ? ( | ||
| <span data-tooltip="Number of partitions in the stream"> |
There was a problem hiding this comment.
nit: for Kinesis this is technically the shard count. If we'd know the streaming type here, we could switch the terminology.
FrankChen021
left a comment
There was a problem hiding this comment.
🟢 Approval recommended
No actionable issues found. The new Partitions column is correctly wired through the column selector, existing status-API fetch gating, and supervisors table rendering. It reads the existing payload.partitions value, uses established number formatting, and leaves non-stream supervisor rows blank.
Reviewed 2 of 2 changed files: /Users/frankchen/.codex/mergelens/worktrees/apache__druid__pr-20619/web-console/src/views/supervisors-view/supervisors-view.tsx and /Users/frankchen/.codex/mergelens/worktrees/apache__druid__pr-20619/web-console/src/views/supervisors-view/snapshots/supervisors-view.spec.tsx.snap. Also inspected the visibility helper, status model, backend payload, endpoint, query lifecycle, and selector behavior.
Validation: git diff --check over the supplied merge-base range passed for both changed files. No tests, build, formatter, or install commands were run.
This is an automated review by Codex GPT-5.6-Luna(max)
Description
The supervisors table already shows aggregate lag and task counts from the supervisor status API. That same payload includes
partitionsfor Kafka, Kinesis, and Rabbit supervisors, but the console did not display it.This adds a Partitions column between Running tasks and Details. It is loaded from
GET /druid/indexer/v1/supervisor/{id}/statuswhen the column is visible, and it can be toggled from the column selector like the other status-API columns. Other supervisor types leave the cell blank.Release note
The web console supervisors table now shows the stream partition count for Kafka, Kinesis, and Rabbit supervisors.
Key changed/added classes in this PR
web-console/src/views/supervisors-view/supervisors-view.tsxThis PR has: