diff --git a/changelog/fragments/1750408426-kube-stack-service-attrs.yaml b/changelog/fragments/1750408426-kube-stack-service-attrs.yaml new file mode 100644 index 00000000000..4ce7224f942 --- /dev/null +++ b/changelog/fragments/1750408426-kube-stack-service-attrs.yaml @@ -0,0 +1,38 @@ +# Kind can be one of: +# - breaking-change: a change to previously-documented behavior +# - deprecation: functionality that is being removed in a later release +# - bug-fix: fixes a problem in a previous version +# - enhancement: extends functionality but does not break or fix existing behavior +# - feature: new functionality +# - known-issue: problems that we are aware of in a given version +# - security: impacts on the security of a product or a user’s deployment. +# - upgrade: important information for someone upgrading from a prior version +# - other: does not fit into any of the other categories +kind: feature + +# Change summary; a 80ish characters long description of the change. +summary: Remove resource/k8s processor and use k8sattributes processor for service attributes + +# Long description; in case the summary is not enough to describe the change +# this field accommodate a description without length limits. +# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. +description: | + This PR removes the `resource/k8s` processor in honour of the k8sattributes processor that + provides native support for the Service attributes: + https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.127.0/processor/k8sattributesprocessor#configuring-recommended-resource-attributes + + This change is aligned with the respective Semantic Conventions' guidance: + https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes + +# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc. +component: elastic-agent + +# PR URL; optional; the PR number that added the changeset. +# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. +# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. +# Please provide it if you are adding a fragment for a different PR. +pr: https://github.com/elastic/elastic-agent/pull/8599 + +# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). +# If not present is automatically filled by the tooling with the issue linked to the PR number. +#issue: https://github.com/owner/repo/1234 diff --git a/deploy/helm/edot-collector/kube-stack/values.yaml b/deploy/helm/edot-collector/kube-stack/values.yaml index 572339de267..e605a006ea8 100644 --- a/deploy/helm/edot-collector/kube-stack/values.yaml +++ b/deploy/helm/edot-collector/kube-stack/values.yaml @@ -69,22 +69,6 @@ collectors: resource_attributes: k8s.cluster.name: enabled: true - # [Resource Processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor) - resource/k8s: # Resource attributes tailored for services within Kubernetes. - attributes: - - key: service.name # Set the service.name resource attribute based on the well-known app.kubernetes.io/name label - from_attribute: app.label.name - action: insert - - key: service.name # Set the service.name resource attribute based on the k8s.container.name attribute - from_attribute: k8s.container.name - action: insert - - key: app.label.name # Delete app.label.name attribute previously used for service.name - action: delete - - key: service.version # Set the service.version resource attribute based on the well-known app.kubernetes.io/version label - from_attribute: app.label.version - action: insert - - key: app.label.version # Delete app.label.version attribute previously used for service.version - action: delete resource/hostname: attributes: - key: host.name @@ -117,13 +101,9 @@ collectors: - "k8s.pod.ip" - "k8s.pod.uid" - "k8s.pod.start_time" - labels: - - tag_name: app.label.name - key: app.kubernetes.io/name - from: pod - - tag_name: app.label.version - key: app.kubernetes.io/version - from: pod + # Service attributes added based on https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes + - "service.name" + - "service.version" receivers: # [K8s Objects Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/k8sobjectsreceiver) k8sobjects: @@ -166,7 +146,6 @@ collectors: - resourcedetection/eks - resourcedetection/gcp - resourcedetection/aks - - resource/k8s - resource/hostname receivers: - k8s_cluster @@ -280,22 +259,6 @@ collectors: enabled: false host.id: enabled: true - # [Resource Processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor) - resource/k8s: # Resource attributes tailored for services within Kubernetes. - attributes: - - key: service.name # Set the service.name resource attribute based on the well-known app.kubernetes.io/name label - from_attribute: app.label.name - action: insert - - key: service.name # Set the service.name resource attribute based on the k8s.container.name attribute - from_attribute: k8s.container.name - action: insert - - key: app.label.name # Delete app.label.name attribute previously used for service.name - action: delete - - key: service.version # Set the service.version resource attribute based on the well-known app.kubernetes.io/version label - from_attribute: app.label.version - action: insert - - key: app.label.version # Delete app.label.version attribute previously used for service.version - action: delete resource/cloud: attributes: - key: cloud.instance.id @@ -331,13 +294,9 @@ collectors: - "k8s.pod.ip" - "k8s.pod.uid" - "k8s.pod.start_time" - labels: - - tag_name: app.label.name - key: app.kubernetes.io/name - from: pod - - tag_name: app.label.version - key: app.kubernetes.io/version - from: pod + # Service attributes added based on https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes + - "service.name" + - "service.version" receivers: # [OTLP Receiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver) otlp: @@ -479,7 +438,6 @@ collectors: - resourcedetection/eks - resourcedetection/gcp - resourcedetection/aks - - resource/k8s - resource/hostname - resource/cloud exporters: @@ -495,7 +453,6 @@ collectors: - resourcedetection/eks - resourcedetection/gcp - resourcedetection/aks - - resource/k8s - resource/hostname - resource/cloud exporters: