Skip to content

[v17] feat: Bot instances at scale UI (RFD0222)#61466

Closed
nicholasmarais1158 wants to merge 15 commits intobranch/v17from
nicholasmarais1158/backport-bot-instances-at-scale/v17
Closed

[v17] feat: Bot instances at scale UI (RFD0222)#61466
nicholasmarais1158 wants to merge 15 commits intobranch/v17from
nicholasmarais1158/backport-bot-instances-at-scale/v17

Conversation

@nicholasmarais1158
Copy link
Copy Markdown
Contributor

@nicholasmarais1158 nicholasmarais1158 commented Nov 18, 2025

Summary

Backport bot instance UI changes to v17.

Related to:

Changelog: Added advanced search and sorting to the bot instances list in the web UI
Changelog: Added filter and sort flags to tctl bots instances ls
Changelog: Added service health to the output tctl bots instances ls and tctl bot instance show commands
Changelog: Added a dashboard to visualize bot instances by their version compatibility
Changelog: Added bot instance service health to web UI

Changes

Manual testing

  • Start with a clean cluster
  • Bot instances page (Web UI) shows an empty state
image
  • Ran tctl bots add "vitiosus-vivo" to create a bot (the name is significant later)
  • Bot details shows an empty state
image
$ sqlite3 data/backend/sqlite.db

sqlite> .read bot_instances.sql
  • Bot instances page shows instances list and dashboard metrics
    Restart cluster to pick up test data from backend. Refresh web UI after a minute to let metrics report generate.
image
  • Clicking a version compatibility category populates the advanced filter and filters the instances list
image
  • Enter spec.bot_name == "vitiosus-vivo" as an advanced search and sort by version ascending
image
  • Enter 'github' as a basic search
image
  • Selecting an instance item shows overview details
image
  • Service tab shows services alphabetically
image
  • YAML tab shows full resource YAML
image
  • Run tctl bots instances ls --query 'spec.bot_name == "vitiosus-vivo"' --sort-index version_latest --sort-order descending to list instances with a query filter and sort
image
  • Run tctl bots instances show universe/0b2c84a6-8301-4f6b-a8f4-4fd1c542f194 to show an instance with health status
image

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 18, 2025

Amplify deployment status

Branch Commit Job ID Status Preview Updated (UTC)
nicholasmarais1158/backport-bot-instances-at-scale/v17 63118df 2 ✅SUCCEED nicholasmarais1158-backport-bot-instances-at-scale-v17 2025-11-18 10:12:58

nicholasmarais1158 and others added 15 commits November 18, 2025 09:40
* docs(rfd): Bot Instance at Scale (RFD0222)

* Add Notion link

* First draft for review

* fix: Spell check

* Fix protobuf code block

* Make the document structure slightly clearer

* Add a section on data aggregation

* Add missing end of code block

* Add a bit more context on bots and instances

* Add plan for `tctl`

* Add an explanation for each UX example

* Rename semver functions

* Remove activity visualisation and required complexity

* cspell

* Pre-populate isn't the correct term

* Minor tweak

* Test plan additions

* Remove reference to activity visualization

* Clarify use of pagination in `tctl bots instances ls` and remove filter summary

* Refine predicate language functions

* Restructure protos

* Refine plans for resource storage and quantities

* Add webapi support for config, health and notices

* Expand backwards compatibility

* cspell

* State `tbot` config size limit

* Reduce config max size to 32Kb

* Add failsafe env var

* Reduce max notices to 10

* Explain updating related record expiry in-line with the instance

* Revert extracting service health records

* Move notices to earlier in the delivery plan

* Remove notices & config and expand the why and what

* Expand aggregate data and metrics, and rearrange sections

* Fix `version.between` snippet

* Updated approach to calculating bot instance counts

* Document `newer_than` predicate language function

---------

Co-authored-by: Dan Upton <daniel.upton@goteleport.com>
# Conflicts:
#	rfd/cspell.json
* Add version and hostname indexes to cache

