Skip to content

feat(deno): add Express integration#20060

Draft
isaacs wants to merge 1 commit intodevelopfrom
isaacschlueter/js-2030-deno-express-integration
Draft

feat(deno): add Express integration#20060
isaacs wants to merge 1 commit intodevelopfrom
isaacschlueter/js-2030-deno-express-integration

Conversation

@isaacs
Copy link
Copy Markdown
Member

@isaacs isaacs commented Mar 31, 2026

This adds the patchExpressModule function from @sentry/core, along with a short integration test.

Note that the express integration only takes effect if some other span is already started for the http server handler. A future port of the OpenTelemetryJS http instrumentation can provide this in a manner consistent to the Sentry Node SDK.

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.

Closes #JS-2030 #20058

This adds the `patchExpressModule` function from `@sentry/core`, along
with a short integration test.

Note that the express integration only takes effect if some *other* span
is already started for the http server handler. A future port of the
OpenTelemetryJS http instrumentation can provide this in a manner
consistent to the Sentry Node SDK.
@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 31, 2026

@isaacs isaacs marked this pull request as draft March 31, 2026 20:08
@github-actions
Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (core, node) Portable Express integration by isaacs in #19928
  • (deno) Add Express integration by isaacs in #20060

Internal Changes 🔧

  • (core) Remove provider-specific AI span attributes in favor of gen_ai attributes in sentry conventions by nicohrubec in #20011

🤖 This preview updates automatically when you update the PR.

Copy link
Copy Markdown

@cursor cursor bot left a comment

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 2 potential issues.

Fix All in Cursor

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

setupOpenTelemetryTracer();
}

setAsyncLocalStorageAsyncContextStrategy();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reinit resets async context strategy

Medium Severity

Calling setAsyncLocalStorageAsyncContextStrategy() inside every init() replaces the global async context strategy each time. If init() runs again while requests are in flight, existing async chains keep running but getCurrentScope() starts reading from a new AsyncLocalStorage, which can drop or mix request scope data.

Fix in Cursor Fix in Web

responses = await Promise.all([
fetch(`http://localhost:15443/user/user1/error/true`),
fetch(`http://localhost:15443/user/user2`),
fetch(`http://localhost:15443/user/user3/error/true`),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Express test ignores configured port

Low Severity

The server listens on PORT, but requests are sent to hardcoded 15443. When process.env.PORT is set, listen(PORT) and fetch('http://localhost:15443/...') target different ports, causing false test failures unrelated to patchExpressModule.

Additional Locations (1)
Fix in Cursor Fix in Web

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 25.65 kB +0.02% +5 B 🔺
@sentry/browser - with treeshaking flags 24.14 kB +0.03% +5 B 🔺
@sentry/browser (incl. Tracing) 42.16 kB +0.02% +7 B 🔺
@sentry/browser (incl. Tracing, Profiling) 46.77 kB +0.02% +9 B 🔺
@sentry/browser (incl. Tracing, Replay) 80.94 kB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.56 kB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 85.66 kB +0.01% +8 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 97.92 kB +0.01% +5 B 🔺
@sentry/browser (incl. Feedback) 42.42 kB +0.02% +6 B 🔺
@sentry/browser (incl. sendFeedback) 30.31 kB +0.02% +6 B 🔺
@sentry/browser (incl. FeedbackAsync) 35.29 kB +0.02% +6 B 🔺
@sentry/browser (incl. Metrics) 26.96 kB +0.03% +7 B 🔺
@sentry/browser (incl. Logs) 27.11 kB +0.03% +7 B 🔺
@sentry/browser (incl. Metrics & Logs) 27.78 kB +0.03% +7 B 🔺
@sentry/react 27.41 kB +0.03% +6 B 🔺
@sentry/react (incl. Tracing) 44.48 kB +0.02% +5 B 🔺
@sentry/vue 30.08 kB +0.02% +5 B 🔺
@sentry/vue (incl. Tracing) 44.05 kB +0.02% +8 B 🔺
@sentry/svelte 25.67 kB +0.02% +5 B 🔺
CDN Bundle 28.32 kB +0.03% +6 B 🔺
CDN Bundle (incl. Tracing) 43.11 kB +0.02% +6 B 🔺
CDN Bundle (incl. Logs, Metrics) 29.68 kB +0.02% +4 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 44.16 kB +0.02% +7 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 68.48 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing, Replay) 80.01 kB +0.01% +7 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.05 kB +0.01% +6 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 85.55 kB +0.01% +5 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.58 kB +0.01% +6 B 🔺
CDN Bundle - uncompressed 82.68 kB +0.03% +22 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 127.83 kB +0.02% +22 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 86.83 kB +0.03% +22 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 131.24 kB +0.02% +22 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 209.81 kB +0.02% +22 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.7 kB +0.01% +22 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 248.1 kB +0.01% +22 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 257.62 kB +0.01% +22 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 261 kB +0.01% +22 B 🔺
@sentry/nextjs (client) 46.9 kB +0.02% +7 B 🔺
@sentry/sveltekit (client) 42.62 kB +0.02% +7 B 🔺
@sentry/node-core 55.77 kB +0.04% +17 B 🔺
@sentry/node 172.29 kB -0.27% -466 B 🔽
@sentry/node - without tracing 96.05 kB +0.05% +40 B 🔺
@sentry/aws-serverless 112.81 kB +0.03% +30 B 🔺

View base workflow run

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.

1 participant