-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[connector/routing] Add support for standard converter functions in routing conditions #38312
[connector/routing] Add support for standard converter functions in routing conditions #38312
Conversation
func Functions[K any]() map[string]ottl.Factory[K] { | ||
return ottl.CreateFactoryMap( | ||
ottlfuncs.NewIsMatchFactory[K](), | ||
ottlfuncs.NewIsMapFactory[K](), | ||
ottlfuncs.NewIsStringFactory[K](), | ||
ottlfuncs.NewDeleteKeyFactory[K](), | ||
ottlfuncs.NewDeleteMatchingKeysFactory[K](), | ||
// noop function, it is required since the parsing of conditions is not implemented yet, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func Functions[K any]() map[string]ottl.Factory[K] { | |
return ottl.CreateFactoryMap( | |
ottlfuncs.NewIsMatchFactory[K](), | |
ottlfuncs.NewIsMapFactory[K](), | |
ottlfuncs.NewIsStringFactory[K](), | |
ottlfuncs.NewDeleteKeyFactory[K](), | |
ottlfuncs.NewDeleteMatchingKeysFactory[K](), | |
// noop function, it is required since the parsing of conditions is not implemented yet, | |
func Functions[K any]() map[string]ottl.Factory[K] { | |
return ottlfuncs.StandardConverters[K]() | |
} |
I could also see this being an implementation choice, I'll leave it up to the maintainers here if they think that is too much!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the routing connect should have access to all converters. This is safe since converters never change the underlying telemetry itself. @jpkrohling, @mwear @djaglowski do you agree?
…tor-contrib into feat/add-routing-ismatch-isStr
…opentelemetry-collector-contrib into feat/add-routing-ismatch-isStr
IsMap
and IsString
as supported OTTL functionsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Just adding to the factory of the routing connector to include some useful for routing OTTL functions. Let me know if I'm overlooking anything as this is my first contribution to the routing connector!
Link to tracking issue
Resolves #38282
Testing
Tested with the three signals conditions on Logs, Metrics and Traces
Documentation
Updated the list of OTTLFuncs supported in the README