Skip to content

Commit a4585dc

Browse files
committed
chore: remove redundant comments
1 parent 9bf97f8 commit a4585dc

File tree

1 file changed

+5
-8
lines changed
  • packages/auto-instrumentations-node/src

1 file changed

+5
-8
lines changed

packages/auto-instrumentations-node/src/utils.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,30 +167,27 @@ export function getNodeAutoInstrumentations(
167167
const userConfig: any = inputConfigs[name] ?? {};
168168

169169
// Configuration priority: Environment variables > programmatic config
170-
// If both OTEL_NODE_ENABLED_INSTRUMENTATIONS and OTEL_NODE_DISABLED_INSTRUMENTATIONS are set,
171-
// ENABLED is applied first, then DISABLED is applied to that list.
170+
// If both OTEL_NODE_ENABLED_INSTRUMENTATIONS and OTEL_NODE_DISABLED_INSTRUMENTATIONS are set, ENABLED is applied first, then DISABLED is applied to that list.
172171
// If the same instrumentation is in both lists, it will be disabled.
173-
174-
// 1. OTEL_NODE_DISABLED_INSTRUMENTATIONS takes absolute priority
172+
// When env vars are unset, allow programmatic config to override default exclusions
173+
175174
if (disabledInstrumentationsFromEnv.includes(name)) {
176175
diag.debug(`Disabling instrumentation for ${name} - disabled by env var`);
177176
continue;
178177
}
179-
180-
// 2. If OTEL_NODE_ENABLED_INSTRUMENTATIONS is set, only enable those in the list
178+
181179
const isEnabledEnvSet = !!process.env.OTEL_NODE_ENABLED_INSTRUMENTATIONS;
182180
if (isEnabledEnvSet) {
183181
if (!enabledInstrumentationsFromEnv.includes(name)) {
184182
diag.debug(`Disabling instrumentation for ${name} - not in enabled env var list`);
185183
continue;
186184
}
187185
} else {
188-
// 3. If no env vars are set, fall back to programmatic config and defaults
189186
if (userConfig.enabled === false) {
190187
diag.debug(`Disabling instrumentation for ${name} - disabled by user config`);
191188
continue;
192189
}
193-
190+
194191
const isDefaultExcluded = defaultExcludedInstrumentations.includes(name);
195192
if (isDefaultExcluded && userConfig.enabled !== true) {
196193
diag.debug(`Disabling instrumentation for ${name} - excluded by default and not explicitly enabled`);

0 commit comments

Comments
 (0)