Skip to content

feat(ws): add websocket context propagation#7077

Merged
tlhunter merged 6 commits intomasterfrom
tlhunter/websocket-context-propagation
Dec 19, 2025
Merged

feat(ws): add websocket context propagation#7077
tlhunter merged 6 commits intomasterfrom
tlhunter/websocket-context-propagation

Conversation

@tlhunter
Copy link
Copy Markdown
Member

@tlhunter tlhunter commented Dec 10, 2025

What does this PR do?

  • adds context propagation for websocket messages sent using the ws package

Motivation

  • feature parity with the other tracers
  • spec

@tlhunter tlhunter added semver-minor integration-ws AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos labels Dec 10, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 10, 2025

Overall package size

Self size: 4.36 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

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 82.05128% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.77%. Comparing base (d9a3a8e) to head (fc06332).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
packages/datadog-plugin-ws/src/close.js 47.61% 11 Missing ⚠️
packages/datadog-plugin-ws/src/util.js 86.95% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7077      +/-   ##
==========================================
- Coverage   84.78%   84.77%   -0.02%     
==========================================
  Files         521      522       +1     
  Lines       22155    22232      +77     
==========================================
+ Hits        18785    18848      +63     
- Misses       3370     3384      +14     

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

Comment thread packages/dd-trace/src/supported-configurations.json Outdated
Comment thread packages/dd-trace/src/config_defaults.js Outdated
Comment thread packages/dd-trace/src/config.js Outdated
@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Dec 10, 2025

Benchmarks

Benchmark execution time: 2025-12-18 16:57:21

Comparing candidate commit fc06332 in PR branch tlhunter/websocket-context-propagation with baseline commit d9a3a8e in branch master.

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

Comment thread packages/datadog-plugin-ws/src/util.js Outdated
@tlhunter tlhunter force-pushed the tlhunter/websocket-context-propagation branch from 47328cc to 3f28727 Compare December 11, 2025 23:58
Comment thread packages/datadog-plugin-ws/src/receiver.js Outdated
@tlhunter tlhunter marked this pull request as ready for review December 12, 2025 00:34
@tlhunter tlhunter requested review from a team as code owners December 12, 2025 00:34
@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Dec 16, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: fc06332 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@tlhunter tlhunter force-pushed the tlhunter/websocket-context-propagation branch from 491e130 to 0923bc5 Compare December 17, 2025 18:45
@tlhunter tlhunter force-pushed the tlhunter/websocket-context-propagation branch from 3821bab to fc06332 Compare December 18, 2025 16:49
Copy link
Copy Markdown
Collaborator

@crysmags crysmags left a comment

Choose a reason for hiding this comment

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

All looks good here :)

@tlhunter tlhunter merged commit 261e8ec into master Dec 19, 2025
1028 of 1034 checks passed
@tlhunter tlhunter deleted the tlhunter/websocket-context-propagation branch December 19, 2025 19:57
// Determine prefix based on server/client and incoming/outgoing
// Server outgoing or client incoming: 'S'
// Server incoming or client outgoing: 'C'
const prefix = (isServer && !isIncoming) || (!isServer && isIncoming) ? 'S' : 'C'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const prefix = (isServer && !isIncoming) || (!isServer && isIncoming) ? 'S' : 'C'
const prefix = isServer !== isIncoming ? 'S' : 'C'

@dd-octo-sts dd-octo-sts Bot mentioned this pull request Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos integration-ws semver-minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants