open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.78k stars 2.19k forks source link

Copy multiple attributes/labels in k8sattributes #34040

Open zeitlinger opened 2 weeks ago

zeitlinger commented 2 weeks ago

Component(s)

processor/k8sattributes

Is your feature request related to a problem? Please describe.

As a user, I'd like to add my resource attributes as k8s attributes/labels in a generic way:

opentelemetry.io/resource.deployment.environment should become deployment.environment and so on

Describe the solution you'd like

similar to to the existing regex: field=(?P<value>.+) syntax

k8sattributes:
  auth_type: "serviceAccount"
  passthrough: false
  extract:
   labels:
     - key_regex: opentelemetry.io/resource.(?P<key>.+)
       from: pod

Describe alternatives you've considered

No response

Additional context

No response

github-actions[bot] commented 2 weeks ago

Pinging code owners: