Skip to content

Multi cluster separation#33

Open
m-tarhon wants to merge 8 commits intomainfrom
multi-cluster-separation
Open

Multi cluster separation#33
m-tarhon wants to merge 8 commits intomainfrom
multi-cluster-separation

Conversation

@m-tarhon
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 clusters metadata 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants