Skip to content

Commit

Permalink
add additional test for service instance id override
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed May 22, 2024
1 parent 9db9356 commit b55a370
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,26 @@ func TestMapToPrometheusTarget(t *testing.T) {
},
},
},
{
desc: "Attributes from GCE with instance ID override",
resourceLabels: map[string]string{
"cloud.platform": "gcp_compute_engine",
"cloud.region": "us-central1",
"service.name": "service-name",
"service.instance.id": "service-instance-id",
"host.id": "1234759430923053489543203",
},
expected: &monitoredrespb.MonitoredResource{
Type: "prometheus_target",
Labels: map[string]string{
"location": "us-central1",
"cluster": "__gce__",
"namespace": "",
"job": "service-name",
"instance": "service-instance-id",
},
},
},
} {
t.Run(tc.desc, func(t *testing.T) {
r := pcommon.NewResource()
Expand Down

0 comments on commit b55a370

Please sign in to comment.