Skip to content

[connector/routing]: Add support for IsMap and IsString OTTL funcs #38282

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

Closed
schmikei opened this issue Feb 28, 2025 · 2 comments · Fixed by #38312
Closed

[connector/routing]: Add support for IsMap and IsString OTTL funcs #38282

schmikei opened this issue Feb 28, 2025 · 2 comments · Fixed by #38312
Assignees
Labels
connector/routing enhancement New feature or request needs triage New item requiring triage

Comments

@schmikei
Copy link
Contributor

Component(s)

connector/routing

Is your feature request related to a problem? Please describe.

Pretty much trying to use the routing connector so that all my JSON Mappable logs can go to the correct exporter and any text based logs from a system can go to a different exporter.

Notice that the factory definition that defines them here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/connector/routingconnector/internal/common/functions.go

I think we could probably just add these two functions

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,
		////github.com/open-telemetry/opentelemetry-collector-contrib/issues/13545
		ottl.NewFactory("route", nil, createRouteFunction[K]),
	)
}

Is there any reason we shouldn't be able to support these specifically in this connector?

Describe the solution you'd like

To be able to use more OTTLFuncs inside of the routing connector

specifically

  • IsStr
  • IsMap

Describe alternatives you've considered

No response

Additional context

No response

@schmikei schmikei added enhancement New feature or request needs triage New item requiring triage labels Feb 28, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@djaglowski
Copy link
Member

Makes sense to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connector/routing enhancement New feature or request needs triage New item requiring triage
Projects
None yet
2 participants