Skip to content

[pkg/ottl] Accept dynamic lists in keep_keys #40440

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

Open
francois07 opened this issue Jun 3, 2025 · 3 comments
Open

[pkg/ottl] Accept dynamic lists in keep_keys #40440

francois07 opened this issue Jun 3, 2025 · 3 comments
Labels
enhancement New feature or request pkg/ottl

Comments

@francois07
Copy link

francois07 commented Jun 3, 2025

Component(s)

pkg/ottl

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

When using keep_keys, It would be very convenient to be able to pass it a dynamic list of keys to keep. For example to filter datapoint labels dynamically based on a resource attribute.

Describe the solution you'd like

Make it possible for keep_keys to accept a dynamic list of keys, for example keep_key(datapoint.attributes, resource.attributes["labels"])

Describe alternatives you've considered

No response

Additional context

PSliceGetter from #40193 would be useful here

@francois07 francois07 added enhancement New feature or request needs triage New item requiring triage labels Jun 3, 2025
Copy link
Contributor

github-actions bot commented Jun 3, 2025

Pinging code owners:

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

@edmocosta
Copy link
Contributor

edmocosta commented Jun 3, 2025

Hi @francois07! Thanks for filling this issue. I support adding this functionality, but I'd do that only after getting #40222 done, so we can implement it without introducing a performance regression.

@edmocosta edmocosta removed the needs triage New item requiring triage label Jun 3, 2025
@francois07
Copy link
Author

Hi @francois07! Thanks for filling this issue. I support adding this functionality, but I'd do that only after getting #40222 done, so we can implement it without introducing a performance regression.

I agree, I did some tests on my side and came to the same conclusion, I didn't know #40222 existed ! In fact I think it would make sense for most functions to accept dynamic values once it's implemented. I'll wait for it to be done and do a pull request then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg/ottl
Projects
None yet
Development

No branches or pull requests

2 participants