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

[configuration] Force type when doing environment variable substitution #4281

Open
flyfire2002 opened this issue Nov 4, 2024 · 3 comments
Open
Labels
spec:miscellaneous For issues that don't match any other spec label triage:deciding:needs-info Not enough information. Left open to provide the author with time to add more details

Comments

@flyfire2002
Copy link

flyfire2002 commented Nov 4, 2024

What are you trying to achieve?

When substituting env variables like "00001" (as a string) (e.g. into an attribute), the type of the produced value is automatically Int. I want to be able to force it to type Str at substitution. Note, currently with attribute: convert it is done after the value is already substituted as an Int, so in this case it will be doing Int(1) => Str(1), which is still not the same as Str(00001).

** Context/Example **

With config

  resource/common_labels:
    attributes:
    - key: some_id
      value: "${id}"
      action: upsert

When the env var id = "00001", the value of the attribute "some_id" will be Int(1).
If we do a

    - key: some_id
      action: convert
      converted_type: string

afterwards, the value is Str(1) which is still different from "00001" / Str(00001).

@flyfire2002 flyfire2002 added the spec:miscellaneous For issues that don't match any other spec label label Nov 4, 2024
@jack-berg
Copy link
Member

Seems like this should be transferred to opentelemetry-collector-contrib.

@flyfire2002
Copy link
Author

Filed open-telemetry/opentelemetry-collector-contrib#36183 though I feel like this is not a one-processor-specific problem.

@trask
Copy link
Member

trask commented Nov 5, 2024

hi @flyfire2002, we don't think this is a spec issue since the spec doesn't say anything about collector processors

@trask trask added the triage:deciding:needs-info Not enough information. Left open to provide the author with time to add more details label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:miscellaneous For issues that don't match any other spec label triage:deciding:needs-info Not enough information. Left open to provide the author with time to add more details
Projects
None yet
Development

No branches or pull requests

3 participants