generated from honeycombio/.github
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Prefer environment variables over code configuration (#106)
## Which problem is this PR solving? When setting configuration values by code and environment variables, environment variables should win. This is a design choice so that operators of the library can change behaviour without requiring rebuilding an application. This PR updates the sequence of applying configuration options so that env vars are applied last and will replace any code specificied options. Tests are updated to reflect this, and includes adding additional tests to verify expected behaviour of setting generic, trace and metrics headers via env var which was added in the following P; - Follow up to #99 ## Short description of the changes - Updates all string config options to use the `overwrite` go-envconfig option so env var values replace code-set options - Remove unused ResourceAttributesFromEnv config option - Move applying env var options to the config struct after applying code options - Update tests to reflect env vars have priority over code-provided options, includes fixing a couple of tests where env vars were being used by error ## How to verify that this has the expected result Unit tests exercise expected behaviour and help prevent future regressions. --------- Co-authored-by: Steve Moyer <smoyer1@selesy.com> Co-authored-by: Robb Kidd <robbkidd@honeycomb.io>
- Loading branch information
1 parent
9a50544
commit 6c48c9a
Showing
5 changed files
with
320 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
## smoke test artifacts | ||
/smoke-tests/collector/**/** | ||
/smoke-tests/report.xml | ||
/smoke-tests/report.xml | ||
/test_results/**/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.