Skip to content

[nodejs] add dynamic detection for Remote Enablement capabilities#5894

Merged
dd-mergequeue[bot] merged 2 commits intomainfrom
watson/DEBUG-4402/nodejs-remote-enablement
Dec 19, 2025
Merged

[nodejs] add dynamic detection for Remote Enablement capabilities#5894
dd-mergequeue[bot] merged 2 commits intomainfrom
watson/DEBUG-4402/nodejs-remote-enablement

Conversation

@watson
Copy link
Copy Markdown
Contributor

@watson watson commented Dec 18, 2025

Motivation

The Node.js tracer is adding Remote Enablement support via DataDog/dd-trace-js#7137, which introduces new remote configuration capabilities. However, we face a chicken-and-egg problem:

  1. System-tests need to be updated to expect the new capabilities
  2. System-tests must pass on master (without the new capabilities) before the dd-trace-js PR lands
  3. System-tests must pass on the dd-trace-js PR (version "6.0.0-pre") during testing
  4. The exact release version where this will land is unknown (5.82.0, 5.83.0, or later)

This PR solves the problem by using feature detection instead of version numbers.

Changes

Modified test_default_capability_completeness to dynamically detect Node.js Remote Enablement support:

  • Convert expected_capabilities to a mutable set
  • Check if APM_TRACING_MULTICONFIG capability is present (marker for RE support)
  • If present, add all Remote Enablement capabilities:
    • APM_TRACING_MULTICONFIG
    • APM_TRACING_ENABLE_DYNAMIC_INSTRUMENTATION
    • APM_TRACING_ENABLE_CODE_ORIGIN
    • APM_TRACING_ENABLE_LIVE_DEBUGGING

This allows:

  • ✅ Merging system-tests before dd-trace-js PR lands
  • ✅ Tests pass on master without RE capabilities
  • ✅ Tests pass on dd-trace-js PR with RE capabilities
  • ✅ Tests automatically adapt based on tracer capabilities

Cleanup plan: Once DataDog/dd-trace-js#7137 lands and becomes the minimum supported version, these capabilities should be moved to the static DEFAULT_SUPPORTED_CAPABILITIES_BY_LANG["nodejs"] list and the dynamic check removed.

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

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, 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 (or removed)?

Add feature detection for Node.js Remote Enablement capabilities to allow
`system-tests` to pass in three scenarios:
1. On master before dd-trace-js#7137 lands (no RE support)
2. On dd-trace-js#7137 during testing (version "6.0.0-pre")
3. After PR lands in unknown release version (5.82.0 or later)

Instead of hardcoding version numbers, detect Remote Enablement support by
checking if `APM_TRACING_MULTICONFIG` capability is present. When
detected, expect all RE capabilities:

- `APM_TRACING_MULTICONFIG`
- `APM_TRACING_ENABLE_DYNAMIC_INSTRUMENTATION`
- `APM_TRACING_ENABLE_CODE_ORIGIN`
- `APM_TRACING_ENABLE_LIVE_DEBUGGING`

This allows merging `system-tests` before the `dd-trace-js` PR while
ensuring tests pass on both old and new tracer versions.
Copy link
Copy Markdown
Contributor Author

watson commented Dec 18, 2025

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

@github-actions
Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/parametric/test_dynamic_configuration.py                          @DataDog/system-tests-core @DataDog/apm-sdk-capabilities

@watson watson marked this pull request as ready for review December 18, 2025 18:35
@watson watson requested review from a team as code owners December 18, 2025 18:35
@watson watson requested review from a team and mtoffl01 and removed request for a team December 18, 2025 18:35
Copy link
Copy Markdown
Contributor

@mtoffl01 mtoffl01 left a comment

Choose a reason for hiding this comment

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

Cool, smart approach 👍

@watson
Copy link
Copy Markdown
Contributor Author

watson commented Dec 19, 2025

/merge

@dd-devflow-routing-codex
Copy link
Copy Markdown

dd-devflow-routing-codex Bot commented Dec 19, 2025

View all feedbacks in Devflow UI.

2025-12-19 19:24:00 UTC ℹ️ Start processing command /merge


2025-12-19 19:24:04 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 9m (p90).


2025-12-19 19:31:29 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue Bot merged commit 8ad7b82 into main Dec 19, 2025
395 checks passed
@dd-mergequeue dd-mergequeue Bot deleted the watson/DEBUG-4402/nodejs-remote-enablement branch December 19, 2025 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants