Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
124598: roachprod: condition to support cockroach-ephemeral r=herkolategan a=nameisbhaskar

only the clusters in cockroach-ephemeral should be selected for scrapping. So, adding a condition for the same.

Fixes: cockroachdb#124319
Epic: none

Co-authored-by: Bhaskarjyoti Bora <[email protected]>
  • Loading branch information
craig[bot] and nameisbhaskar committed May 28, 2024
2 parents 0ea8b62 + d6728f3 commit 46b6fab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/roachprod/roachprod.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ const (
prometheusHostUrlEnv = "COCKROACH_PROM_HOST_URL"
)

// supportedPromProjects are the projects supported for prometheus target
var supportedPromProjects = map[string]struct{}{gce.DefaultProject(): {}}

// MalformedClusterNameError is returned when the cluster name passed to Create is invalid.
type MalformedClusterNameError struct {
name string
Expand Down Expand Up @@ -798,7 +801,7 @@ func updatePrometheusTargets(ctx context.Context, l *logger.Logger, c *install.S
nodeIPPortsMutex := syncutil.RWMutex{}
var wg sync.WaitGroup
for _, node := range c.Nodes {
if c.VMs[node-1].Provider == gce.ProviderName {
if _, ok := supportedPromProjects[c.VMs[node-1].Project]; ok && c.VMs[node-1].Provider == gce.ProviderName {
wg.Add(1)
go func(index int, v vm.VM) {
defer wg.Done()
Expand Down

0 comments on commit 46b6fab

Please sign in to comment.