Skip to content

Commit

Permalink
add host.id as a fallback for instance
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed May 22, 2024
1 parent f2ec3e7 commit 9db9356
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ var promTargetKeys = map[string][]string{
semconv.AttributeServiceInstanceID,
semconv.AttributeFaaSInstance,
semconv.AttributeK8SPodName,
semconv.AttributeHostID,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ func TestMapToPrometheusTarget(t *testing.T) {
{
desc: "Attributes from GCE with environment label",
resourceLabels: map[string]string{
"cloud.platform": "gcp_compute_engine",
"cloud.region": "us-central1",
"service.name": "service-name",
"service.instance.id": "1234759430923053489543203",
"cloud.platform": "gcp_compute_engine",
"cloud.region": "us-central1",
"service.name": "service-name",
"host.id": "1234759430923053489543203",
},
expected: &monitoredrespb.MonitoredResource{
Type: "prometheus_target",
Expand Down

0 comments on commit 9db9356

Please sign in to comment.