diff --git a/CHANGELOG.md b/CHANGELOG.md index 003e2acaec305..be347c41d756e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - `tanzuobservabilityexporter`: Improve how negative values in exponential histograms are handled. (#10135) - `resourcedetectionprocessor`: GCP resource detector now properly detects zone/region on GKE (#10347) +- `resourcedetectionprocessor`: GCP resource detector no longer fails to detect resource when using workload identity (#10486) ## v0.52.0 diff --git a/processor/resourcedetectionprocessor/internal/gcp/gcp.go b/processor/resourcedetectionprocessor/internal/gcp/gcp.go index 0ab73e86a3d7c..6d3b3acbafdd6 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/gcp.go +++ b/processor/resourcedetectionprocessor/internal/gcp/gcp.go @@ -66,7 +66,6 @@ func (d *detector) Detect(context.Context) (resource pcommon.Resource, schemaURL b.addZoneOrRegion(d.detector.GKEAvailabilityZoneOrRegion) b.add(conventions.AttributeK8SClusterName, d.detector.GKEClusterName) b.add(conventions.AttributeHostID, d.detector.GKEHostID) - b.add(conventions.AttributeHostName, d.detector.GKEHostName) case gcp.CloudRun: b.attrs.InsertString(conventions.AttributeCloudPlatform, conventions.AttributeCloudPlatformGCPCloudRun) b.add(conventions.AttributeFaaSName, d.detector.FaaSName) diff --git a/processor/resourcedetectionprocessor/internal/gcp/gcp_test.go b/processor/resourcedetectionprocessor/internal/gcp/gcp_test.go index 4d52aa88f4a05..284fc1503b6da 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/gcp_test.go +++ b/processor/resourcedetectionprocessor/internal/gcp/gcp_test.go @@ -46,7 +46,6 @@ func TestDetect(t *testing.T) { projectID: "my-project", cloudPlatform: gcp.GKE, gkeHostID: "1472385723456792345", - gkeHostName: "my-gke-node-1234", gkeClusterName: "my-cluster", gkeAvailabilityZone: "us-central1-c", }}, @@ -57,7 +56,6 @@ func TestDetect(t *testing.T) { conventions.AttributeK8SClusterName: "my-cluster", conventions.AttributeCloudAvailabilityZone: "us-central1-c", conventions.AttributeHostID: "1472385723456792345", - conventions.AttributeHostName: "my-gke-node-1234", }), }, { @@ -66,7 +64,6 @@ func TestDetect(t *testing.T) { projectID: "my-project", cloudPlatform: gcp.GKE, gkeHostID: "1472385723456792345", - gkeHostName: "my-gke-node-1234", gkeClusterName: "my-cluster", gkeRegion: "us-central1", }}, @@ -77,7 +74,6 @@ func TestDetect(t *testing.T) { conventions.AttributeK8SClusterName: "my-cluster", conventions.AttributeCloudRegion: "us-central1", conventions.AttributeHostID: "1472385723456792345", - conventions.AttributeHostName: "my-gke-node-1234", }), }, { @@ -210,7 +206,6 @@ type fakeGCPDetector struct { gkeRegion string gkeClusterName string gkeHostID string - gkeHostName string faaSName string faaSVersion string faaSID string @@ -262,13 +257,6 @@ func (f *fakeGCPDetector) GKEHostID() (string, error) { return f.gkeHostID, nil } -func (f *fakeGCPDetector) GKEHostName() (string, error) { - if f.err != nil { - return "", f.err - } - return f.gkeHostName, nil -} - func (f *fakeGCPDetector) FaaSName() (string, error) { if f.err != nil { return "", f.err diff --git a/processor/resourcedetectionprocessor/internal/gcp/types.go b/processor/resourcedetectionprocessor/internal/gcp/types.go index 4f55402f8e122..8a6f5cd4bef91 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/types.go +++ b/processor/resourcedetectionprocessor/internal/gcp/types.go @@ -26,7 +26,6 @@ type gcpDetector interface { GKEAvailabilityZoneOrRegion() (string, gcp.LocationType, error) GKEClusterName() (string, error) GKEHostID() (string, error) - GKEHostName() (string, error) FaaSName() (string, error) FaaSVersion() (string, error) FaaSID() (string, error)