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 IsInt Converter #27894

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

[pkg/ottl] Add IsInt Converter #27894

TylerHelmuth opened this issue Oct 20, 2023 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed pkg/ottl

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 int type.

Describe the solution you'd like

Add a new Converter, IsInt that returns true if the given type is a int (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 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 just match on any of the built-in int types and pcommon.ValueTypeInt? Or could it include values like 2.0 and "2"?

Also, maybe an IsNumber/IsNumeric function is helpful for when it's unclear if instrumentation emits integers or doubles

@lazyplatypus
Copy link

i'm interested in working on this issue :)

@codeboten
Copy link
Contributor

Thanks @lazyplatypus, its all yours!

@TylerHelmuth TylerHelmuth added help wanted Extra attention is needed good first issue Good for newcomers and removed Contribfest assigned 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.

@github-actions github-actions bot added the Stale label Feb 12, 2024
evan-bradley pushed a commit that referenced this issue Feb 25, 2024
**Description:** <Describe what has changed.>
Adds a new `IsInt` function to facilitate type checking. 

**Link to tracking Issue:** #27894 

**Testing:**  Added unit test

**Documentation:**  Updated the func readme.

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
@lkwronski
Copy link
Contributor

It can be closed because the #31307 was merged.

XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this issue Mar 13, 2024
**Description:** <Describe what has changed.>
Adds a new `IsInt` function to facilitate type checking. 

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

**Testing:**  Added unit test

**Documentation:**  Updated the func readme.

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed pkg/ottl
Projects
None yet
Development

No branches or pull requests

5 participants