-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/transform] Not able to drop attributes using this processor #34038
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
From what I can tell the |
Hi! When using the
This way you do not have to use an array of expressions, which is not supported by the |
I did some further checking, and recognized that when using
Regarding One more note: I just checked, and the |
Many thanks @crobert-1 , @bacherfl for your inputs. I have a few following questions:
|
Hi @vaibhhavv, I can also answer a few of your questions. First, note that you can use multiple different contexts within the same transform processor configuration, you're not limited to only a single context. For your specific questions:
Here's a sample config to illustrate the above points: trace_statements:
- context: resource
statements:
- keep_matching_keys(attributes, "^(aaa|bbb|ccc).*")
- context: span
statements:
- keep_matching_keys(attributes, "(^xyz.pqr$)|(^(aaa|bbb|ccc).*)")
- context: spanevent
statements:
- delete_key(attributes, "message") |
Thanks @evan-bradley for your input here. I got what I was looking for. ❤️ |
Component(s)
processor/transform
What happened?
Description
I am utilising transform processor and receiving traces on my otel collector.
Use case is I want to drop all other attributes (both span & resource attributes) coming in that traces except few whose initials start with 'aaa.' , 'bbb.', 'ccc.'.
I configured the transform processor but it is not behaving according to the expectation. It is not dropping any attribute.
Steps to Reproduce
Expected Result
All attributes should get dropped except the ones which starts with 'aaa.' , 'bbb.' , 'ccc.'
Actual Result
No attributes are getting dropped
Collector version
0.102.1
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: