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

Add a config source for env vars #348

Merged
merged 5 commits into from
May 5, 2021

Conversation

pjanotti
Copy link
Contributor

Although the OTel collector already supports env variables on the config for feature parity with SA we need to add a full config source for env vars. Having env vars as a config source allows injection of YAML fragments, like SA, via environment variables. Added also the following:

  • Possibility to define defaults/fallbacks when environment variables used in the config are undefined in the environment.
  • A retrieve parameter to indicate that the configuration load should fail if the environment variable is not defined.

@pjanotti pjanotti self-assigned this Apr 29, 2021
}

// To keep with default behavior for env vars not defined set the value to empty string
defaultValue = ""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This likely can be better handled by the config source manager. I will evaluate that option and will update after merging this PR if appropriate. For now, the desired behavior is enforced here.

@pjanotti pjanotti force-pushed the add-envvarconfigsource branch 3 times, most recently from df98e5d to a95fdcf Compare May 4, 2021 19:31
@pjanotti pjanotti merged commit eaa1b0c into signalfx:main May 5, 2021
@pjanotti pjanotti deleted the add-envvarconfigsource branch May 5, 2021 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants