Visitar URL original
feat(server-utils): Add the orchestrion config for @neondatabase/serverless by chargome · Pull Request #25176 · getsentry/sentry-javascript · GitHub
Skip to content

feat(server-utils): Add the orchestrion config for @neondatabase/serverless - #25176

Merged
chargome merged 1 commit into
feat/pg-export-query-span-helpersfrom
feat/neon-orchestrion-config
Oct 9, 2026
Merged

chargome merged 1 commit into
feat/pg-export-query-span-helpersfrom
feat/neon-orchestrion-config

Conversation

@chargome

@chargome chargome commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Adds the orchestrion config for @neondatabase/serverless, so the bundler plugins and the runtime hook can inject channels into it. The integration that subscribes to those channels follows in #25164 and registers the config there, which keeps every layer's CI green on its own.

The package ships two minified esbuild bundles with mangled identifiers that differ between CJS and ESM, so the name-based matchers find nothing. The selectors key on property names and string literals that survive minification: pg's _pulseQueryQueue sibling method for Client.prototype.query, the Neon-Connection-String header literal for the HTTP executor, and the resolvedURL return shape for the connection resolver.

@neondatabase/serverless becomes a dev dependency of server-utils for a test that transforms and executes the published bundles, so a Neon release that reshapes them fails CI. The version range is capped at <2.

Stacked on #25163.

Refs #25144

@chargome
chargome added this pull request to stack #25178 October 8, 2026 11:23
@chargome chargome self-assigned this Oct 8, 2026
@chargome

chargome commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

bugbot run

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 8cc649c. Configure here.

@github-actions

github-actions Bot commented Oct 8, 2026 •

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 29.8 kB - -
@sentry/browser - with treeshaking flags 27.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.84 kB - -
@sentry/browser (incl. Tracing) 51.85 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.87 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.8 kB - -
@sentry/browser (incl. Tracing, Replay) 91.58 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.45 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 96.29 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 109.27 kB - -
@sentry/browser (incl. Feedback) 47.32 kB - -
@sentry/browser (incl. sendFeedback) 34.84 kB - -
@sentry/browser (incl. FeedbackAsync) 39.95 kB - -
@sentry/browser (incl. Metrics) 30.82 kB - -
@sentry/browser (incl. Logs) 31.11 kB - -
@sentry/browser (incl. Metrics & Logs) 31.75 kB - -
@sentry/react 31.63 kB - -
@sentry/react (incl. Tracing) 54.17 kB - -
@sentry/vue 37.84 kB - -
@sentry/vue (incl. Tracing) 54.78 kB - -
@sentry/svelte 29.83 kB - -
@sentry/remix (Remix 3 client bundle) 56.83 kB - -
CDN Bundle 31.53 kB - -
CDN Bundle (incl. Tracing) 52.34 kB - -
CDN Bundle (incl. Logs, Metrics) 33.72 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.3 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.65 kB - -
CDN Bundle (incl. Tracing, Replay) 90.01 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.17 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.15 kB - -
CDN Bundle - uncompressed 92.92 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.46 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.46 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 161.41 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.5 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.63 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 281.57 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 289.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.26 kB - -
@sentry/nextjs (client) 56.53 kB - -
@sentry/sveltekit (client) 52.23 kB - -
@sentry/core/server 40.86 kB - -
@sentry/core/browser 13.71 kB - -
@sentry/node 151.04 kB +0.04% +53 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.59 kB - -
@sentry/node - without tracing 94.01 kB +0.01% +4 B 🔺
@sentry/node - without channel injection 129.21 kB +0.05% +59 B 🔺
@sentry/aws-serverless 102.17 kB +0.01% +7 B 🔺
@sentry/cloudflare (withSentry) - minified 209.81 kB - -
@sentry/cloudflare (withSentry) 520.23 kB - -
@sentry/nextjs/cloudflare (withSentry) - minified 227.48 kB - -

View base workflow run

@chargome
chargome marked this pull request as ready for review October 8, 2026 15:04
@chargome
chargome requested a review from a team as a code owner October 8, 2026 15:04
@chargome
chargome requested review from JPeer264, andreiborza and isaacs and removed request for a team October 8, 2026 15:04

@JPeer264 JPeer264 left a comment

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.

LGTM, just one comment. Integration tests will come in a later PR in the stack

// `_pulseQueryQueue`), decoy `query` methods on the pool and protocol classes, the `neon()`
// factory with its nested HTTP executor, and the connection-string resolver.
const body = `
var Qx=class{query(e){this._send(e)}};

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.

l/m: Couldn't we directly use the body from their exports? This might break in the next version without us knowing and we also have to manually keep this updated, which we probably miss.

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.

done!

@chargome
chargome force-pushed the feat/neon-orchestrion-config branch from 8cc649c to fb0610b Compare October 9, 2026 09:55
…erless

The package ships two minified esbuild bundles with mangled identifiers
that differ between CJS and ESM, so the name-based matchers find nothing.
The selectors key on property names and string literals that survive
minification: pg's _pulseQueryQueue sibling for Client.prototype.query, the
Neon-Connection-String header literal for the HTTP executor, and the
resolvedURL return shape for the connection resolver.

The config is not registered yet; the integration that subscribes to its
channels registers it. A test transforms and executes the published
bundles, so a Neon release that reshapes them fails CI.

Refs #25144
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chargome
chargome force-pushed the feat/neon-orchestrion-config branch from fb0610b to e20131f Compare October 9, 2026 10:08
@chargome
chargome merged commit 541c8cf into develop Oct 9, 2026
707 of 711 checks passed
@chargome
chargome deleted the feat/neon-orchestrion-config branch October 9, 2026 10:41
chargome added a commit that referenced this pull request Oct 9, 2026
Adds `neonIntegration` for `@neondatabase/serverless`. Both drivers emit
`db` spans with the pg span shape: the WebSocket `Client`/`Pool` and the
HTTP `neon()` function, including Drizzle's `neon-http` and
`neon-serverless` adapters.

Subscribes to the channels from #25176 and registers the config, so
build-time bundler plugins get the same coverage as the runtime hook.

- The HTTP span wraps the executor inside `neon()`, not the lazy query
promise, so `transaction()` batches get one span instead of one per
statement plus one for the batch.
- Connection attributes for HTTP come from the connection resolver,
which runs inside the query span. The executor itself never sees the
connection string.
- `db.connection_string` is deprecated and not emitted.

End-to-end tests follow in #25177.

Stacked on #25176.

Fixes #25144

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.

2 participants