Skip to content

pkg/ottl: add support for context inference of value expressions #39158

Closed
@axw

Description

@axw

Component(s)

pkg/ottl

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

In #38888 I am proposing to use OTTL as a means of routing data in the Kafka exporter. The gist of the idea would be to provide OTTL expressions for the topic name and message key. These should use context inference to simplify configuration, and automatically identify the cheapest (i.e. coarsest matching) scope in which to evaluate the expressions.

ParserCollection currently supports parsing Statements and Conditions, but not ValueExpressions, thus the proposal cannot be implemented with pkg/ottl currently.

Describe the solution you'd like

Add support for ValueExpression to context inference. I have a PoC of this in https://github.com/open-telemetry/opentelemetry-collector-contrib/compare/main...axw:opentelemetry-collector-contrib:kafkaexporter-topicnamer?expand=1#diff-66b6c342218721c7c6fb45eb5b225182ad8ef742fbc4da7b1c48754693dace4f

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions