Skip to content

[processor/transform] Register programatically custom OTTL funcs in transform processor. #39698

@franciscovalentecastro

Description

@franciscovalentecastro

Component(s)

processor/transform
processor/filter

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

The Ops Agent (OA in short, https://github.com/GoogleCloudPlatform/ops-agent) uses the transform processor to modify the resulting collected telemetry ( logs or metrics ) into a format that would be compatible with Google Cloud Logging and that is aligned with users expectations.

To progressively port more OA features to use the Opentelemetry collector we would need custom transform functionality that wouldn't be appropriate (too specific for OA and Google Cloud ) to be contributed to the opentelemetry-collector-contrib repository.

One example of this is an ExtractPatterns ottl func that uses a Ruby Regex engine instead of the Go RE2 engine. This is required to preserve backwards compatibility in the OA. This functionality would be required too in the filter processor with a custom IsMatch ottl func.

Describe the solution you'd like

Add a property to the transform processor Config which enables the user to programatically add new custom OTTL funcs for logs, metrics or traces to the resulting processor. This proposal also considers adding a similar property to the filter processor Config .

Some details about the solution :

  • This Config properties can only be set programatically.
  • This Config properties can not be set through a config file.
  • This enables users of the transform & filter processors to customize their OTTL func as needed.

PR with implemented solution :

Describe alternatives you've considered

1. Adding OTTL funcs through config during collector runtime

After exploring several [1] [2] threads related to this solution, it doesn't seem feasible.

[1] https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16098

[2] https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/28573

2. Adding all required features to pkg/ottl

Some very specific telemetry transformation logic may not necessarily be appropriate to be contributed to opentelemetry-collector-contrib.

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