Skip to content

support include/exclude filtering for the resource processor #35949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kosamson opened this issue Oct 23, 2024 · 3 comments
Closed

support include/exclude filtering for the resource processor #35949

kosamson opened this issue Oct 23, 2024 · 3 comments
Labels
enhancement New feature or request priority:p2 Medium processor/resource Resource processor

Comments

@kosamson
Copy link

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

@kosamson kosamson added enhancement New feature or request needs triage New item requiring triage labels Oct 23, 2024
@github-actions github-actions bot added the processor/resource Resource processor label Oct 23, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@TylerHelmuth TylerHelmuth added priority:p2 Medium and removed needs triage New item requiring triage labels Nov 1, 2024
@atoulme
Copy link
Contributor

atoulme commented Nov 1, 2024

The resource processor works at the resource level, and the include/exclude is going to apply at the span or metric level. You can't really apply those things together.

An example is to use the services include filter, which is going to add an attribute based on the span service.name attribute. That doesn't work well unless all your spans have the same service name.

Workaround: use the attributes processor, and apply groupbyattrs processor to group batches back together and move attributes to the resource.

@kosamson
Copy link
Author

kosamson commented Nov 2, 2024

The resource processor works at the resource level, and the include/exclude is going to apply at the span or metric level. You can't really apply those things together.

An example is to use the services include filter, which is going to add an attribute based on the span service.name attribute. That doesn't work well unless all your spans have the same service name.

Workaround: use the attributes processor, and apply groupbyattrs processor to group batches back together and move attributes to the resource.

Understood, I think I need to read up a bit more on how OpenTelemetry resources work in the official docs. I will also give the workaround a try. Thank you for the help!

@kosamson kosamson closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:p2 Medium processor/resource Resource processor
Projects
None yet
Development

No branches or pull requests

3 participants