Skip to content

Conversation

@juan-fernandez
Copy link
Collaborator

@juan-fernandez juan-fernandez commented Jan 13, 2026

What does this PR do?

  • If process.env. DD_ENABLE_NX_SERVICE_NAME and process.env.NX_TASK_TARGET_PROJECT are both set and the user hasn't configured test service in any other way, service is set to process.env.NX_TASK_TARGET_PROJECT

Motivation

Make it simpler for nx users to set an automatic test service when nx is testing multiple different projects.

Plugin Checklist

  • Unit tests.

@pr-commenter
Copy link

pr-commenter bot commented Jan 13, 2026

Benchmarks

Benchmark execution time: 2026-01-19 12:54:06

Comparing candidate commit 5afa390 in PR branch juan-fernandez/nx-auto-detection with baseline commit 2321594 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 291 metrics, 29 unstable metrics.

@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.19%. Comparing base (2321594) to head (5afa390).
⚠️ Report is 17 commits behind head on master.

Files with missing lines Patch % Lines
packages/dd-trace/src/config.js 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7231      +/-   ##
==========================================
+ Coverage   84.87%   85.19%   +0.32%     
==========================================
  Files         532      532              
  Lines       22654    22788     +134     
==========================================
+ Hits        19227    19414     +187     
+ Misses       3427     3374      -53     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

Overall package size

Self size: 4.4 MB
Deduped: 5.22 MB
No deduping: 5.22 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@juan-fernandez juan-fernandez force-pushed the juan-fernandez/nx-auto-detection branch from c2536a6 to b0cb7ec Compare January 15, 2026 11:19
@juan-fernandez juan-fernandez marked this pull request as ready for review January 15, 2026 11:20
@juan-fernandez juan-fernandez requested review from a team as code owners January 15, 2026 11:20
@juan-fernandez juan-fernandez requested review from BridgeAR and removed request for a team January 15, 2026 11:20
@datadog-datadog-prod-us1

This comment has been minimized.

Copy link
Collaborator

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

I would rather not add the new DD_ env. Do we have to add that?

anmarchenko
anmarchenko previously approved these changes Jan 15, 2026
@titan-ron
Copy link

titan-ron commented Jan 18, 2026

Hello 😄

I think this could be a bit confusing. Do we really need a flag to detect Nx? The existence of NX_TASK_TARGET_PROJECT already indicates Nx is being used.

Is the goal to let the consumer decide whether to use it or not? If so, I’d name it something like DD_NX_AWARE.

If we want the service name to default to the Nx project name, we can always read NX_TASK_TARGET_PROJECT than.

Also, DD_SERVICE="env://NX_TASK_TARGET_PROJECT" could be a good alternative if it’s supported and relevant.

@juan-fernandez
Copy link
Collaborator Author

Hello 😄

I think this could be a bit confusing. Do we really need a flag to detect Nx? The existence of NX_TASK_TARGET_PROJECT already indicates Nx is being used.

Is the goal to let the consumer decide whether to use it or not? If so, I’d name it something like DD_NX_AWARE.

If we want the service name to default to the Nx project name, we can always read NX_TASK_TARGET_PROJECT than.

hey thanks for the feedback. We will use DD_ENABLE_NX_SERVICE_NAME which should be more explanatory. As for its necessity: if we didn't include it, this would be a breaking change, causing nx users to see a changing test service name.

We're going to ship a breaking change in v6 though, removing the need for passing DD_ENABLE_NX_SERVICE_NAME altogether.

Also, DD_SERVICE="env://NX_TASK_TARGET_PROJECT" could be a good alternative if it’s supported and relevant.

We've decided not to support env://$ENV_VAR kind of syntax because it increases the likelihood of sensitive data being leaked. Since NX_TASK_TARGET_PROJECT is the only env var for which this is needed at the moment, we've preferred to add custom logic for it

@juan-fernandez juan-fernandez merged commit 271f39d into master Jan 19, 2026
996 of 998 checks passed
@juan-fernandez juan-fernandez deleted the juan-fernandez/nx-auto-detection branch January 19, 2026 13:05
@dd-octo-sts dd-octo-sts bot mentioned this pull request Jan 20, 2026
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.

5 participants