You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to documentationIsMatch should return false for non-atomic types:
The function matches the target against the pattern, returning true if the match is successful and false otherwise. If target is a boolean, int, or float it will be converted to a string. If target is nil or not a string, boolean, int, or float false is always returned.
Both the documentation and the code were added in the same PR (#16503) so I'm not sure what is actually intended, but the documented behavior makes more sense to me.
Collector version
v0.73.0
Environment information
No response
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
What I'm actually trying to do is detect if a value is a map, so if there's a simpler way of doing that, I'd appreciate some guidance.
The text was updated successfully, but these errors were encountered:
@swiatekm-sumo thanks for finding this discrepancy. With the new concept of typed-getters I think this lets itself to using a StringLikeGetter in the future, so I would opt for the code being accurate and the documentation being inaccurate. If we are willing to convert 1 data type to a string it seems reasonable to convert any supported datatype to a string.
Component(s)
pkg/ottl
What happened?
Description
According to documentation
IsMatch
should return false for non-atomic types:In reality, it serializes maps and slices to a string using JSON: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/ottl/ottlfuncs/func_is_match.go#L56
Both the documentation and the code were added in the same PR (#16503) so I'm not sure what is actually intended, but the documented behavior makes more sense to me.
Collector version
v0.73.0
Environment information
No response
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
What I'm actually trying to do is detect if a value is a map, so if there's a simpler way of doing that, I'd appreciate some guidance.
The text was updated successfully, but these errors were encountered: