-
Notifications
You must be signed in to change notification settings - Fork 452
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
Discussion: priority on environment variable vs compiling time value #1225
Comments
We discussed it in weekly meetings. Some notes
|
I find it very confusing to make the compiled-in value take priority over the run-time value (from an environment variable). Code is usually written (and compiled) to function across many environments, whereas the runtime environment is specific to a particular invocation. Clearly the runtime environment, with its better specificity, should be trusted more than the code. Maybe we should just not provide any way to configure these values in code? Or clarify with function names etc that the values provided in code are just fallbacks if the environment doesn't provide the required information? See also this recent discussion in Cargo on a related problem: In this case, there is no value provided in code, but there's a clear hierarchy of specificity. |
I think most of people favors the environment variables. I think we can favor env vars here and make sure it's consistent. Please leave comments if you disgree @open-telemetry/rust-approvers |
So while this is not a deviation (more of a clarification), it might also be useful to document. #1297 |
FWIW I've just gotten confused by I would've instead expected having to specify some kind of (imaginary) I'm not necessarily advocating for changing this behaviour, just providing a data point from a library user. |
Reopening to further discuss given above. |
Most of our creates generally allow two ways to configure values:
with_xxx
)However, this is unclear when both of the configurations present which one should take priority. Regardless we should align on this and use it as a tenet across all our creates.
cc @open-telemetry/rust-approvers
The text was updated successfully, but these errors were encountered: