Repository navigation
feat(admin): Search all nodes in System Queries instead of picking a storage - #8609
Conversation
…storage System Queries made you pick a storage before a host, and the storage list repeats every cluster under many names. The host field is now one autocomplete across every node the admin knows about. Picking a node still sends a storage that lists it, since the backend uses the storage to find the cluster's credentials and validate the node, so the backend is unchanged. Manual host entry keeps a storage picker for the same reason. The search understands hostnames: separators are optional, runs of words can be typed as initials (eap for events-analytics-platform), and a typed separator can skip the rest of a word (err-1 for errors-1). Results rank word-start matches first, then closer word-break alignment, with distributed nodes last, and the matched characters are highlighted. The rules are written up in snuba/admin/static/utils/NODE_SEARCH.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Clearing a select's current value to search for another meant deleting it by hand. Focusing a select now selects its text, so typing replaces it. The mouseup that ends the focusing click is ignored so it doesn't put the caret back. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Some people will still want to pick a storage and then one of its hosts. The host entry toggle is now Search nodes / By storage / Manual. By storage works as before the node search: picking a storage fills in its first host and lists only that storage's nodes. The page remembers which of the two picking modes was used last, and switching between them keeps the current host and storage. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b1d7c6d. Configure here.
| ...prevQuery, | ||
| ...queryForNode(node, prevQuery.storage), | ||
| })); | ||
| } |
There was a problem hiding this comment.
By-storage host not restored
Medium Severity
Picking a storage in by-storage mode fills the first host in query state only, and never writes select-host. Reload always restores that key through queryForNode, so an auto-filled host is lost, and an older search-mode host can overwrite the current storage.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b1d7c6d. Configure here.
| setByStorage(value === "storage"); | ||
| saveByStorage(value === "storage"); | ||
| } | ||
| } |
There was a problem hiding this comment.
Manual-to-search drops storage
Medium Severity
setHostEntry only toggles flags. After a host is typed in Manual, switching back to Search keeps host and port but never runs queryForNode, so storage can stay unset while the storage picker is hidden and Execute stays disabled.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b1d7c6d. Configure here.


System Queries made you pick a storage before a host. The storage list repeats each ClickHouse cluster under many storage names, so finding the right host meant scrolling a long list of near-duplicates. The host field is now one autocomplete across every node the admin knows about, whichever storage it comes from.
Local screenshots:

Old-storage based selector remains:

The backend is unchanged. It still needs a storage, because the storage is how it finds the cluster's credentials, database and TLS settings, and how it checks that the host is a real node. So picking a node quietly sends a storage that lists it:
querylog, which has no 25s timeout; otherwiseManual host entry keeps a storage picker for the same reason. Share links and history entries still carry the storage, so existing links keep working.
The search is built around how our hostnames look. The full rules are in
snuba/admin/static/utils/NODE_SEARCH.md. In short:eap1finds…-platform-1-0.eapfindsevents-analytics-platform.err-1findserrors-1-*.eap-11prefers…-11-1over…-1-1). Distributed-only nodes go last. Matched characters are highlighted.I considered a library such as fzf-for-js, match-sorter or Fuse.js. These score fuzzy subsequences, so with about 200 similar hostnames, a search like
err-1would also match hosts such asgeneric-metrics-1-0, ranked lower. Rules this specific to hostnames are simpler to keep exact in about 250 lines of our own than to tune into someone else's scorer.A second, separate commit makes every admin
CustomSelectselect its contents on focus, so typing replaces the current value instead of having to delete it first. It ignores the mouseup from the click that focused the field, because Chrome and Safari would otherwise use it to clear the selection again.Worth a careful look in review:
storageForNodeinclickhouse_node_utils.tsx. It decides which cluster's credentials a query uses.matchVariantFromin the same file, the backtracking part of the search.On 576 hosts the search takes about 1–12ms per keystroke.
/clickhouse_nodesstill looks up cluster topology once per storage, as it did before.🤖 Generated with Claude Code