Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces multi-cluster separation by collecting cluster identifiers in snapshot metadata and wiring a cluster filter (plus “hide empty panels”) through the cbmonitor UI and backend query paths.
Changes:
- Config-manager now collects and stores
clustersmetadata and updates generated service-discovery URLs to emit cluster labels. - cbmonitor UI adds cluster filtering (PromQL injection + SQL++ label filtering) and a “hide empty panels” setting via a consolidated settings dropdown.
- cbmonitor backend applies cluster filtering by translating the chosen cluster into an
instance IN [...]constraint derived from snapshot metadata targets.
Reviewed changes
Copilot reviewed 46 out of 47 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/config-manager-api.md | Documents cluster label emission in service-discovery URLs and updates example output. |
| config-manager/main.go | Adds fallback to file-based metadata storage when primary metadata storage init fails. |
| config-manager/internal/storage/file.go | Adds clusterLabels=... to generated prometheus_sd_config URLs. |
| config-manager/internal/services/metadata.go | Adds cluster discovery via /prometheus_sd_config and supports scheme selection. |
| config-manager/internal/api/handlers.go | Aggregates metadata across hostnames and persists combined services/clusters. |
| config-manager/internal/models/{snapshot.go,metadata.go} | Adds Cluster model and includes clusters in snapshot metadata. |
| cbmonitor/src/services/{clusterFilterService.ts,layoutService.ts,pageBuilder.ts} | Adds cluster filter state + hide-empty persistence and scene cache key expansion. |
| cbmonitor/src/utils/utils.panel.ts | Injects cluster filters into PromQL / SQL++ and hides panels when data is empty. |
| cbmonitor/src/pages/snapshotViewPage.ts | Adds SettingsDropdown control and resets cluster filter when switching snapshots. |
| cbmonitor/src/components/{SettingsDropdown/*,SnapshotDisplay/metadataSummary.tsx} | New settings UI; adds snapshot-id copy affordance in metadata summary. |
| cbmonitor/pkg/{handlers/snapshot.go,querybuilder/querybuilder.go,services/snapshot.go,models/snapshot.go} | Adds clusters to metadata model and applies cluster filtering via instance constraints. |
| config-manager/tests/* (deleted) | Removes multiple tests (config, manager, API integration, metadata). |
| cbmonitor/dashboards/*.json (deleted) | Removes several static dashboard JSONs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.