-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[pkg/ottl] Set method should allow dynamically setting map values to attributes #14946
Comments
I can think of two ways to handle this situation:
I would opt for the second because I like the flexibility that Factory Functions provide. I prefer putting business logic in the function vs the contexts. @bogdandrutu @kentquirk @evan-bradley what do you think? |
I agree, I think a function would be better for this sort of operation. In addition to keeping business logic out of the contexts I think it also provides a good pattern for doing other types of matching (regex, filtering, etc.), and makes it more explicit what is going on. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Is your feature request related to a problem? Please describe.
While using transform processor, we tried setting set kubernetes labels to a single attribute 'labels' in a body as below.
But Set method doesn't iterate through the map of values & instead needs all keys in array to be explicitly mentioned like below-
set(attributes["kubernetes.labels"], resource.attributes["pod_labels_app"])
Kubernetes labels is something dynamic things & we can't explicitly mention label name in OTEL processor rules.
Describe the solution you'd like
Set method in here should allow iterate through the map & fetch all values so that we can perform something like this-
set(attributes["kubernetes.labels"], resource.attributes["pod_labels_*"])
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: