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: value tracing #1131

Open
bt-justtrack opened this issue Jul 24, 2024 · 1 comment
Open

config: value tracing #1131

bt-justtrack opened this issue Jul 24, 2024 · 1 comment
Labels
enhancement New feature or request refinement

Comments

@bt-justtrack
Copy link
Contributor

To determine where a config value is coming from ( especially useful when looking at a service's config http page) we want to store a "trace" where that setting is coming from (eg ENV, config.dist.yml, ...).

@bt-justtrack bt-justtrack added enhancement New feature or request refinement labels Jul 24, 2024
@bt-justtrack
Copy link
Contributor Author

Plan: add a property

type ValueSource string
const (
ZeroValueSource ValueSource = "zero value"
DefaultValueSource ValueSource = "default value"
AdditionalDefaultValueSource ValueSource = "additional default value"
)
...
source ValueSource

And set that on load to where that is coming from, eg config.dist.yml or env + env var
For defaults we want to:
UnmarshalWithDefaultsFromKey => source should be the source config key
UnmarshalWithDefaultForKey => source should be the code file location of the passed settings struct

source gets overwritten on merge according to provider priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refinement
Projects
None yet
Development

No branches or pull requests

1 participant