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

Failing expansion of map string values that look like another type #10937

Closed
dmitryax opened this issue Aug 21, 2024 · 1 comment · Fixed by #10938
Closed

Failing expansion of map string values that look like another type #10937

dmitryax opened this issue Aug 21, 2024 · 1 comment · Fixed by #10938
Labels
area:confmap bug Something isn't working

Comments

@dmitryax
Copy link
Member

dmitryax commented Aug 21, 2024

Describe the bug
The issue is similar to #10552 (comment) still can be hit if an expansion is part of a map value.

Steps to reproduce
Run collector with a config like:

receivers:
  otlp:
    protocols:
      grpc:
      http:

exporters:
  otlphttp:
    traces_endpoint: "example.com:4317"
    headers:
      "AUTH-TOKEN": "${AUTH_TOKEN}"

service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [otlphttp]

and AUTH_TOKEN env var set to 123

What did you expect to see?
Collector to start.

What did you see instead?
Collector fails with

Error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):

error decoding 'exporters': error reading configuration for "otlphttp": decoding failed due to the following error(s):

'headers[AUTH-TOKEN]' expected type 'configopaque.String', got unconvertible type 'int', value: '123'
2024/08/20 21:23:23 collector server run finished with error: failed to get config: cannot unmarshal the configuration: decoding failed due to the following error(s):

error decoding 'exporters': error reading configuration for "otlphttp": decoding failed due to the following error(s):

'headers[AUTH-TOKEN]' expected type 'configopaque.String', got unconvertible type 'int', value: '123'
@dmitryax dmitryax added the bug Something isn't working label Aug 21, 2024
@dmitryax dmitryax changed the title Failing expansion of map string values that look like an other type Failing expansion of map string values that look like another type Aug 21, 2024
@mx-psi
Copy link
Member

mx-psi commented Aug 21, 2024

#10938 would fix this

mx-psi added a commit that referenced this issue Aug 26, 2024
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

<!-- Issue number if applicable -->

Use string value for stringy types

#### Link to tracking issue

Fixes #10937

<!--Describe what testing was performed and which tests were added.-->
#### Testing

Adds tests for stringy type recognition and adds end to end tests

---------

Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:confmap bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants