Skip to content

fix: Stop using Azure's EventHubs batch spanContext map for storing DD span contexts#6943

Merged
BridgeAR merged 18 commits intomasterfrom
storms/refactor-event-hubs-batch-contexts
Jan 8, 2026
Merged

fix: Stop using Azure's EventHubs batch spanContext map for storing DD span contexts#6943
BridgeAR merged 18 commits intomasterfrom
storms/refactor-event-hubs-batch-contexts

Conversation

@jcstorms1
Copy link
Copy Markdown
Contributor

@jcstorms1 jcstorms1 commented Nov 18, 2025

What does this PR do?

  • Stores our span contexts in a weakMap
  • Fixes failed tests on node 18 for the crypto package
  • Adds a regression test for incorrect usage of tracePromise on a synchronous function
  • Adds a regression test for using Azure's eventDataBatch._spanContexts map

Motivation

Originally we used Azure's built in spanContext map to store span context for our span links. This could cause conflicts with Azure Application Inights if OTel is enabled, because Azure uses this map to generate their span links.

Plugin Checklist

Additional Notes

@jcstorms1 jcstorms1 requested review from a team as code owners November 18, 2025 19:41
@jcstorms1 jcstorms1 changed the title fix: Stop using Azure's EventHubClient spanContext map for storing span contexts fix: Stop using Azure's EventHubs batch spanContext map for storing DD span contexts Nov 18, 2025
@jcstorms1 jcstorms1 changed the title fix: Stop using Azure's EventHubs batch spanContext map for storing DD span contexts Stop using Azure's EventHubs batch spanContext map for storing DD span contexts Nov 18, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.52%. Comparing base (a035e9b) to head (42c7423).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6943   +/-   ##
=======================================
  Coverage   84.52%   84.52%           
=======================================
  Files         527      527           
  Lines       22534    22534           
=======================================
  Hits        19047    19047           
  Misses       3487     3487           

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

@jcstorms1 jcstorms1 changed the title Stop using Azure's EventHubs batch spanContext map for storing DD span contexts fix: Stop using Azure's EventHubs batch spanContext map for storing DD span contexts Nov 18, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Nov 18, 2025

Overall package size

Self size: 4.37 MB
Deduped: 5.19 MB
No deduping: 5.19 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

Copy link
Copy Markdown
Member

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

The tests are sadly still failing

Comment thread packages/datadog-plugin-azure-event-hubs/test/integration-test/client.spec.js Outdated
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Nov 21, 2025

Benchmarks

Benchmark execution time: 2026-01-08 10:42:49

Comparing candidate commit 42c7423 in PR branch storms/refactor-event-hubs-batch-contexts with baseline commit a035e9b in branch master.

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

@jcstorms1 jcstorms1 requested a review from BridgeAR November 21, 2025 15:36
Copy link
Copy Markdown
Member

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

Could you please add a regression test that checks that ctx.batch._spanContexts is not changed anymore?

@datadog-datadog-prod-us1

This comment has been minimized.

@jcstorms1 jcstorms1 requested a review from BridgeAR December 24, 2025 17:29
Comment thread packages/datadog-plugin-azure-event-hubs/src/producer.js
Comment thread packages/datadog-plugin-azure-event-hubs/src/producer.js
Comment thread packages/datadog-instrumentations/src/azure-event-hubs.js Outdated
Comment thread integration-tests/helpers/index.js Outdated
@jcstorms1 jcstorms1 requested a review from BridgeAR January 5, 2026 19:19
BridgeAR
BridgeAR previously approved these changes Jan 5, 2026
Copy link
Copy Markdown
Member

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

LGTM, while it would be nice to undo the unrelated changes :)

Comment thread integration-tests/helpers/index.js Outdated
BridgeAR
BridgeAR previously approved these changes Jan 5, 2026
Copy link
Copy Markdown
Member

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

LGTM, it would just be nice if the unrelated changes could be undone before landing :)

BridgeAR
BridgeAR previously approved these changes Jan 6, 2026
Copy link
Copy Markdown
Member

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

LGTM! Thank you for cleaning things up :)

Comment thread integration-tests/helpers/index.js Outdated
@BridgeAR BridgeAR force-pushed the storms/refactor-event-hubs-batch-contexts branch from f7cc36c to 42c7423 Compare January 8, 2026 10:34
@BridgeAR BridgeAR merged commit 22211b0 into master Jan 8, 2026
1166 of 1170 checks passed
@BridgeAR BridgeAR deleted the storms/refactor-event-hubs-batch-contexts branch January 8, 2026 11:07
@dd-octo-sts dd-octo-sts Bot mentioned this pull request Jan 12, 2026
dd-octo-sts Bot pushed a commit that referenced this pull request Jan 12, 2026
…6943)

An incorrect usage of tracePromise on a synchronous function is fixed as well using the proper context for spans. Formerly Azure's EventHubs batch context was used for that.
nina9753 pushed a commit that referenced this pull request Jan 15, 2026
…6943)

An incorrect usage of tracePromise on a synchronous function is fixed as well using the proper context for spans. Formerly Azure's EventHubs batch context was used for that.
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.

3 participants