Skip to content

[processor/k8sattributes]: fix otel annotations attribute priority#46849

Open
davidspek wants to merge 1 commit intoopen-telemetry:mainfrom
davidspek:fix/k8s-attributes-otel-annotation
Open

[processor/k8sattributes]: fix otel annotations attribute priority#46849
davidspek wants to merge 1 commit intoopen-telemetry:mainfrom
davidspek:fix/k8s-attributes-otel-annotation

Conversation

@davidspek
Copy link

Description

According to the semconv, the resource.opentelemetry.io/* pod annotations should have the highest priority for configuring the service.namespace, service.name, service.version and service.instance.id attributes. However, in the current logic the values from the well-known labels will override the ones coming from the resource.opentelemetry.io/* pod annotations. This PR fixes this and includes unit tests to ensure the pod annotations will have the highest priority.

Link to tracking issue

Fixes

Testing

Added unit tests to ensure the otel attributes have higher priority than the well-known labels.

Documentation

@github-actions github-actions bot added the first-time contributor PRs made by new contributors label Mar 11, 2026
@github-actions
Copy link
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@github-actions github-actions bot added the processor/k8sattributes k8s Attributes processor label Mar 11, 2026
@github-actions github-actions bot requested a review from odubajDT March 11, 2026 15:14
@davidspek davidspek force-pushed the fix/k8s-attributes-otel-annotation branch 2 times, most recently from 20b1b15 to eda5fa0 Compare March 11, 2026 15:43
Signed-off-by: David van der Spek <david.vanderspek@flyrlabs.com>
@davidspek davidspek force-pushed the fix/k8s-attributes-otel-annotation branch from eda5fa0 to 1b6d1cb Compare March 11, 2026 16:38
@paulojmdias
Copy link
Member

/workflow-approve

@paulojmdias
Copy link
Member

Please add a changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor PRs made by new contributors processor/k8sattributes k8s Attributes processor waiting-for-code-owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants