open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.08k stars 2.37k forks source link

OTTL: Support using `ConvertCase` with `replace_*` functions #32342

Closed F21 closed 3 weeks ago

F21 commented 7 months ago

Component(s)

pkg/ottl

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

I want to use the transform processor to turn all key names in attributes to lowercase:

  transform:
    log_statements:
      - context: log
        statements:
          - replace_all_patterns(attributes, "key", "(.*)", "$$1", ConvertCase("lower"))

This currently does not work and the collector fails to start.

Describe the solution you'd like

The ability to use ConvertCase with the replace_ family of functions.

Describe alternatives you've considered

n/a

Additional context

https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27820#issuecomment-1918082608

github-actions[bot] commented 7 months ago

Pinging code owners:

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

evan-bradley commented 7 months ago

Hi, @F21. Thanks for opening an issue, it's nice to hear that someone might have a specific use case in mind for partial function application. I'm not aware that anyone is currently looking into this, would you be willing to take it on?

F21 commented 7 months ago

Hey @evan-bradley , I am happy to give it a shot, but this seems to be more involved than a simple change. Is there a design doc or some concensus for how this should be implemented?

evan-bradley commented 7 months ago

I agree it will probably be more involved than a simple change. The comment you linked is probably the most that has been written on this.

@TylerHelmuth do you still like the approach to partial function application as described in https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27820#issuecomment-1918082608? If so, I can draft up a description of how this would work and how we can approach an implementation.

TylerHelmuth commented 7 months ago

@evan-bradley can you open an issue specifically for the partial function feature? I know we want it, I just want to make sure we get the syntax correct.

github-actions[bot] commented 4 months ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

github-actions[bot] commented 2 months ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

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

github-actions[bot] commented 3 weeks ago

This issue has been closed as inactive because it has been stale for 120 days with no activity.