You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(config): parse and resolve defaults in getValueFromEnvSources (#8925)
getValueFromEnvSources returned the raw environment string, so every caller
re-implemented the boolean/int/array parsing Config already does and those copies
drifted. It now maps aliases to the canonical option, runs Config's own parser and
transformer, and returns the typed value, falling back to the registered default
when unset. Callers that must distinguish an unset variable from an explicitly
configured one pass skipDefault and receive undefined instead of the default.
1. Resolving a value pulls in config/defaults, which transitively requires the
instrumented dns module -> the dns plugin -> log -> back into config/defaults
before it finished exporting. config/defaults now defers its dns require until
after module.exports and log requires config/defaults eagerly again, breaking the
cycle at its source. ritm reads DD_LAMBDA_HANDLER through the new
getConfiguredEnvName, a presence check that never parses and so cannot re-enter
the require hook.
2. skipDefault keeps the unset case meaningful where the registered default would
otherwise mask it: the OTEL_TRACES_EXPORTER fallback in index.js, experimental
plugin enablement in plugin_manager, the LLMObs programmatic opt-in, and the OTel
SDK gate.
3. The env helpers no longer tolerate a missing table entry. Every production caller
passes a registered name, so an unregistered DD_/OTEL_ name is a programming error
that throws rather than silently returning a raw string.
4. log.configure() recomputes enabled and logLevel from options, env, and defaults on
every call instead of retaining the previous call's values.
0 commit comments