Skip to content

Add tests for DD_DYNAMIC_INSTRUMENTATION_ENABLED env var precedence over RC#5952

Draft
watson wants to merge 1 commit intomainfrom
watson/DEBUG-4402/remote-di-enablement
Draft

Add tests for DD_DYNAMIC_INSTRUMENTATION_ENABLED env var precedence over RC#5952
watson wants to merge 1 commit intomainfrom
watson/DEBUG-4402/remote-di-enablement

Conversation

@watson
Copy link
Copy Markdown
Contributor

@watson watson commented Jan 7, 2026

Motivation

Currently, there are no system tests verifying that the DD_DYNAMIC_INSTRUMENTATION_ENABLED environment variable takes precedence over Remote Config's dynamic_instrumentation_enabled setting.

Changes

Added two complementary test suites to verify DD_DYNAMIC_INSTRUMENTATION_ENABLED env var precedence:

1. Configuration-level test (parametric):

  • Added test_dynamic_instrumentation_env_precedence to TestDynamicConfigTracingEnabled class
  • Verifies the tracer's config system respects local env var precedence via telemetry events
  • Tests 3 parameterized scenarios: env not set, env=true, env=false

2. Functional-level tests (debugger):

  • Added 2 new test classes in test_debugger_inproduct_enablement.py:
    • Test_Debugger_InProduct_Enablement_DI_Env_Precedence_True
    • Test_Debugger_InProduct_Enablement_DI_Env_Precedence_False
  • Verifies DI actually functions (or doesn't) based on precedence using debugger probe emission

Expected behavior verified:

  • When env not set: RC should enable DI ✓
  • When env=true: DI already enabled, no functional change ✓
  • When env=false: RC cannot enable DI (local env takes precedence) ✓

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 7, 2026

CODEOWNERS have been resolved as:

tests/debugger/test_debugger_inproduct_enablement.py                    @DataDog/debugger @DataDog/system-tests-core
tests/parametric/test_dynamic_configuration.py                          @DataDog/system-tests-core @DataDog/apm-sdk-capabilities
utils/_context/_scenarios/__init__.py                                   @DataDog/system-tests-core

Copy link
Copy Markdown
Contributor Author

watson commented Jan 7, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@watson watson force-pushed the watson/DEBUG-4402/remote-di-enablement branch 2 times, most recently from 2806667 to 6c9a51e Compare January 7, 2026 10:29
…ver RC

Add two complementary test suites to verify that DD_DYNAMIC_INSTRUMENTATION_ENABLED
environment variable takes precedence over Remote Config's dynamic_instrumentation_enabled
setting:

1. Configuration-level test (parametric):
   - test_dynamic_instrumentation_env_precedence
   - Verifies tracer config system respects env var precedence via telemetry
   - Tests 3 scenarios: env not set, env=true, env=false

2. Functional-level tests (debugger):
   - Test_Debugger_InProduct_Enablement_DI_Env_Precedence_True
   - Test_Debugger_InProduct_Enablement_DI_Env_Precedence_False
   - Verifies DI actually functions based on precedence using probe emission

Expected behavior:
- When env not set: RC enables DI ✓
- When env=true: DI already enabled, no change ✓
- When env=false: RC cannot enable DI (local precedence) ✓
@watson watson force-pushed the watson/DEBUG-4402/remote-di-enablement branch from 6c9a51e to d111fee Compare January 30, 2026 15:08
@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Jan 30, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

❄️ 2 New flaky tests detected

tests.appsec.api_security.test_schemas.Test_Schema_Request_Path_Parameters.test_request_method[spring-boot-wildfly] from system_tests_suite (Datadog) (Fix with Cursor)
assert None

self = <tests.appsec.api_security.test_schemas.Test_Schema_Request_Path_Parameters object at 0x7fc4c891ee70>

    def test_request_method(self):
        """Can provide request path parameters schema"""
        schema = get_schema(self.request, "req.params")
        assert self.request.status_code == 200
>       assert schema
E       assert None
...
tests.debugger.test_debugger_probe_snapshot.Test_Debugger_Method_Probe_Snaphots.test_log_method_snapshot[spring-boot-openliberty] from system_tests_suite (Datadog) (Fix with Cursor)
ValueError: Snapshot logd2822-9b0f-415e-91b3-0478da139d7c was not received.

self = <tests.debugger.test_debugger_probe_snapshot.Test_Debugger_Method_Probe_Snaphots object at 0x7fc9ad0a7710>

    def test_log_method_snapshot(self):
        self._assert()
>       self._validate_snapshots()

tests/debugger/test_debugger_probe_snapshot.py:102: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
...

🧪 1 Test failed

tests.appsec.api_security.test_schemas.Test_Scanners.test_request_method[spring-boot-payara] from system_tests_suite (Datadog) (Fix with Cursor)
assert None

self = <tests.appsec.api_security.test_schemas.Test_Scanners object at 0x7f6a8483b800>

    def test_request_method(self):
        """Can provide request header schema"""
        schema_cookies = get_schema(self.request, "req.cookies")
        schema_headers = get_schema(self.request, "req.headers")
        assert self.request.status_code == 200
>       assert schema_cookies
...
This comment will be updated automatically if new data arrives.
🔗 Commit SHA: d111fee | Docs | Datadog PR Page | Was this helpful? Give us feedback!

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.

1 participant