Skip to content

chore(config): fixed INSTANA_TRACING_DISABLE env var handling#2486

Merged
aryamohanan merged 2 commits intofix-config-precedencefrom
fix-config-test
Apr 13, 2026
Merged

chore(config): fixed INSTANA_TRACING_DISABLE env var handling#2486
aryamohanan merged 2 commits intofix-config-precedencefrom
fix-config-test

Conversation

@aryamohanan
Copy link
Copy Markdown
Contributor

@aryamohanan aryamohanan commented Apr 13, 2026

There were two issues with how INSTANA_TRACING_DISABLE was handled:

  1. ProcessControls behavior
    ProcessControls was setting INSTANA_TRACING_DISABLE=false for all tests where tracingEnabled=true (which is the default). Based on the precedence rules in disable.js, setting INSTANA_TRACING_DISABLE to 'false' overrides INSTANA_TRACING_DISABLE_INSTRUMENTATIONS and INSTANA_TRACING_DISABLE_GROUPS, thereby blocking more granular disable configurations.
    This has been corrected so that ProcessControls now sets INSTANA_TRACING_DISABLE='true' only when tracingEnabled=false, and leaves it unset when tracingEnabled=true.

  2. normalizeTracingEnabled fix
    normalizeTracingEnabled has been updated to consider INSTANA_TRACING_DISABLE for the tracing.enabled configuration only when its value is 'true' or 'false'. If the variable contains instrumentation or group names (for example, 'logging'), it is now handled separately by the disable normalizer.

@aryamohanan aryamohanan requested a review from a team as a code owner April 13, 2026 04:47
Comment thread packages/collector/test/test_util/ProcessControls.js
ProcessControls was setting INSTANA_TRACING_DISABLE=false for all tests
where tracingEnabled=true (the default). According to the precedence rules
in disable.js, when INSTANA_TRACING_DISABLE is set to 'false', it takes
precedence over INSTANA_TRACING_DISABLE_INSTRUMENTATIONS and
INSTANA_TRACING_DISABLE_GROUPS, preventing granular disable configurations
from working in tests.

This caused logging integration tests to fail when trying to disable
specific instrumentations using INSTANA_TRACING_DISABLE_INSTRUMENTATIONS
or INSTANA_TRACING_DISABLE_GROUPS.

Changed ProcessControls to only set INSTANA_TRACING_DISABLE='true' when
tracingEnabled=false, and not set it at all when tracingEnabled=true,
allowing other disable environment variables to work correctly.
…olean

Fixed normalizeTracingEnabled to only use INSTANA_TRACING_DISABLE for the
tracing.enabled config when the env var value is 'true' or 'false'. When it
contains instrumentation/group names (e.g., 'logging'), it's now handled by
the separate disable normalizer

if (envDisableConfig !== null) {
if (envDisableConfig === true) {
logger?.debug('[config] env:INSTANA_TRACING_DISABLE = true');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already logged this, removed duplicate logging

@sonarqubecloud
Copy link
Copy Markdown

@aryamohanan aryamohanan merged commit a808ba2 into fix-config-precedence Apr 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants