Skip to content

Add data_streams_enabled to startup log output#7454

Merged
BridgeAR merged 3 commits intomasterfrom
jj.botha/add-dsm-to-startup-log
Feb 6, 2026
Merged

Add data_streams_enabled to startup log output#7454
BridgeAR merged 3 commits intomasterfrom
jj.botha/add-dsm-to-startup-log

Conversation

@johannbotha
Copy link
Copy Markdown
Contributor

@johannbotha johannbotha commented Feb 6, 2026

Summary

  • Adds dsmEnabled to the public TracerOptions interface so customers can enable Data Streams Monitoring directly in dd.init()
  • Adds data_streams_enabled to the DATADOG TRACER CONFIGURATION startup log output (Go, Java, and .NET already include this field)

Changes

  • index.d.ts: Add dsmEnabled?: boolean to TracerOptions interface with JSDoc. The config system already supports this option internally — this just makes it visible and documented for customers.
  • packages/dd-trace/src/startup-log.js: Add data_streams_enabled: !!config.dsmEnabled to tracerInfo() output.
  • packages/dd-trace/test/startup-log.spec.js: Add test coverage for three env var / code option precedence scenarios.

Investigation context

This came out of investigating a support case where a customer had DD_DATA_STREAMS_ENABLED=true set in ECS Fargate but DSM was not showing as enabled on the service page.

What we tested

  1. Repro app: Built a repro mimicking their setup — a shared wrapper library (compiled TypeScript) that calls dd.init() at module-level, imported by the main service. Tested with [email protected] across ts-node, compiled dist/, and separately compiled shared-lib scenarios. Result: dsmEnabled was true in all cases — the wrapper pattern alone does not prevent the env var from being read.

  2. Config precedence verification: Tested all combinations of env var vs code option:

    dsmEnabled in code DD_DATA_STREAMS_ENABLED env var Result
    not passed true true (env var applies)
    not passed not set false (default)
    undefined true true (env var applies)
    true not set true (code option applies)
    false true false (code option takes precedence)

    Adding dsmEnabled to TracerOptions has no runtime impact on existing customers. When not passed in code, the env var continues to work exactly as before.

  3. Customer debug logging: Customer added debug prints and found:

    • Entrypoint: DD_DATA_STREAMS_ENABLED: undefined — env var not set at process start
    • Before dd.init(): DD_DATA_STREAMS_ENABLED: true — something sets it between entrypoint and init (likely dotenv or similar)
    • After dd.init(): dsmEnabled: true — tracer picks it up correctly

    However, this was from a local dev environment, not their production ECS Fargate deployment where the issue actually occurs. Investigation is ongoing for the production case.

Why these changes help

  1. dsmEnabled in TracerOptions: Customers using wrapper libraries around dd.init() (like this customer's @touchbistro/node-common) can explicitly enable DSM in code rather than relying solely on the env var. This is especially useful when env var injection in container orchestrators (ECS, K8s) may behave unexpectedly.

  2. data_streams_enabled in startup logs: Currently there's no way to verify DSM configuration from the tracer's diagnostic output. The startup log includes appsec_enabled, profiling_enabled, runtime_metrics_enabled, etc. — but not DSM. This makes it impossible to debug DSM config issues from logs alone.

Cross-language precedent

Tracer data_streams_enabled in startup log?
Go Yes
Java Yes
.NET Yes
Node.js No (this PR adds it)
Python No
Ruby No
PHP No

Test plan

  • mocha packages/dd-trace/test/startup-log.spec.js — all 6 tests pass
  • Manually verified all env var / code option precedence combinations
  • CI: one pre-existing failure in agent-proxy.spec.js (macOS gzip test) — unrelated to this change

🤖 Generated with Claude Code

Go, Java, and .NET tracers already include data_streams_enabled in
the DATADOG TRACER CONFIGURATION startup log. This adds parity for
the Node.js tracer, making it easier to debug DSM configuration
issues in customer environments.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@johannbotha johannbotha requested a review from a team as a code owner February 6, 2026 18:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 6, 2026

Overall package size

Self size: 4.58 MB
Deduped: 5.42 MB
No deduping: 5.42 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |

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

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.34%. Comparing base (1630815) to head (cf17ed2).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7454   +/-   ##
=======================================
  Coverage   80.34%   80.34%           
=======================================
  Files         731      731           
  Lines       31093    31093           
=======================================
  Hits        24981    24981           
  Misses       6112     6112           
Flag Coverage Δ
aiguard-macos 39.08% <ø> (-0.11%) ⬇️
aiguard-ubuntu 39.12% <ø> (-0.11%) ⬇️
aiguard-windows 38.97% <ø> (-0.11%) ⬇️
apm-capabilities-tracing-macos 48.85% <ø> (ø)
apm-capabilities-tracing-ubuntu 48.85% <ø> (ø)
apm-capabilities-tracing-windows 48.57% <ø> (-0.01%) ⬇️
apm-integrations-child-process 38.57% <ø> (-0.11%) ⬇️
apm-integrations-couchbase-18 37.33% <ø> (-0.25%) ⬇️
apm-integrations-couchbase-eol 37.81% <ø> (-0.10%) ⬇️
apm-integrations-oracledb 38.00% <ø> (-0.10%) ⬇️
appsec-express 55.37% <ø> (-0.08%) ⬇️
appsec-fastify 51.99% <ø> (-0.08%) ⬇️
appsec-graphql 52.32% <ø> (-0.07%) ⬇️
appsec-kafka 44.64% <ø> (-0.09%) ⬇️
appsec-ldapjs 44.31% <ø> (-0.09%) ⬇️
appsec-lodash 43.99% <ø> (-0.09%) ⬇️
appsec-macos 58.48% <ø> (-0.07%) ⬇️
appsec-mongodb-core 49.07% <ø> (-0.20%) ⬇️
appsec-mongoose 49.88% <ø> (-0.07%) ⬇️
appsec-mysql 51.26% <ø> (-0.08%) ⬇️
appsec-node-serialize 43.50% <ø> (-0.09%) ⬇️
appsec-passport 48.10% <ø> (-0.09%) ⬇️
appsec-postgres 51.03% <ø> (-0.10%) ⬇️
appsec-sourcing 42.84% <ø> (-0.09%) ⬇️
appsec-template 43.67% <ø> (-0.09%) ⬇️
appsec-ubuntu 58.50% <ø> (-0.07%) ⬇️
appsec-windows 58.36% <ø> (-0.05%) ⬇️
instrumentations-instrumentation-bluebird 32.25% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-body-parser 40.73% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-child_process 37.88% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-cookie-parser 34.51% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express 34.85% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 34.65% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-express-session 40.41% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-fs 31.85% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-generic-pool 29.81% <ø> (ø)
instrumentations-instrumentation-http 39.62% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-knex 32.25% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-mongoose 33.62% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-multer 40.47% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-mysql2 38.27% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-passport 40.77% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-passport-http 40.74% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-passport-local 40.74% <ø> (-0.10%) ⬇️
instrumentations-instrumentation-pg 37.79% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-promise 32.18% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-promise-js 32.18% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-q 32.23% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-url 32.15% <ø> (-0.11%) ⬇️
instrumentations-instrumentation-when 32.20% <ø> (-0.11%) ⬇️
llmobs-ai 41.41% <ø> (-0.10%) ⬇️
llmobs-anthropic 40.63% <ø> (-0.10%) ⬇️
llmobs-bedrock 39.51% <ø> (-0.09%) ⬇️
llmobs-google-genai 40.12% <ø> (-0.09%) ⬇️
llmobs-langchain 39.66% <ø> (-0.08%) ⬇️
llmobs-openai 44.48% <ø> (-0.09%) ⬇️
llmobs-vertex-ai 40.34% <ø> (-0.17%) ⬇️
platform-core 28.09% <ø> (ø)
platform-esbuild 31.49% <ø> (ø)
platform-instrumentations-misc 39.62% <ø> (ø)
platform-shimmer 34.83% <ø> (ø)
platform-unit-guardrails 30.37% <ø> (ø)
plugins-azure-event-hubs 22.64% <ø> (ø)
plugins-azure-service-bus 22.08% <ø> (ø)
plugins-bullmq 43.71% <ø> (-0.10%) ⬇️
plugins-cassandra 38.04% <ø> (-0.10%) ⬇️
plugins-cookie 23.69% <ø> (ø)
plugins-cookie-parser 23.50% <ø> (ø)
plugins-crypto 22.88% <ø> (ø)
plugins-dd-trace-api 38.42% <ø> (-0.11%) ⬇️
plugins-express-mongo-sanitize 23.67% <ø> (ø)
plugins-express-session 23.46% <ø> (ø)
plugins-fastify 42.53% <ø> (-0.10%) ⬇️
plugins-fetch 38.60% <ø> (-0.10%) ⬇️
plugins-fs 38.67% <ø> (-0.11%) ⬇️
plugins-generic-pool 22.68% <ø> (ø)
plugins-google-cloud-pubsub 45.73% <ø> (-0.09%) ⬇️
plugins-grpc 41.29% <ø> (-0.10%) ⬇️
plugins-handlebars 23.71% <ø> (ø)
plugins-hapi 40.43% <ø> (-0.10%) ⬇️
plugins-hono 40.63% <ø> (-0.10%) ⬇️
plugins-ioredis 38.47% <ø> (-0.11%) ⬇️
plugins-knex 23.51% <ø> (ø)
plugins-ldapjs 21.28% <ø> (ø)
plugins-light-my-request 23.15% <ø> (ø)
plugins-limitd-client 32.55% <ø> (-0.11%) ⬇️
plugins-lodash 22.74% <ø> (ø)
plugins-mariadb 39.61% <ø> (-0.10%) ⬇️
plugins-memcached 38.20% <ø> (-0.11%) ⬇️
plugins-microgateway-core 39.44% <ø> (-0.10%) ⬇️
plugins-moleculer 40.84% <ø> (-0.10%) ⬇️
plugins-mongodb 39.55% <ø> (-0.10%) ⬇️
plugins-mongodb-core 39.13% <ø> (-0.10%) ⬇️
plugins-mongoose 39.18% <ø> (-0.10%) ⬇️
plugins-multer 23.46% <ø> (ø)
plugins-mysql 39.26% <ø> (-0.11%) ⬇️
plugins-mysql2 39.31% <ø> (-0.10%) ⬇️
plugins-node-serialize 23.73% <ø> (ø)
plugins-opensearch 37.88% <ø> (-0.10%) ⬇️
plugins-passport-http 23.56% <ø> (ø)
plugins-postgres 35.71% <ø> (-0.09%) ⬇️
plugins-process 22.88% <ø> (ø)
plugins-pug 23.69% <ø> (ø)
plugins-redis 38.95% <ø> (-0.11%) ⬇️
plugins-router 43.24% <ø> (-0.10%) ⬇️
plugins-sequelize 22.27% <ø> (ø)
plugins-test-and-upstream-amqp10 38.54% <ø> (+0.05%) ⬆️
plugins-test-and-upstream-amqplib 43.75% <ø> (-0.25%) ⬇️
plugins-test-and-upstream-apollo 39.32% <ø> (-0.09%) ⬇️
plugins-test-and-upstream-avsc 38.81% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-bunyan 33.86% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-connect 41.05% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-graphql 40.23% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-koa 40.63% <ø> (-0.10%) ⬇️
plugins-test-and-upstream-protobufjs 39.05% <ø> (-0.11%) ⬇️
plugins-test-and-upstream-rhea 44.15% <ø> (-0.10%) ⬇️
plugins-undici 39.40% <ø> (-0.10%) ⬇️
plugins-url 22.88% <ø> (ø)
plugins-valkey 38.28% <ø> (+0.05%) ⬆️
plugins-vm 22.88% <ø> (ø)
plugins-winston 34.27% <ø> (-0.10%) ⬇️
plugins-ws 42.21% <ø> (-0.10%) ⬇️
profiling-macos 40.06% <ø> (-0.10%) ⬇️
profiling-ubuntu 40.11% <ø> (-0.10%) ⬇️
profiling-windows 41.47% <ø> (-0.10%) ⬇️
serverless-azure-functions-client 22.38% <ø> (ø)
serverless-azure-functions-eventhubs 22.38% <ø> (ø)
serverless-azure-functions-servicebus 22.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@datadog-datadog-prod-us1

This comment has been minimized.

Tests the three key scenarios:
1. env var true, config unset → true (env var applies)
2. env var unset, config true → true (code option applies)
3. env var true, config false → false (code option takes precedence)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Feb 6, 2026

Benchmarks

Benchmark execution time: 2026-02-06 19:18:08

Comparing candidate commit cf17ed2 in PR branch jj.botha/add-dsm-to-startup-log with baseline commit 1630815 in branch master.

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

Exposes dsmEnabled as a documented, first-class option in dd.init().
The config system already supports this internally — this change just
makes it visible in the public TypeScript types.

When not provided, the value of DD_DATA_STREAMS_ENABLED env var is
used. When explicitly set, the code option takes precedence over the
env var (consistent with all other config options).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Copy Markdown
Contributor

@pabloerhard pabloerhard left a comment

Choose a reason for hiding this comment

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

LGTM!

@johannbotha
Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 bot commented Feb 6, 2026

View all feedbacks in Devflow UI.

2026-02-06 19:18:18 UTC ℹ️ Start processing command /merge


2026-02-06 19:18:29 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-02-06 19:43:16 UTC ℹ️ MergeQueue: queue is disabled

Added to the queue but the mergequeue is not enabled for now.


2026-02-06 20:58:29 UTC ℹ️ MergeQueue: This merge request was already merged

This pull request was merged directly.

@BridgeAR BridgeAR merged commit 52c89d2 into master Feb 6, 2026
799 of 801 checks passed
@BridgeAR BridgeAR deleted the jj.botha/add-dsm-to-startup-log branch February 6, 2026 20:58
dd-octo-sts bot pushed a commit that referenced this pull request Feb 6, 2026
* Add data_streams_enabled to startup log output

Go, Java, and .NET tracers already include data_streams_enabled in
the DATADOG TRACER CONFIGURATION startup log. This adds parity for
the Node.js tracer, making it easier to debug DSM configuration
issues in customer environments.

* Add test coverage for data_streams_enabled in startup log

Tests the three key scenarios:
1. env var true, config unset → true (env var applies)
2. env var unset, config true → true (code option applies)
3. env var true, config false → false (code option takes precedence)

* Add dsmEnabled to TracerOptions interface

Exposes dsmEnabled as a documented, first-class option in dd.init().
The config system already supports this internally — this change just
makes it visible in the public TypeScript types.

When not provided, the value of DD_DATA_STREAMS_ENABLED env var is
used. When explicitly set, the code option takes precedence over the
env var (consistent with all other config options).
@dd-octo-sts dd-octo-sts bot mentioned this pull request Feb 6, 2026
bm1549 pushed a commit that referenced this pull request Feb 10, 2026
* Add data_streams_enabled to startup log output

Go, Java, and .NET tracers already include data_streams_enabled in
the DATADOG TRACER CONFIGURATION startup log. This adds parity for
the Node.js tracer, making it easier to debug DSM configuration
issues in customer environments.

* Add test coverage for data_streams_enabled in startup log

Tests the three key scenarios:
1. env var true, config unset → true (env var applies)
2. env var unset, config true → true (code option applies)
3. env var true, config false → false (code option takes precedence)

* Add dsmEnabled to TracerOptions interface

Exposes dsmEnabled as a documented, first-class option in dd.init().
The config system already supports this internally — this change just
makes it visible in the public TypeScript types.

When not provided, the value of DD_DATA_STREAMS_ENABLED env var is
used. When explicitly set, the code option takes precedence over the
env var (consistent with all other config options).
dd-octo-sts bot pushed a commit that referenced this pull request Feb 10, 2026
* Add data_streams_enabled to startup log output

Go, Java, and .NET tracers already include data_streams_enabled in
the DATADOG TRACER CONFIGURATION startup log. This adds parity for
the Node.js tracer, making it easier to debug DSM configuration
issues in customer environments.

* Add test coverage for data_streams_enabled in startup log

Tests the three key scenarios:
1. env var true, config unset → true (env var applies)
2. env var unset, config true → true (code option applies)
3. env var true, config false → false (code option takes precedence)

* Add dsmEnabled to TracerOptions interface

Exposes dsmEnabled as a documented, first-class option in dd.init().
The config system already supports this internally — this change just
makes it visible in the public TypeScript types.

When not provided, the value of DD_DATA_STREAMS_ENABLED env var is
used. When explicitly set, the code option takes precedence over the
env var (consistent with all other config options).
@dd-octo-sts dd-octo-sts bot mentioned this pull request Feb 10, 2026
juan-fernandez pushed a commit that referenced this pull request Feb 12, 2026
* Add data_streams_enabled to startup log output

Go, Java, and .NET tracers already include data_streams_enabled in
the DATADOG TRACER CONFIGURATION startup log. This adds parity for
the Node.js tracer, making it easier to debug DSM configuration
issues in customer environments.

* Add test coverage for data_streams_enabled in startup log

Tests the three key scenarios:
1. env var true, config unset → true (env var applies)
2. env var unset, config true → true (code option applies)
3. env var true, config false → false (code option takes precedence)

* Add dsmEnabled to TracerOptions interface

Exposes dsmEnabled as a documented, first-class option in dd.init().
The config system already supports this internally — this change just
makes it visible in the public TypeScript types.

When not provided, the value of DD_DATA_STREAMS_ENABLED env var is
used. When explicitly set, the code option takes precedence over the
env var (consistent with all other config options).
BridgeAR pushed a commit that referenced this pull request Feb 22, 2026
* Add data_streams_enabled to startup log output

Go, Java, and .NET tracers already include data_streams_enabled in
the DATADOG TRACER CONFIGURATION startup log. This adds parity for
the Node.js tracer, making it easier to debug DSM configuration
issues in customer environments.

* Add test coverage for data_streams_enabled in startup log

Tests the three key scenarios:
1. env var true, config unset → true (env var applies)
2. env var unset, config true → true (code option applies)
3. env var true, config false → false (code option takes precedence)

* Add dsmEnabled to TracerOptions interface

Exposes dsmEnabled as a documented, first-class option in dd.init().
The config system already supports this internally — this change just
makes it visible in the public TypeScript types.

When not provided, the value of DD_DATA_STREAMS_ENABLED env var is
used. When explicitly set, the code option takes precedence over the
env var (consistent with all other config options).
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.

4 participants