Skip to content

ref(node): Refactor some otel internals in http integrations#22292

Merged
mydea merged 2 commits into
developfrom
fn/httpServerDe-otel
Jul 15, 2026
Merged

ref(node): Refactor some otel internals in http integrations#22292
mydea merged 2 commits into
developfrom
fn/httpServerDe-otel

Conversation

@mydea

@mydea mydea commented Jul 15, 2026

Copy link
Copy Markdown
Member

This refactors some http integration internals to use core APIs instead of OTEL APIs:

  • We can just use bindScopeToEmitter directly now for outgoing requests, this is no longer OTEL specific and thus does not need to be in node-core specifically
  • Refactored http server spans integration to use our own Span APIs. There is still some rpc metadata stuff in there that can be removed in v11 but needs to stay for now for compatibility.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2e9ba2e. Configure here.

response.resume();
}
setIncomingResponseSpanData(response, span);
bindScopeToEmitter(response);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Response binding omits active span

Medium Severity

Outgoing HTTP responses call bindScopeToEmitter without first activating the outgoing http.client span. bindScopeToEmitter freezes whatever scope is current at bind time, but that span is created via startInactiveSpan, so listeners on the response stream later run without that span active and child spans can attach to the wrong parent.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2e9ba2e. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is fine and also how it was before, the emitter should not have the span as parent as that could break parent-child relationships 🤔

@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.65 kB - -
@sentry/browser - with treeshaking flags 26.09 kB - -
@sentry/browser (incl. Tracing) 46.41 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.2 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.19 kB - -
@sentry/browser (incl. Tracing, Replay) 85.67 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.3 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.38 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.04 kB - -
@sentry/browser (incl. Feedback) 44.83 kB - -
@sentry/browser (incl. sendFeedback) 32.45 kB - -
@sentry/browser (incl. FeedbackAsync) 37.57 kB - -
@sentry/browser (incl. Metrics) 28.73 kB - -
@sentry/browser (incl. Logs) 28.97 kB - -
@sentry/browser (incl. Metrics & Logs) 29.66 kB - -
@sentry/react 29.45 kB - -
@sentry/react (incl. Tracing) 48.67 kB - -
@sentry/vue 33.08 kB - -
@sentry/vue (incl. Tracing) 48.39 kB - -
@sentry/svelte 27.67 kB - -
CDN Bundle 30.05 kB - -
CDN Bundle (incl. Tracing) 48.4 kB - -
CDN Bundle (incl. Logs, Metrics) 31.63 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.7 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.86 kB - -
CDN Bundle (incl. Tracing, Replay) 85.89 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.69 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.96 kB - -
CDN Bundle - uncompressed 89.58 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.32 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.28 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.3 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.01 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.53 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 269.49 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.18 kB - -
@sentry/nextjs (client) 51.22 kB - -
@sentry/sveltekit (client) 46.86 kB - -
@sentry/core/server 78.51 kB +0.01% +4 B 🔺
@sentry/core/browser 64.85 kB - -
@sentry/node-core 63.32 kB +0.85% +531 B 🔺
@sentry/node 125.3 kB +0.09% +101 B 🔺
@sentry/node (incl. diagnostics channel injection) 140.26 kB +0.02% +27 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.96 kB - -
@sentry/node/light 51.21 kB +0.83% +420 B 🔺
@sentry/node - without tracing 74.61 kB +0.59% +437 B 🔺
@sentry/aws-serverless 83.83 kB +0.54% +445 B 🔺
@sentry/cloudflare (withSentry) - minified 181.78 kB - -
@sentry/cloudflare (withSentry) 449.94 kB - -

View base workflow run

@mydea
mydea marked this pull request as ready for review July 15, 2026 12:51
@mydea
mydea requested a review from a team as a code owner July 15, 2026 12:51
@mydea
mydea requested review from logaretm, nicohrubec and s1gr1d and removed request for a team July 15, 2026 12:51
@mydea
mydea merged commit e46a781 into develop Jul 15, 2026
312 checks passed
@mydea
mydea deleted the fn/httpServerDe-otel branch July 15, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants