Skip to content

fix(bullmq): trace context injection and orchestrion file extensions#7669

Merged
wconti27 merged 7 commits intomasterfrom
conti/bullmq-fixes
Mar 4, 2026
Merged

fix(bullmq): trace context injection and orchestrion file extensions#7669
wconti27 merged 7 commits intomasterfrom
conti/bullmq-fixes

Conversation

@wconti27
Copy link
Copy Markdown
Contributor

@wconti27 wconti27 commented Mar 4, 2026

Summary

  • Place trace context in metadata field: Moves the bullmq trace context into the opts.telemetry.metadata field for correct context propagation bullmq trace context wrong location
  • Convert bullmq.json to bullmq.js module: Importing a JSON file without its .json extension is non-standard and breaks with bundlers like nx/rollup. Converts the rewriter instrumentation config from JSON to a JS module for compatibility. Fixes this comment: bullmq .json extensions problem
  • Clean up trace metadata after consumer extraction: Deletes the telemetry metadata from job opts after extracting trace and DSM context in the consumer, preventing internal trace data from leaking to user code (e.g. breaking strict zod schema validation). Fixes a portion of [FEATURE]: Provide some way to exclude code from tracing #7641

wconti27 and others added 3 commits February 10, 2026 11:14
Importing a JSON file without its extension is non-standard and breaks
with bundlers like nx/rollup. Convert to a JS module for compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wconti27 wconti27 requested a review from a team as a code owner March 4, 2026 12:53
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Overall package size

Self size: 4.89 MB
Deduped: 5.74 MB
No deduping: 5.74 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 816.75 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 Mar 4, 2026

Codecov Report

❌ Patch coverage is 96.29630% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.30%. Comparing base (ed37311) to head (6e1675c).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
packages/datadog-plugin-bullmq/src/producer.js 94.59% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7669   +/-   ##
=======================================
  Coverage   80.29%   80.30%           
=======================================
  Files         738      739    +1     
  Lines       31897    31926   +29     
=======================================
+ Hits        25611    25637   +26     
- Misses       6286     6289    +3     
Flag Coverage Δ
aiguard-macos 38.93% <100.00%> (-0.10%) ⬇️
aiguard-ubuntu 39.05% <100.00%> (-0.10%) ⬇️
aiguard-windows 38.79% <100.00%> (-0.10%) ⬇️
apm-capabilities-tracing-macos 48.74% <1.85%> (-0.10%) ⬇️
apm-capabilities-tracing-ubuntu 48.82% <1.85%> (-0.06%) ⬇️
apm-capabilities-tracing-windows 48.51% <1.85%> (-0.10%) ⬇️
apm-integrations-child-process 38.51% <100.00%> (-0.10%) ⬇️
apm-integrations-couchbase-18 37.44% <100.00%> (+0.05%) ⬆️
apm-integrations-couchbase-eol 37.92% <100.00%> (+0.05%) ⬆️
apm-integrations-oracledb 37.75% <100.00%> (-0.09%) ⬇️
appsec-express 55.35% <100.00%> (-0.08%) ⬇️
appsec-fastify 51.67% <100.00%> (-0.07%) ⬇️
appsec-graphql 51.86% <100.00%> (-0.07%) ⬇️
appsec-kafka 44.40% <100.00%> (-0.02%) ⬇️
appsec-ldapjs 44.03% <100.00%> (-0.08%) ⬇️
appsec-lodash 43.69% <100.00%> (-0.08%) ⬇️
appsec-macos 58.35% <100.00%> (-0.07%) ⬇️
appsec-mongodb-core 48.85% <100.00%> (-0.08%) ⬇️
appsec-mongoose 49.52% <100.00%> (-0.08%) ⬇️
appsec-mysql 50.89% <100.00%> (-0.07%) ⬇️
appsec-node-serialize 43.21% <100.00%> (-0.08%) ⬇️
appsec-passport 47.66% <100.00%> (-0.08%) ⬇️
appsec-postgres 50.59% <100.00%> (-0.11%) ⬇️
appsec-sourcing 42.61% <100.00%> (-0.08%) ⬇️
appsec-template 43.37% <100.00%> (-0.08%) ⬇️
appsec-ubuntu 58.43% <100.00%> (-0.07%) ⬇️
appsec-windows 58.22% <100.00%> (-0.07%) ⬇️
instrumentations-instrumentation-bluebird 32.31% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-body-parser 40.49% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-child_process 37.84% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-cookie-parser 34.31% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-express 34.65% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-express-mongo-sanitize 34.45% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-express-session 40.12% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-fs 31.92% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-generic-pool 29.75% <100.00%> (+0.01%) ⬆️
instrumentations-instrumentation-http 39.84% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-knex 32.32% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-mongoose 33.46% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-multer 40.24% <100.00%> (-0.09%) ⬇️
instrumentations-instrumentation-mysql2 38.30% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-passport 44.02% <100.00%> (-0.08%) ⬇️
instrumentations-instrumentation-passport-http 43.69% <100.00%> (-0.08%) ⬇️
instrumentations-instrumentation-passport-local 44.23% <100.00%> (-0.08%) ⬇️
instrumentations-instrumentation-pg 37.73% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-promise 32.24% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-promise-js 32.25% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-q 32.29% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-url 32.21% <100.00%> (-0.10%) ⬇️
instrumentations-instrumentation-when 32.26% <100.00%> (-0.10%) ⬇️
llmobs-ai 41.96% <100.00%> (-0.09%) ⬇️
llmobs-anthropic 40.30% <100.00%> (-0.09%) ⬇️
llmobs-bedrock 39.25% <100.00%> (-0.08%) ⬇️
llmobs-google-genai 39.83% <100.00%> (-0.09%) ⬇️
llmobs-langchain 39.76% <100.00%> (-0.07%) ⬇️
llmobs-openai 44.14% <100.00%> (-0.09%) ⬇️
llmobs-vertex-ai 40.10% <100.00%> (-0.02%) ⬇️
platform-core 31.53% <ø> (ø)
platform-esbuild 34.48% <ø> (ø)
platform-instrumentations-misc 44.00% <100.00%> (+0.06%) ⬆️
platform-shimmer 37.63% <ø> (ø)
platform-unit-guardrails 32.95% <ø> (ø)
plugins-azure-event-hubs 25.83% <100.00%> (+0.11%) ⬆️
plugins-azure-service-bus 25.19% <100.00%> (+0.11%) ⬆️
plugins-bullmq 43.87% <96.29%> (+0.04%) ⬆️
plugins-cassandra 37.79% <100.00%> (-0.09%) ⬇️
plugins-cookie 26.89% <100.00%> (+0.11%) ⬆️
plugins-cookie-parser 26.67% <100.00%> (+0.11%) ⬆️
plugins-crypto 26.79% <ø> (ø)
plugins-dd-trace-api 38.37% <100.00%> (-0.10%) ⬇️
plugins-express-mongo-sanitize 26.82% <100.00%> (+0.11%) ⬆️
plugins-express-session 26.63% <100.00%> (+0.11%) ⬆️
plugins-fastify 42.23% <100.00%> (-0.09%) ⬇️
plugins-fetch 38.33% <100.00%> (-0.09%) ⬇️
plugins-fs 38.62% <100.00%> (-0.10%) ⬇️
plugins-generic-pool 25.87% <100.00%> (+0.11%) ⬆️
plugins-google-cloud-pubsub 45.37% <100.00%> (-0.08%) ⬇️
plugins-grpc 40.94% <100.00%> (-0.09%) ⬇️
plugins-handlebars 26.86% <100.00%> (+0.11%) ⬆️
plugins-hapi 40.13% <100.00%> (-0.09%) ⬇️
plugins-hono 40.39% <100.00%> (-0.09%) ⬇️
plugins-ioredis 38.42% <100.00%> (-0.10%) ⬇️
plugins-knex 26.50% <100.00%> (+0.11%) ⬆️
plugins-ldapjs 24.36% <100.00%> (+0.11%) ⬆️
plugins-light-my-request 26.23% <100.00%> (+0.11%) ⬆️
plugins-limitd-client 32.61% <100.00%> (-0.10%) ⬇️
plugins-lodash 25.96% <100.00%> (+0.11%) ⬆️
plugins-mariadb 39.49% <100.00%> (-0.10%) ⬇️
plugins-memcached 38.17% <100.00%> (-0.10%) ⬇️
plugins-microgateway-core 39.17% <100.00%> (-0.09%) ⬇️
plugins-moleculer 40.51% <100.00%> (-0.09%) ⬇️
plugins-mongodb 39.20% <100.00%> (-0.09%) ⬇️
plugins-mongodb-core 39.03% <100.00%> (-0.10%) ⬇️
plugins-mongoose 38.85% <100.00%> (-0.09%) ⬇️
plugins-multer 26.63% <100.00%> (+0.11%) ⬆️
plugins-mysql 39.17% <100.00%> (-0.10%) ⬇️
plugins-mysql2 39.27% <100.00%> (-0.10%) ⬇️
plugins-node-serialize 26.93% <100.00%> (+0.11%) ⬆️
plugins-opensearch 37.62% <100.00%> (-0.09%) ⬇️
plugins-passport-http 26.68% <100.00%> (+0.11%) ⬆️
plugins-postgres 35.72% <100.00%> (-0.08%) ⬇️
plugins-process 26.79% <ø> (ø)
plugins-pug 26.89% <100.00%> (+0.11%) ⬆️
plugins-redis 38.89% <100.00%> (-0.10%) ⬇️
plugins-router 42.97% <100.00%> (-0.09%) ⬇️
plugins-sequelize 25.47% <100.00%> (+0.11%) ⬆️
plugins-test-and-upstream-amqp10 38.35% <100.00%> (-0.24%) ⬇️
plugins-test-and-upstream-amqplib 43.83% <100.00%> (-0.09%) ⬇️
plugins-test-and-upstream-apollo 39.03% <100.00%> (-0.08%) ⬇️
plugins-test-and-upstream-avsc 38.71% <100.00%> (-0.10%) ⬇️
plugins-test-and-upstream-bunyan 33.88% <100.00%> (-0.10%) ⬇️
plugins-test-and-upstream-connect 40.79% <100.00%> (-0.09%) ⬇️
plugins-test-and-upstream-graphql 40.14% <100.00%> (-0.09%) ⬇️
plugins-test-and-upstream-koa 40.37% <100.00%> (-0.09%) ⬇️
plugins-test-and-upstream-protobufjs 38.93% <100.00%> (-0.10%) ⬇️
plugins-test-and-upstream-rhea 44.02% <100.00%> (-0.10%) ⬇️
plugins-undici 39.11% <100.00%> (-0.09%) ⬇️
plugins-url 26.79% <ø> (ø)
plugins-valkey 38.09% <100.00%> (-0.10%) ⬇️
plugins-vm 26.79% <ø> (ø)
plugins-winston 34.07% <100.00%> (-0.09%) ⬇️
plugins-ws 41.88% <100.00%> (-0.09%) ⬇️
profiling-macos 39.83% <100.00%> (-0.10%) ⬇️
profiling-ubuntu 39.96% <100.00%> (-0.10%) ⬇️
profiling-windows 41.17% <100.00%> (-0.09%) ⬇️
serverless-azure-functions-client 25.54% <100.00%> (+0.11%) ⬆️
serverless-azure-functions-eventhubs 25.54% <100.00%> (+0.11%) ⬆️
serverless-azure-functions-servicebus 25.54% <100.00%> (+0.11%) ⬆️

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.

@wconti27 wconti27 self-assigned this Mar 4, 2026
Delete the telemetry metadata from job opts after extracting the trace
and DSM context in the consumer. This prevents internal trace data from
leaking to user code, which can cause issues with strict schema
validation (e.g. zod).

Fixes #7641

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@datadog-datadog-prod-us1

This comment has been minimized.

@wconti27 wconti27 changed the title fix(bullmq): trace context placement and bundler compatibility fix(bullmq): trace context injection and orchestrion file extensions Mar 4, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Mar 4, 2026

Benchmarks

Benchmark execution time: 2026-03-04 13:40:19

Comparing candidate commit 6e1675c in PR branch conti/bullmq-fixes with baseline commit ed37311 in branch master.

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

wconti27 and others added 2 commits March 4, 2026 08:27
Store dd-trace context under the _datadog key within the telemetry
metadata JSON object instead of using the entire metadata field. This
preserves any other telemetry metadata that may exist. On the consumer
side, only the _datadog key is extracted and removed, leaving the rest
of the metadata intact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wconti27 wconti27 merged commit 34bf8e5 into master Mar 4, 2026
842 of 844 checks passed
@wconti27 wconti27 deleted the conti/bullmq-fixes branch March 4, 2026 14:42
dd-octo-sts Bot pushed a commit that referenced this pull request Mar 5, 2026
…7669)

move bullmq trace context into opts.telemetry.metadata json string. delete propagated job context after consumption. fix bullmq orchestrion file extension
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Mar 5, 2026
juan-fernandez pushed a commit that referenced this pull request Mar 5, 2026
…7669)

move bullmq trace context into opts.telemetry.metadata json string. delete propagated job context after consumption. fix bullmq orchestrion file extension
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