diff --git a/pkg/roachprod/promhelperclient/client.go b/pkg/roachprod/promhelperclient/client.go index 34c55bcc06ae..43e3eb10a30b 100644 --- a/pkg/roachprod/promhelperclient/client.go +++ b/pkg/roachprod/promhelperclient/client.go @@ -15,7 +15,6 @@ import ( "fmt" "io" "net/http" - "strconv" "strings" "github.com/cockroachdb/cockroach/pkg/roachprod/config" @@ -192,10 +191,10 @@ type NodeInfo struct { // createClusterConfigFile creates the cluster config file per node func buildCreateRequest(nodes map[int]*NodeInfo, insecure bool) (io.Reader, error) { configs := make([]*CCParams, 0) - for i, n := range nodes { + for _, n := range nodes { params := &CCParams{ Targets: []string{n.Target}, - Labels: map[string]string{"node": strconv.Itoa(i)}, + Labels: map[string]string{}, } // custom labels - this can override the default labels if needed for n, v := range n.CustomLabels { diff --git a/pkg/roachprod/promhelperclient/client_test.go b/pkg/roachprod/promhelperclient/client_test.go index 82fa64c6bf11..12d503a5f0fb 100644 --- a/pkg/roachprod/promhelperclient/client_test.go +++ b/pkg/roachprod/promhelperclient/client_test.go @@ -13,7 +13,6 @@ import ( "net/http" "os" "path/filepath" - "strconv" "strings" "testing" @@ -66,11 +65,13 @@ func TestUpdatePrometheusTargets(t *testing.T) { require.Nil(t, yaml.UnmarshalStrict([]byte(ir.Config), &configs)) require.Len(t, configs, 2) for _, c := range configs { - nodeID, err := strconv.Atoi(c.Labels["node"]) - require.NoError(t, err) - require.Equal(t, nodeInfos[nodeID].Target, c.Targets[0]) - for k, v := range nodeInfos[nodeID].CustomLabels { - require.Equal(t, v, c.Labels[k]) + if c.Targets[0] == "n1" { + require.Empty(t, nodeInfos[1].CustomLabels) + } else { + require.Equal(t, "n3", c.Targets[0]) + for k, v := range nodeInfos[3].CustomLabels { + require.Equal(t, v, c.Labels[k]) + } } } return &http.Response{ diff --git a/pkg/roachprod/roachprod.go b/pkg/roachprod/roachprod.go index 0a73d8a0c904..54a31c9133f8 100644 --- a/pkg/roachprod/roachprod.go +++ b/pkg/roachprod/roachprod.go @@ -847,7 +847,6 @@ func createLabels(v vm.VM) map[string]string { "host_ip": v.PrivateIP, "project": v.Project, "zone": v.Zone, - "tenant": install.SystemInterfaceName, "job": "cockroachdb", } match := regionRegEx.FindStringSubmatch(v.Zone)