Skip to content

Commit 395d0da

Browse files
authored
remove resource/k8s processor and use k8sattributes processor for service attributes (#10108)
1 parent 2c23284 commit 395d0da

File tree

2 files changed

+43
-49
lines changed

2 files changed

+43
-49
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 mOTEL 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+
This change is aligned with the respective Semantic Conventions' guidance:
24+
https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes
25+
26+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
27+
component: elastic-agent
28+
29+
# PR URL; optional; the PR number that added the changeset.
30+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
31+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
32+
# Please provide it if you are adding a fragment for a different PR.
33+
#pr: https://github.com/owner/repo/1234
34+
35+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
36+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
37+
#issue: https://github.com/owner/repo/1234

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

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,6 @@ collectors:
7373
resource_attributes:
7474
k8s.cluster.name:
7575
enabled: true
76-
# [Resource Processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor)
77-
resource/k8s: # Resource attributes tailored for services within Kubernetes.
78-
attributes:
79-
- key: service.name # Set the service.name resource attribute based on the well-known app.kubernetes.io/name label
80-
from_attribute: app.label.name
81-
action: insert
82-
- key: service.name # Set the service.name resource attribute based on the k8s.container.name attribute
83-
from_attribute: k8s.container.name
84-
action: insert
85-
- key: app.label.name # Delete app.label.name attribute previously used for service.name
86-
action: delete
87-
- key: service.version # Set the service.version resource attribute based on the well-known app.kubernetes.io/version label
88-
from_attribute: app.label.version
89-
action: insert
90-
- key: app.label.version # Delete app.label.version attribute previously used for service.version
91-
action: delete
9276
resource/hostname:
9377
attributes:
9478
- key: host.name
@@ -121,13 +105,9 @@ collectors:
121105
- "k8s.pod.ip"
122106
- "k8s.pod.uid"
123107
- "k8s.pod.start_time"
124-
labels:
125-
- tag_name: app.label.name
126-
key: app.kubernetes.io/name
127-
from: pod
128-
- tag_name: app.label.version
129-
key: app.kubernetes.io/version
130-
from: pod
108+
# Service attributes added based on https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes
109+
- "service.name"
110+
- "service.version"
131111
receivers:
132112
# [K8s Objects Receiver](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/k8sobjectsreceiver)
133113
k8sobjects:
@@ -171,7 +151,6 @@ collectors:
171151
- resourcedetection/eks
172152
- resourcedetection/gcp
173153
- resourcedetection/aks
174-
- resource/k8s
175154
- resource/hostname
176155
receivers:
177156
- k8s_cluster
@@ -290,22 +269,6 @@ collectors:
290269
enabled: false
291270
host.id:
292271
enabled: true
293-
# [Resource Processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourceprocessor)
294-
resource/k8s: # Resource attributes tailored for services within Kubernetes.
295-
attributes:
296-
- key: service.name # Set the service.name resource attribute based on the well-known app.kubernetes.io/name label
297-
from_attribute: app.label.name
298-
action: insert
299-
- key: service.name # Set the service.name resource attribute based on the k8s.container.name attribute
300-
from_attribute: k8s.container.name
301-
action: insert
302-
- key: app.label.name # Delete app.label.name attribute previously used for service.name
303-
action: delete
304-
- key: service.version # Set the service.version resource attribute based on the well-known app.kubernetes.io/version label
305-
from_attribute: app.label.version
306-
action: insert
307-
- key: app.label.version # Delete app.label.version attribute previously used for service.version
308-
action: delete
309272
resource/cloud:
310273
attributes:
311274
- key: cloud.instance.id
@@ -341,13 +304,9 @@ collectors:
341304
- "k8s.pod.ip"
342305
- "k8s.pod.uid"
343306
- "k8s.pod.start_time"
344-
labels:
345-
- tag_name: app.label.name
346-
key: app.kubernetes.io/name
347-
from: pod
348-
- tag_name: app.label.version
349-
key: app.kubernetes.io/version
350-
from: pod
307+
# Service attributes added based on https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/#service-attributes
308+
- "service.name"
309+
- "service.version"
351310
receivers:
352311
# [OTLP Receiver](https://github.com/open-telemetry/opentelemetry-collector/tree/main/receiver/otlpreceiver)
353312
otlp:
@@ -493,7 +452,6 @@ collectors:
493452
- resourcedetection/eks
494453
- resourcedetection/gcp
495454
- resourcedetection/aks
496-
- resource/k8s
497455
- resource/hostname
498456
- resource/cloud
499457
exporters:
@@ -509,7 +467,6 @@ collectors:
509467
- resourcedetection/eks
510468
- resourcedetection/gcp
511469
- resourcedetection/aks
512-
- resource/k8s
513470
- resource/hostname
514471
- resource/cloud
515472
exporters:

0 commit comments

Comments
 (0)