Skip to content

Support adding custom labels to instrumented Pods #4445

@oncipriani

Description

@oncipriani

Component(s)

auto-instrumentation

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

We need to identify all Pods that were auto-instrumented by the OpenTelemetry Operator.

Describe the solution you'd like

If during the instrumentation injection process a custom label was added to the Pod metadata, this would be trivial.

Suggestion:

apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
  name: my-instrumentation
spec:
  podMetadata:
    labels:
      custom-label-key: custom-label-value
  sampler:
    argument: "0.01"
    type: parentbased_traceidratio

Even a non-configurable static label like instrumentation.opentelemetry.io/injected: "true" or instrumentation.opentelemetry.io/name: "namespace/name of the injected instrumentation" would be of great value to us.

Describe alternatives you've considered

I tried selecting Pods with any of the instrumentation.opentelemetry.io/inject-* annotations, but labels are easier to filter by.

Also, having a single label to consider is much simpler and faster than checking for all the possible instrumentation.opentelemetry.io/inject-* annotations.

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions