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

config: Parse model from YAML #4826

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

carrbs
Copy link
Contributor

@carrbs carrbs commented Jan 18, 2024

Fixes: #4373

@carrbs carrbs changed the title Config: Parse model from YAML config: Parse model from YAML Jan 18, 2024
})
}

file = replaceEnvVars(file)
Copy link
Member

@pellared pellared Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to call out one important thing from https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/file-configuration.md#environment-variable-substitution:

It MUST NOT be possible to inject YAML structures by environment variables. For example, references to INVALID_MAP_VALUE environment variable below.

Maybe you will find some code that will help in https://github.com/open-telemetry/opentelemetry-collector.

@codeboten, are you able to provide some guidance?

Copy link
Contributor Author

@carrbs carrbs Jan 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree @pellared, also this does not solve for blocking the key replacement (i.e.${SNEAKY}: "foo") in the spec. I will take a look at both of these cases to see if we can come up with something more useful.

@MadVikingGod MadVikingGod added the area: config Related to config functionality label Feb 1, 2024
codeboten added a commit to codeboten/opentelemetry-go-contrib that referenced this pull request Oct 7, 2024
This replaces the last bit of functionality that was opened in open-telemetry#4826 to
support env variable replacement. Pulled the envprovider.go code from https://github.com/open-telemetry/opentelemetry-collector/blob/main/confmap/provider/envprovider/provider.go

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: config Related to config functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

config: Parse model from YAML
3 participants