Skip to content

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

Closed
@schmikei

Description

@schmikei

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions