[NO-TICKET] Add environment variable for most configs#5572
[NO-TICKET] Add environment variable for most configs#5572
Conversation
Typing analysisNote: Ignored files are excluded from the next sections.
|
ivoanjo
left a comment
There was a problem hiding this comment.
Left some notes. While I think the objective of allowing consistent settings is correct, I think we should be careful about just "ADD MOAR THINGS" -- there's a lot of settings that should probably not even exist or not be exposed so I recommend extreme caution with introducing more things that then in the future will require a API break to get rid of.
| end | ||
|
|
||
| # @public_api | ||
| settings :advanced do |
There was a problem hiding this comment.
For profiling settings under advanced, the ones that don't have env vars are deliberate -- they are things that are exposed only for very specific situations and almost always shouldn't/needn't be touched.
I'd like to keep them like that for now.
| # @return [Boolean] | ||
| # @!visibility private | ||
| option :agentless_enabled do |o| | ||
| o.type :bool | ||
| o.env Core::Telemetry::Ext::ENV_AGENTLESS_ENABLED | ||
| o.default false | ||
| end |
There was a problem hiding this comment.
This + a few others below are marked as "private" -- I believe the intention is not to expose these settings directly?
| # @default `DD_REMOTE_CONFIG_SERVICE_NAME` environment variable, otherwise `nil`. | ||
| # @return [String,nil] | ||
| option :service | ||
| option :service do |o| | ||
| o.type :string, nilable: true | ||
| o.env Core::Remote::Ext::ENV_SERVICE | ||
| end |
There was a problem hiding this comment.
I think we actually don't need this one, and should probably deprecate it, rather than introduce a new environment variable.
| # For internal use only. | ||
| # Enables telemetry debugging through the Datadog platform. | ||
| # | ||
| # @default `false`. | ||
| # @return [Boolean] | ||
| option :debug do |o| | ||
| o.type :bool | ||
| o.env Core::Telemetry::Ext::ENV_DEBUG | ||
| o.default false | ||
| end |
There was a problem hiding this comment.
This one is also for internal use, so I don't think this is correct?
|
✨ Fix all issues with BitsAI or with Cursor
|
Isn't it already the case even with the config DSL? I'd say it's even worse because setting a non-existing config in the Datadog.configure block would crash the app, while env vars can be non existent but still set by the customer without crashing the app. I'm unsure how adding env vars to existing config could lead to bigger breaking change than currently. But of course the first step of this PR was to add env vars to all configs, then with the review process we can remove some, e.g. internal-only ones, although there is an internal category in the config registry that would fit that purpose |
I guess this is indeed possible path, but... to me is a bit surprising, to be honest? 👀 😅 Adding all env vars before deciding if we need the config at all is kinda in the reverse order of what I'd expect: I'd kinda expect us to go "we don't need this one, let's start deprecating, and we'll keep that one, let's add the env var" and so on... 🤔 |
What does this PR do?
Add environment variable for all configurations that are not proc or objects
Motivation:
This way, these configs could be set through env var, and stable config.
Change log entry
Yes. (Needs to be written as the list of introduced env vars is long)
Additional Notes:
How to test the change?