Skip to content

[pkg/ottl] Add a new ottl function Keys #39256

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

Merged
merged 14 commits into from
Jul 1, 2025

Conversation

jaysonsantos
Copy link
Contributor

@jaysonsantos jaysonsantos commented Apr 8, 2025

Description

This adds a new ottl function called Keys

The idea here is because, I have a use case to debug traces being sent to newrelic where some spans are being dropped because of the attribute's names (and they don't specify which). The final idea is to be able to filter out attributes that are bigger than the threshold specified by them and send to a log or something.
A next step would be some sort of filter function like Filter(Keys(resource.attributes), Len(key) > 100)


An ugly implementation of the fiter can be seen here main...jaysonsantos:opentelemetry-collector-contrib:ottl-add-filter-function

@github-actions github-actions bot requested a review from kentquirk April 8, 2025 14:50
@jaysonsantos jaysonsantos force-pushed the ottl-add-keys-function branch from 9f3ae35 to b6ad3b8 Compare April 8, 2025 14:56
@jaysonsantos jaysonsantos changed the title Add a new ottl function Keys [chore] Add a new ottl function Keys Apr 8, 2025
@jaysonsantos jaysonsantos force-pushed the ottl-add-keys-function branch 5 times, most recently from 0ae2462 to fa791ee Compare April 8, 2025 20:10
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

Copy link
Contributor

@edmocosta edmocosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for you contribution, @jaysonsantos. I've left a few comments for your consideration. We also gonna need a change log for this PR.

@jaysonsantos
Copy link
Contributor Author

@edmocosta i did the requested changed, just left two other questions.
Also, should I rebase with main now or wait until you are done with the review?

@edmocosta
Copy link
Contributor

Also, should I rebase with main now or wait until you are done with the review?

Please rebase, so we can trigger the CI. Thanks!

@jaysonsantos jaysonsantos force-pushed the ottl-add-keys-function branch from 1035d7a to d9e806e Compare May 6, 2025 16:52
Copy link
Contributor

github-actions bot commented Jun 6, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 6, 2025
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Jun 20, 2025
@jaysonsantos
Copy link
Contributor Author

@atoulme the changes were addressed but the ci timed out

@edmocosta edmocosta reopened this Jun 23, 2025
Copy link
Contributor

@edmocosta edmocosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edmocosta edmocosta changed the title [chore] Add a new ottl function Keys [pkg/ottl] Add a new ottl function Keys Jun 23, 2025
@edmocosta edmocosta removed the Stale label Jun 23, 2025
@jaysonsantos
Copy link
Contributor Author

@edmocosta done

@jaysonsantos
Copy link
Contributor Author

@edmocosta i have another branch with the function values, should i get the learnings from this, apply, and tag you or let the system choose?

@jaysonsantos jaysonsantos marked this pull request as ready for review June 23, 2025 10:00
@edmocosta
Copy link
Contributor

@edmocosta i have another branch with the function values, should i get the learnings from this, apply, and tag you or let the system choose?

Hi @jaysonsantos, we normally prefer to discuss new functions/converters through issues, it ensures the function is aligned with OTTL requirements/guidelines, and also avoid folks spending their time writing code that might not get accepted at the end. That said, ideally, raising an issue would be the next step for that values function you're proposing :)

@jaysonsantos
Copy link
Contributor Author

hi @edmocosta the label says it depends on me but. think it is all set, right?

@edmocosta
Copy link
Contributor

hi @edmocosta the label says it depends on me but. think it is all set, right?

I'm sorry, I forgot to remove the label. @evan-bradley @TylerHelmuth could you please take a look at this? Thanks!

@evan-bradley evan-bradley merged commit d9f8d4d into open-telemetry:main Jul 1, 2025
195 of 196 checks passed
@github-actions github-actions bot added this to the next release milestone Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants