Skip to content
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] Add IsList Converter #27870

Closed
4 tasks
TylerHelmuth opened this issue Oct 20, 2023 · 8 comments
Closed
4 tasks

[pkg/ottl] Add IsList Converter #27870

TylerHelmuth opened this issue Oct 20, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request pkg/ottl priority:p2 Medium

Comments

@TylerHelmuth
Copy link
Member

TylerHelmuth commented Oct 20, 2023

Component(s)

pkg/ottl

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

OTTL has no way to check if a value is a pcommon.Slice type.

Describe the solution you'd like

Add a new Converter, IsList that returns true if the given type is a pcommon.Slice (or equivalent type). It will work similarly to the IsMap function.

The implementing PR should

  • Implement the function
  • Add new unit tests for the function
  • Add the function to pkg/ottl/ottlfuncs/functions.go
  • Update the README at pkg/ottl/ottlfuncs/README.md

Implementing this function will mean introducing a new PSliceGetter interface, similar to the PMapGetter interface. If the type is a slice but cannot be converted to a pcommon.Slice, then an error should be returned.

@strawgate
Copy link
Contributor

I'd like to do this one at contribfest!

@codeboten
Copy link
Contributor

Thanks @strawgate!

@TylerHelmuth TylerHelmuth added help wanted Extra attention is needed good first issue Good for newcomers and removed help wanted Extra attention is needed good first issue Good for newcomers labels Dec 13, 2023
Copy link
Contributor

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 @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

Copy link
Contributor

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 @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

@evan-bradley
Copy link
Contributor

@strawgate Just checking in, are you still able to work on this?

@strawgate
Copy link
Contributor

@evan-bradley sorry, was on partial leave for a little bit. I'll pick this up this week!

@strawgate
Copy link
Contributor

Re-opened PR at #32392

dmitryax pushed a commit that referenced this issue Apr 17, 2024
Description:
Add isList OTTL function that returns true if the target is a slice and
returns false if it is not

Link to tracking Issue:
#27870

Testing: Added tests

Documentation: Updated readme and added changelog entry

---------

Co-authored-by: Tyler Helmuth <[email protected]>
@strawgate
Copy link
Contributor

The pr has been merged so I think this can be closed!

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 priority:p2 Medium
Projects
None yet
Development

No branches or pull requests

4 participants