Skip to content

Commit f9e1101

Browse files
tlhunterclaude
andcommitted
refactor(config): apply all pm2_env vars unconditionally, not just DD_*/OTEL_*
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a8ac062 commit f9e1101

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
// In PM2 cluster mode, per-app env vars arrive as a pm2_env JSON blob after
4-
// --require has already run. Apply DD_*/OTEL_* keys before guardrails so that
4+
// --require has already run. Apply all keys before guardrails so that
55
// DD_INJECT_FORCE, DD_INJECTION_ENABLED, etc. reflect the per-app config.
66
// Object.keys is safe here: PM2 only runs on Node.js 0.10+, so pm2_env is never
77
// set on older runtimes and the guardrails still report incompatibility gracefully.
@@ -13,7 +13,7 @@ if (typeof pm2EnvStr === 'string') {
1313
for (var i = 0; i < pm2Keys.length; i++) {
1414
var k = pm2Keys[i]
1515
var v = pm2Config[k]
16-
if ((k.indexOf('DD_') === 0 || k.indexOf('OTEL_') === 0) && v != null) {
16+
if (v != null) {
1717
process.env[k] = String(v)
1818
}
1919
}

0 commit comments

Comments
 (0)