Skip to content
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

metricstransform Regexp Config Causes Startup Failure in v0.104.0 #10585

Closed
fyuan1316 opened this issue Jul 10, 2024 · 2 comments · Fixed by #10560
Closed

metricstransform Regexp Config Causes Startup Failure in v0.104.0 #10585

fyuan1316 opened this issue Jul 10, 2024 · 2 comments · Fixed by #10560
Labels
bug Something isn't working

Comments

@fyuan1316
Copy link

fyuan1316 commented Jul 10, 2024

Describe the bug

Hi team,

After upgrading otel-collector-contrib from v0.100.0 to v0.104.0, we encountered a startup failure related to the regexp configuration in our component.

Below is our configuration that worked in v0.100.0:

processors:
  metricstransform:
    transforms:
      - include: http\.(.*)
        match_type: regexp
        action: update
        new_name: custom.http.$${1}

Errors Encountered

  1. Using custom.http.$${1}:
Error: failed to resolve config: cannot resolve the configuration: environment variable "1" has invalid name: must match regex ^[a-zA-Z_][a-zA-Z0-9_]*$
2024/07/10 17:59:10 collector server run finished with error: failed to resolve config: cannot resolve the configuration: environment variable "1" has invalid name: must match regex ^[a-zA-Z_][a-zA-Z0-9_]*$
  1. Changing to custom.http.${1}:
Error: failed to resolve config: cannot resolve the configuration: environment variable "1" has invalid name: must match regex ^[a-zA-Z_][a-zA-Z0-9_]*$
2024/07/10 18:00:31 collector server run finished with error: failed to resolve config: cannot resolve the configuration: environment variable "1" has invalid name: must match regex ^[a-zA-Z_][a-zA-Z0-9_]*$

  1. Changing to custom.http.$1:
Error: failed to resolve config: cannot resolve the configuration: cannot convert the confmap.Conf: variable substitution using $VAR has been deprecated in favor of ${VAR} and ${env:VAR} - please update $1 or temporarily disable the confmap.unifyEnvVarExpansion feature gate
2024/07/10 18:01:19 collector server run finished with error: failed to resolve config: cannot resolve the configuration: cannot convert the confmap.Conf: variable substitution using $VAR has been deprecated in favor of ${VAR} and ${env:VAR} - please update $1 or temporarily disable the confmap.unifyEnvVarExpansion feature gate

Context

It seems there is a breaking change in the core regarding confmap environment variable expansion. Given the deprecation of variable substitution using $VAR, could you please advise on how to properly use regexp expressions in component configurations without disabling the confmap.unifyEnvVarExpansion feature gate?

Thank you for your assistance! :)

Steps to reproduce

What did you expect to see?

What did you see instead?

What version did you use?

0.104.0
What config did you use?

Environment

Additional context

I observed a similar issue in #10356 , but we are still encountering it in version 0.104.0.

@fyuan1316 fyuan1316 added the bug Something isn't working label Jul 10, 2024
@fyuan1316
Copy link
Author

@TylerHelmuth @mx-psi do you have any suggestions? :)

@mx-psi
Copy link
Member

mx-psi commented Jul 10, 2024

This will be fixed in v0.105.0, until then you can disable the confmap.unifyEnvVarExpansion feature gate (by passing the --feature-gates=-confmap.unifyEnvVarExpansion CLI option).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants