Skip to content

[processor/resourcedetection] Add back host.name on GKE #12355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions processor/resourcedetectionprocessor/internal/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ 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.GCEHostName)
case gcp.CloudRun:
b.attrs.InsertString(conventions.AttributeCloudPlatform, conventions.AttributeCloudPlatformGCPCloudRun)
b.add(conventions.AttributeFaaSName, d.detector.FaaSName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestDetect(t *testing.T) {
detector: &detector{detector: &fakeGCPDetector{
projectID: "my-project",
cloudPlatform: gcp.GKE,
gceHostName: "my-gke-node-1234",
gkeHostID: "1472385723456792345",
gkeClusterName: "my-cluster",
gkeAvailabilityZone: "us-central1-c",
Expand All @@ -54,13 +55,15 @@ func TestDetect(t *testing.T) {
conventions.AttributeK8SClusterName: "my-cluster",
conventions.AttributeCloudAvailabilityZone: "us-central1-c",
conventions.AttributeHostID: "1472385723456792345",
conventions.AttributeHostName: "my-gke-node-1234",
}),
},
{
desc: "regional GKE cluster",
detector: &detector{detector: &fakeGCPDetector{
projectID: "my-project",
cloudPlatform: gcp.GKE,
gceHostName: "my-gke-node-1234",
gkeHostID: "1472385723456792345",
gkeClusterName: "my-cluster",
gkeRegion: "us-central1",
Expand All @@ -72,6 +75,7 @@ func TestDetect(t *testing.T) {
conventions.AttributeK8SClusterName: "my-cluster",
conventions.AttributeCloudRegion: "us-central1",
conventions.AttributeHostID: "1472385723456792345",
conventions.AttributeHostName: "my-gke-node-1234",
}),
},
{
Expand Down
16 changes: 16 additions & 0 deletions unreleased/mx-psi_gke-detector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: resourcedetectionprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add back `host.name` attribute when running on GKE

# One or more tracking issues related to the change
issues: [12354]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: