Skip to content

Conversation

@jcstorms1
Copy link
Contributor

@jcstorms1 jcstorms1 commented Nov 18, 2025

What does this PR do?

  • Stores our span contexts in a weakMap

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

codecov bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.83%. Comparing base (19a7bfc) to head (f11e330).
⚠️ Report is 98 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6943      +/-   ##
==========================================
+ Coverage   84.60%   84.83%   +0.23%     
==========================================
  Files         505      515      +10     
  Lines       21165    22022     +857     
==========================================
+ Hits        17907    18683     +776     
- Misses       3258     3339      +81     

☔ 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

github-actions bot commented Nov 18, 2025

Overall package size

Self size: 3.58 MB
Deduped: 4.46 MB
No deduping: 4.46 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 1.15.0 | 127.66 kB | 856.24 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
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.

The tests are sadly still failing


const spawnEnv = { DD_TRACE_FLUSH_INTERVAL: '2000' }

// TODO: Fix this test / esm issue
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// TODO: Fix this test / esm issue

Copy link
Contributor Author

@jcstorms1 jcstorms1 Nov 21, 2025

Choose a reason for hiding this comment

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

The test is skipped again. As long as we pass the azure-functions tests we know my change is working.

@pr-commenter
Copy link

pr-commenter bot commented Nov 21, 2025

Benchmarks

Benchmark execution time: 2025-12-12 16:00:27

Comparing candidate commit f11e330 in PR branch storms/refactor-event-hubs-batch-contexts with baseline commit 19a7bfc in branch master.

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

@jcstorms1 jcstorms1 requested a review from BridgeAR November 21, 2025 15:36
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.

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.

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