Skip to content

Commit 3c1a6dd

Browse files
Remove resource/k8s processor and use k8sattributes processor for service attributes (#8599) (#8653)
* Remove resource/k8s processor and use k8sattributes processor for service attributes * remove k8s labels extraction * update changelog --------- (cherry picked from commit b2aa165) Signed-off-by: ChrsMark <[email protected]> Co-authored-by: Christos Markou <[email protected]>
1 parent 900860c commit 3c1a6dd

File tree

2 files changed

+44
-49
lines changed

2 files changed

+44
-49
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: feature
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Remove resource/k8s processor and use k8sattributes processor for service attributes
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
description: |
20+
This PR removes the `resource/k8s` processor in honour of the k8sattributes processor that
21+
provides native support for the Service attributes:
22+
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.127.0/processor/k8sattributesprocessor#configuring-recommended-resource-attributes
23+
24+
This change is aligned with the respective Semantic Conventions' guidance:
25+
https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes
26+
27+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
28+
component: elastic-agent
29+
30+
# PR URL; optional; the PR number that added the changeset.
31+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
32+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
33+
# Please provide it if you are adding a fragment for a different PR.
34+
pr: https://github.com/elastic/elastic-agent/pull/8599
35+
36+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
37+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
38+
#issue: https://github.com/owner/repo/1234

deploy/helm/edot-collector/kube-stack/values.yaml

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ collectors:
6969
resource_attributes:
7070
k8s.cluster.name:
7171
enabled: true
72-
# [Resource Processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor)
73-
resource/k8s: # Resource attributes tailored for services within Kubernetes.
74-
attributes:
75-
- key: service.name # Set the service.name resource attribute based on the well-known app.kubernetes.io/name label
76-
from_attribute: app.label.name
77-
action: insert
78-
- key: service.name # Set the service.name resource attribute based on the k8s.container.name attribute
79-
from_attribute: k8s.container.name
80-
action: insert
81-
- key: app.label.name # Delete app.label.name attribute previously used for service.name
82-
action: delete
83-
- key: service.version # Set the service.version resource attribute based on the well-known app.kubernetes.io/version label
84-
from_attribute: app.label.version
85-
action: insert
86-
- key: app.label.version # Delete app.label.version attribute previously used for service.version
87-
action: delete
8872
resource/hostname:
8973
attributes:
9074
- key: host.name
@@ -117,13 +101,9 @@ collectors:
117101
- "k8s.pod.ip"
118102
- "k8s.pod.uid"
119103
- "k8s.pod.start_time"
120-
labels:
121-
- tag_name: app.label.name
122-
key: app.kubernetes.io/name
123-
from: pod
124-
- tag_name: app.label.version
125-
key: app.kubernetes.io/version
126-
from: pod
104+
# Service attributes added based on https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes
105+
- "service.name"
106+
- "service.version"
127107
receivers:
128108
# [K8s Objects Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/k8sobjectsreceiver)
129109
k8sobjects:
@@ -166,7 +146,6 @@ collectors:
166146
- resourcedetection/eks
167147
- resourcedetection/gcp
168148
- resourcedetection/aks
169-
- resource/k8s
170149
- resource/hostname
171150
receivers:
172151
- k8s_cluster
@@ -280,22 +259,6 @@ collectors:
280259
enabled: false
281260
host.id:
282261
enabled: true
283-
# [Resource Processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor)
284-
resource/k8s: # Resource attributes tailored for services within Kubernetes.
285-
attributes:
286-
- key: service.name # Set the service.name resource attribute based on the well-known app.kubernetes.io/name label
287-
from_attribute: app.label.name
288-
action: insert
289-
- key: service.name # Set the service.name resource attribute based on the k8s.container.name attribute
290-
from_attribute: k8s.container.name
291-
action: insert
292-
- key: app.label.name # Delete app.label.name attribute previously used for service.name
293-
action: delete
294-
- key: service.version # Set the service.version resource attribute based on the well-known app.kubernetes.io/version label
295-
from_attribute: app.label.version
296-
action: insert
297-
- key: app.label.version # Delete app.label.version attribute previously used for service.version
298-
action: delete
299262
resource/cloud:
300263
attributes:
301264
- key: cloud.instance.id
@@ -331,13 +294,9 @@ collectors:
331294
- "k8s.pod.ip"
332295
- "k8s.pod.uid"
333296
- "k8s.pod.start_time"
334-
labels:
335-
- tag_name: app.label.name
336-
key: app.kubernetes.io/name
337-
from: pod
338-
- tag_name: app.label.version
339-
key: app.kubernetes.io/version
340-
from: pod
297+
# Service attributes added based on https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes
298+
- "service.name"
299+
- "service.version"
341300
receivers:
342301
# [OTLP Receiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver)
343302
otlp:
@@ -478,7 +437,6 @@ collectors:
478437
- resourcedetection/eks
479438
- resourcedetection/gcp
480439
- resourcedetection/aks
481-
- resource/k8s
482440
- resource/hostname
483441
- resource/cloud
484442
exporters:
@@ -494,7 +452,6 @@ collectors:
494452
- resourcedetection/eks
495453
- resourcedetection/gcp
496454
- resourcedetection/aks
497-
- resource/k8s
498455
- resource/hostname
499456
- resource/cloud
500457
exporters:

0 commit comments

Comments
 (0)