open-telemetry / opentelemetry-collector-contrib

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

support include/exclude filtering for the resource processor #35949

Open kosamson opened 3 hours ago

kosamson commented 3 hours ago

Component(s)

processor/resource

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

While signals can be included/excluded from the attributes processor, there is no similar option in the resource processor. This can be inconvenient at times if there are some signals that need to have their resource attributes updated, but other signals that need to preserve their original resource attributes.

Describe the solution you'd like

It would be nice if the resource processor config allowed using include/exclude matching from the attributes processor.

Describe alternatives you've considered

A workaround to this is by configuring one signal pipeline which includes the resource processor, and another pipeline which does not include the resource processor. The signals that need resource attribute processing would be ingested from one receiver, and those that do not need it from a different receiver.

This causes some duplicated configuration and requires a client-side change (which sends data to the collector) to use a different receiver port, which is not ideal,

See the below example:

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
  otlp/modifiedresource:
    protocols:
      grpc:
        endpoint: 0.0.0.0:14317
processors:
  attributes:
    actions:
      - key: environment
        value: production
        action: insert
  resource:
    attributes:
      - key: cloud.zone
        value: zone-1
        action: upsert
exporters:
  otlp:
    endpoint: otelcol:4317
service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [attributes]
      exporters: [otlp]
    traces/modifiedresource:
      receivers: [otlp/modifiedresource]
      processors: [attributes, resource]
      exporters: [otlp]

Additional context

No response

github-actions[bot] commented 3 hours ago

Pinging code owners: