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
Is your feature request related to a problem? Please describe.
The IsMatch function, which is an important function for OTTL conditions, very strictly expects a string to be returned from its Getter otherwise the function returns nil. Since this function is commonly used with attributes, it often comes across non-string types.
Describe the solution you'd like
The function should be updated to convert "easy" types to string. I think we should start with bool, double, and int.
Describe alternatives you've considered
Add a String factory function that knows how to convert a type to a string. This is a useful function and I think should exist, but the ergonomics of including String with every attribute use with IsMatch seems bad. I think it is reasonable for the IsMatch function to handle this situation on its own.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Component(s)
pkg/ottl
Is your feature request related to a problem? Please describe.
The
IsMatch
function, which is an important function for OTTL conditions, very strictly expects a string to be returned from its Getter otherwise the function returnsnil
. Since this function is commonly used with attributes, it often comes across non-string types.Describe the solution you'd like
The function should be updated to convert "easy" types to string. I think we should start with
bool
,double
, andint
.Describe alternatives you've considered
Add a
String
factory function that knows how to convert a type to a string. This is a useful function and I think should exist, but the ergonomics of includingString
with every attribute use withIsMatch
seems bad. I think it is reasonable for theIsMatch
function to handle this situation on its own.Additional context
No response
The text was updated successfully, but these errors were encountered: