Skip to content

[tctl/top] Add raw metrics view#57260

Merged
okraport merged 3 commits intomasterfrom
okraport/tctl-top-raw-metrics
Aug 7, 2025
Merged

[tctl/top] Add raw metrics view#57260
okraport merged 3 commits intomasterfrom
okraport/tctl-top-raw-metrics

Conversation

@okraport
Copy link
Copy Markdown
Contributor

This commit adds a new tab to the tctl top utility which renders prometheus metrics as a list which supports live updates and filtering.

It makes use of the bubbles/list charm which supports fuzzy searching via github.com/sahilm/fuzzy.

Refactores the main model to split the refresh tick into seperate tea commands to allow tapping the raw metrics concurrently to generating the report.
Keybinds are now stored as part of the model and used directly for handling KeyMsg events.

Note that list.Model does not support variable height list item entries and for pagination purposes this value needs to be fixed, for this reason histogram metrics will only render sum and count.

Closes: #56944

changelog: tctl top can now display raw prometheus metrics

@okraport
Copy link
Copy Markdown
Contributor Author

demo

This is currently how this looks like.

This commit adds a new tab to the `tctl top` utility
which renders prometheus metrics as a list which supports
live updates and filtering.

It makes use of the bubbles/list charm which supports
fuzzy searching via github.com/sahilm/fuzzy.

Refactores the main model to split the refresh tick
into seperate tea commands to allow tapping the raw
metrics concurrently to generating the report.
Keybinds are now stored as part of the model and used
directly for handling KeyMsg events.

Note that `list.Model` does not support variable height
list item entries and for pagination purposes this value
needs to be fixed, for this reason histogram metrics will
only render sum and count.

Closes: #56944

changelog: tctl top can now display raw prometheus metrics
@okraport okraport force-pushed the okraport/tctl-top-raw-metrics branch from 89e2c07 to eb67c78 Compare July 29, 2025 10:39
Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy left a comment

Choose a reason for hiding this comment

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

Nice! Looks good to me overall, just a few style related questions and comments.

Comment thread tool/tctl/common/top/metrics.go Outdated
Comment thread tool/tctl/common/top/metrics.go Outdated
Comment thread tool/tctl/common/top/metrics.go
Comment thread tool/tctl/common/top/metrics.go Outdated
Comment thread tool/tctl/common/top/model.go Outdated
Comment thread tool/tctl/common/top/model.go Outdated
Comment thread tool/tctl/common/top/model.go Outdated
Comment thread tool/tctl/common/top/model.go Outdated
Comment thread tool/tctl/common/top/model.go Outdated
@okraport okraport requested a review from fspmarshall July 31, 2025 11:03
@okraport
Copy link
Copy Markdown
Contributor Author

okraport commented Aug 5, 2025

@creack @greedy52 @fspmarshall Please take a look if possible, thanks!

@okraport okraport added this pull request to the merge queue Aug 7, 2025
Merged via the queue into master with commit 1566362 Aug 7, 2025
42 checks passed
@okraport okraport deleted the okraport/tctl-top-raw-metrics branch August 7, 2025 08:51
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@okraport See the table below for backport results.

Branch Result
branch/v16 Failed
branch/v17 Failed
branch/v18 Create PR

okraport added a commit that referenced this pull request Aug 7, 2025
This commit adds a new tab to the `tctl top` utility
which renders prometheus metrics as a list which supports
live updates and filtering.

It makes use of the bubbles/list charm which supports
fuzzy searching via github.com/sahilm/fuzzy.

Refactores the main model to split the refresh tick
into seperate tea commands to allow tapping the raw
metrics concurrently to generating the report.
Keybinds are now stored as part of the model and used
directly for handling KeyMsg events.

Note that `list.Model` does not support variable height
list item entries and for pagination purposes this value
needs to be fixed, for this reason histogram metrics will
only render sum and count.

changelog: tctl top can now display raw prometheus metrics

* apply review suggestions
okraport added a commit that referenced this pull request Aug 7, 2025
This commit adds a new tab to the `tctl top` utility
which renders prometheus metrics as a list which supports
live updates and filtering.

It makes use of the bubbles/list charm which supports
fuzzy searching via github.com/sahilm/fuzzy.

Refactores the main model to split the refresh tick
into seperate tea commands to allow tapping the raw
metrics concurrently to generating the report.
Keybinds are now stored as part of the model and used
directly for handling KeyMsg events.

Note that `list.Model` does not support variable height
list item entries and for pagination purposes this value
needs to be fixed, for this reason histogram metrics will
only render sum and count.

changelog: tctl top can now display raw prometheus metrics

* apply review suggestions
okraport added a commit that referenced this pull request Aug 7, 2025
This commit adds a new tab to the `tctl top` utility
which renders prometheus metrics as a list which supports
live updates and filtering.

It makes use of the bubbles/list charm which supports
fuzzy searching via github.com/sahilm/fuzzy.

Refactores the main model to split the refresh tick
into seperate tea commands to allow tapping the raw
metrics concurrently to generating the report.
Keybinds are now stored as part of the model and used
directly for handling KeyMsg events.

Note that `list.Model` does not support variable height
list item entries and for pagination purposes this value
needs to be fixed, for this reason histogram metrics will
only render sum and count.

changelog: tctl top can now display raw prometheus metrics

* apply review suggestions
okraport added a commit that referenced this pull request Aug 7, 2025
This commit adds a new tab to the `tctl top` utility
which renders prometheus metrics as a list which supports
live updates and filtering.

It makes use of the bubbles/list charm which supports
fuzzy searching via github.com/sahilm/fuzzy.

Refactores the main model to split the refresh tick
into seperate tea commands to allow tapping the raw
metrics concurrently to generating the report.
Keybinds are now stored as part of the model and used
directly for handling KeyMsg events.

Note that `list.Model` does not support variable height
list item entries and for pagination purposes this value
needs to be fixed, for this reason histogram metrics will
only render sum and count.

changelog: tctl top can now display raw prometheus metrics

* apply review suggestions
okraport added a commit that referenced this pull request Aug 7, 2025
This commit adds a new tab to the `tctl top` utility
which renders prometheus metrics as a list which supports
live updates and filtering.

It makes use of the bubbles/list charm which supports
fuzzy searching via github.com/sahilm/fuzzy.

Refactores the main model to split the refresh tick
into seperate tea commands to allow tapping the raw
metrics concurrently to generating the report.
Keybinds are now stored as part of the model and used
directly for handling KeyMsg events.

Note that `list.Model` does not support variable height
list item entries and for pagination purposes this value
needs to be fixed, for this reason histogram metrics will
only render sum and count.

changelog: tctl top can now display raw prometheus metrics

* apply review suggestions
github-merge-queue bot pushed a commit that referenced this pull request Aug 7, 2025
This commit adds a new tab to the `tctl top` utility
which renders prometheus metrics as a list which supports
live updates and filtering.

It makes use of the bubbles/list charm which supports
fuzzy searching via github.com/sahilm/fuzzy.

Refactores the main model to split the refresh tick
into seperate tea commands to allow tapping the raw
metrics concurrently to generating the report.
Keybinds are now stored as part of the model and used
directly for handling KeyMsg events.

Note that `list.Model` does not support variable height
list item entries and for pagination purposes this value
needs to be fixed, for this reason histogram metrics will
only render sum and count.

changelog: tctl top can now display raw prometheus metrics

* apply review suggestions
github-merge-queue bot pushed a commit that referenced this pull request Aug 7, 2025
This commit adds a new tab to the `tctl top` utility
which renders prometheus metrics as a list which supports
live updates and filtering.

It makes use of the bubbles/list charm which supports
fuzzy searching via github.com/sahilm/fuzzy.

Refactores the main model to split the refresh tick
into seperate tea commands to allow tapping the raw
metrics concurrently to generating the report.
Keybinds are now stored as part of the model and used
directly for handling KeyMsg events.

Note that `list.Model` does not support variable height
list item entries and for pagination purposes this value
needs to be fixed, for this reason histogram metrics will
only render sum and count.

changelog: tctl top can now display raw prometheus metrics

* apply review suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add raw metrics tab to tctl top

4 participants