* Add `ListBotInstancesV2` rpc and use request options

* Add v2 bot instance list endpoint

* Use v2 endpoint in web UI

* Pass signal through to support aborting requests

* Fix comment typo

* Rename util func

* Deprecate `ListBotInstances` rpc

* Encode hostname in cache key

* Address pre-release sorting in version numbers

* Rename bot instance cache utils

* Fix lint deprecation warnings

* Extract filter fields to message

* Replace `fmt.Sprintf("%06d", ...)`

* Update invalid sort field error

* Fallback to v1 endpoint if possible

* Use `strcase` for case-insensitive compare

* Backend results are filtered by bot name so no need to re-filter in `MatchBotInstance`

* Revert "Replace `fmt.Sprintf("%06d", ...)`"

This reverts commit 2fbd797.
# Conflicts:
#	api/gen/proto/go/teleport/machineid/v1/bot_instance_service.pb.go
#	web/packages/teleport/src/BotInstances/BotInstances.tsx
* Add version and hostname indexes to cache

* Add `ListBotInstancesV2` rpc and use request options

* Add v2 bot instance list endpoint

* Use v2 endpoint in web UI

* Pass signal through to support aborting requests

* Fix comment typo

* Rename util func

* Add expression parser

* Contribute `to_string` function to default parser

* Add API support for `query` filter

* Fix `SearchPanel` submit with advanced toggle

* Add advanced search to web UI

* Deprecate `ListBotInstances` rpc

* Encode hostname in cache key

* Address pre-release sorting in version numbers

* Rename bot instance cache utils

* Fix lint deprecation warnings

* Extract filter fields to message

* Replace `fmt.Sprintf("%06d", ...)`

* Update invalid sort field error

* Fallback to v1 endpoint if possible

* Use `strcase` for case-insensitive compare

* Backend results are filtered by bot name so no need to re-filter in `MatchBotInstance`

* Use `t.Context()`

* Remove expression methods

* Remove unnecessary fallback comments

* Return early if only bot name filter is required (backend only)

* Fix lint

* replace `to_string` with `equals` (version type only)

* Fix comment

* Remove unnecessary `to_string` tests

* Switch to a true equals function
# Conflicts:
#	lib/cache/bot_instance.go
#	web/packages/teleport/src/BotInstances/List/BotInstancesList.tsx

# Conflicts:
#	web/packages/teleport/src/BotInstances/List/BotInstancesList.tsx
* Make `disableSearch` props optional for SearchPanel component

* Add a shared mock for TextEditor

* Make instance items selectable and include bot name

* Remove old bot instance details page

* Add new bot instances UI

* Add stories

* Add and amend tests

* Switch to arrow function

* Remove `null` from item selected callback

* Fix info guide wording
# Conflicts:
#	web/packages/teleport/src/BotInstances/Details/BotInstanceDetails.test.tsx
#	web/packages/teleport/src/BotInstances/List/BotInstancesList.tsx
#	web/packages/teleport/src/config.ts
* Alternate sort menu icons

* Titles and close button

* Yaml background colour

* Spacing

* Keyboard selectable list items

* Fix selected list item padding

* Default scroll bars for list

* Clarify delete bot messaging

* Simplify `onClick`

* Use `FlexProps` type

* Revert "Alternate sort menu icons"

This reverts commit 4212dcd.
* Fix missing `--format` flag

* Use v2 rpc

* Add `--search` flag

* Add `--query` flag

* Add `--sort-index` and `--sort-order` flags

* Remove `generation` and add `version` fields to output

* Allow enabling the auth cache for the test process

* Add list bot instances tests

* Sync join method access logic between tctl and web

* Access `authentication.JoinMethod` safely

* Unhide `--format` flag

* Simplify version header label

* Fallback to v1 ListBotInstances

* Refactor to remove use of `authclient.ClientI`

* A way better fallback implementation 🙌

* typo 🙄

* Refactor to single interface
# Conflicts:
#	tool/tctl/common/bots_command.go
#	tool/tctl/common/bots_command_test.go
#	tool/tctl/common/helpers_test.go
…eference (#60508)

* docs: Add filter, sort and format fields to `tctl bots instances ls` reference

* Using consistent capitalization

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>

---------

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
* Add `service_health` to bot instance protos

* Add aggregated service health to `show`

* Add services section to `show`

* Add health status column to `ls`

* Extra tabs are not welcome

* Handle zero services when aggregating health status
# Conflicts:
#	tool/tctl/common/bots_command.go
* Add `autoupdate_bot_instance_report` to the editor role preset

* Add `/webapi/.../machine-id/bot-instance/metrics` endpoint

* Add missing error check in test

* Better error message when metrics aren't ready

* Allow users with `bot_instance:list` to read the `autoupdate_bot_instance_report`

* Move update timestamp onto upgrade statuses object

* Fix predicate language function names

* Remove erroneous comment

* Fix tests

* Add `refresh_after_seconds` to metrics response

* Return an empty `upgrade_statuses` if there is no report

* Replace `exact_version` helper with simple `==` operator

* Use `trace.Aggregate` to return both auth errors
# Conflicts:
#	gen/preset-roles.json
#	lib/services/presets.go
* Add plumbing for new metrics endpoint

* Align version compatibility logic

* Fix mocked responses in stories

* Add new dashboard component

* Wire-in dashboard component

* Fix lint

* Explain dynamic `refetchInterval`

* docs: `onFilterSelected`

* Use typography components from design package

* Fix `onFilterSelected` naming inconsistencies

* A better nbsp

* Remove "control plane" terminology

* Refactor `GetBotInstanceMetricsResponse` type

* Handle out-of-date proxy

* Make instance list messaging filter aware

* Update chart title to "version compatibility"

* Keep "Last updated x minutes ago" label current

* Oops, forgot to update the test

* Remove unused `TitleText`

* Change dashboard title to "insights"

* Version compatibility design changes

* Fix tests after copy change, oops
* Add tabs to instance details

* Add `kind` to bot instance heartbeat proto

* Extend `GetBotInstanceResponse` type

* Add `InfoTab` component for Overview tab

* Add `HealthTab` component for Services tab

* Wire-up tabs content

* Use `join_attrs.meta` for join token fields

* Fix links style

* Fix handling of unspecified health status

* Fix tab spacing

* Remove tab tooltips

* Replace service item background

* Add zero services story

* Support tctl instance kind

* Fix styled links

* Fix test

* Fix bot instances story
* Make instance items selectable from bot details

* Add test

* Fix mocked calls in stories
# Conflicts:
#	web/packages/teleport/src/Bots/Details/BotDetails.tsx
@nicholasmarais1158 nicholasmarais1158 force-pushed the nicholasmarais1158/backport-bot-instances-at-scale/v17 branch from 68d6cfe to 63118df Compare November 18, 2025 10:11
@nicholasmarais1158 nicholasmarais1158 marked this pull request as ready for review November 18, 2025 10:43
@github-actions github-actions bot added backport documentation rfd Request for Discussion size/xl tctl tctl - Teleport admin tool ui labels Nov 18, 2025
@public-teleport-github-review-bot
Copy link
Copy Markdown

@nicholasmarais1158 - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes.

@nicholasmarais1158 nicholasmarais1158 changed the title Nicholasmarais1158/backport bot instances at scale/v17 [v17] feat: Bot instances at scale UI (RFD0222) Nov 18, 2025
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.

New features should no longer be backported to branch/v17.

@nicholasmarais1158
Copy link
Copy Markdown
Contributor Author

Closing in favour of promoting upgrades to v18 where this feature is available.

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

Labels

backport documentation machine-id rfd Request for Discussion size/xl tctl tctl - Teleport admin tool ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants