opentelemetry-collector-contrib
opentelemetry-collector-contrib copied to clipboard
[pkg/ottl] Add `IsInt` Converter
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
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
i'm interested in working on this issue :)
Thanks @lazyplatypus, its all yours!
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:
- pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley
See Adding Labels via Comments if you do not have permissions to add labels yourself.
It can be closed because the #31307 was merged.