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 IsDouble Converter #27895

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

[pkg/ottl] Add IsDouble Converter #27895

TylerHelmuth opened this issue Oct 20, 2023 · 4 comments
Assignees
Labels

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 an double type.

Describe the solution you'd like

Add a new Converter, IsDouble that returns true if the given type is a double (or equivalent type). It will work similarly to the IsString 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
@TylerHelmuth TylerHelmuth added enhancement New feature or request needs triage New item requiring triage help wanted Extra attention is needed good first issue Good for newcomers priority:p2 Medium pkg/ottl Contribfest and removed needs triage New item requiring triage help wanted Extra attention is needed good first issue Good for newcomers labels Oct 20, 2023
@swar8080
Copy link
Contributor

Would this match on integers or doubles in string form like "2.0"?

@etiennep
Copy link
Contributor

etiennep commented Nov 8, 2023

I'm interested in working on this.

@codeboten
Copy link
Contributor

All yours @etiennep, thanks!

TylerHelmuth added a commit that referenced this issue Nov 16, 2023
**Description:** Adds new a new `IsDouble` function to facilitate type
checking. Most useful when checking the type of a body to determine if
it needs to be parsed or not.

**Link to tracking Issue:**
#27895

**Testing:** Added unit test

**Documentation:** Updated the func readme.

Co-authored-by: Tyler Helmuth <[email protected]>
graphaelli pushed a commit to graphaelli/opentelemetry-collector-contrib that referenced this issue Nov 17, 2023
**Description:** Adds new a new `IsDouble` function to facilitate type
checking. Most useful when checking the type of a body to determine if
it needs to be parsed or not.

**Link to tracking Issue:**
open-telemetry#27895

**Testing:** Added unit test

**Documentation:** Updated the func readme.

Co-authored-by: Tyler Helmuth <[email protected]>
RoryCrispin pushed a commit to ClickHouse/opentelemetry-collector-contrib that referenced this issue Nov 24, 2023
**Description:** Adds new a new `IsDouble` function to facilitate type
checking. Most useful when checking the type of a body to determine if
it needs to be parsed or not.

**Link to tracking Issue:**
open-telemetry#27895

**Testing:** Added unit test

**Documentation:** Updated the func readme.

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

anything left here now that #29076 is merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants