Skip to content

feat(server-utils): Migrate postgres.js instrumentation to orchestrion - #21983

Merged
andreiborza merged 5 commits into
developfrom
ab/postgresjs-orchestrion
Jul 8, 2026
Merged

feat(server-utils): Migrate postgres.js instrumentation to orchestrion#21983
andreiborza merged 5 commits into
developfrom
ab/postgresjs-orchestrion

Conversation

@andreiborza

@andreiborzaandreiborza commented Jul 6, 2026

Copy link
Copy Markdown
Member

Adds an orchestrion (diagnostics-channel injection) based postgres.js (postgres v3.x) integration to server-utils, covering query spans and connection attributes at parity with the OTel integration. Leaves the existing OTel PostgresJsInstrumentation intact (it's swapped out when injection is enabled) and reuses the core query/connection helpers via _INTERNAL_ re-exports rather than duplicating them.

Fixes#20921

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@andreiborza
andreiborza requested a review from a team as a code ownerJuly 6, 2026 12:39
@andreiborza
andreiborza requested review from JPeer264 and mydea and removed request for a team and JPeer264July 6, 2026 12:39
@andreiborza

Copy link
Copy Markdown
MemberAuthor

bugbot run

@andreiborza
andreiborza removed the request for review from mydeaJuly 6, 2026 12:43

@cursorcursorBot 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 0300e4a. Configure here.

@github-actions

github-actionsBot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser27.59 kB--
@sentry/browser - with treeshaking flags26.03 kB--
@sentry/browser (incl. Tracing)46.27 kB--
@sentry/browser (incl. Tracing + Span Streaming)48.03 kB--
@sentry/browser (incl. Tracing, Profiling)51.03 kB--
@sentry/browser (incl. Tracing, Replay)85.56 kB--
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags75.17 kB--
@sentry/browser (incl. Tracing, Replay with Canvas)90.26 kB--
@sentry/browser (incl. Tracing, Replay, Feedback)102.91 kB--
@sentry/browser (incl. Feedback)44.76 kB--
@sentry/browser (incl. sendFeedback)32.38 kB--
@sentry/browser (incl. FeedbackAsync)37.51 kB--
@sentry/browser (incl. Metrics)28.67 kB--
@sentry/browser (incl. Logs)28.91 kB--
@sentry/browser (incl. Metrics & Logs)29.59 kB--
@sentry/react29.38 kB--
@sentry/react (incl. Tracing)48.53 kB--
@sentry/vue33.03 kB--
@sentry/vue (incl. Tracing)48.16 kB--
@sentry/svelte27.61 kB--
CDN Bundle30 kB--
CDN Bundle (incl. Tracing)48.26 kB--
CDN Bundle (incl. Logs, Metrics)31.57 kB--
CDN Bundle (incl. Tracing, Logs, Metrics)49.57 kB--
CDN Bundle (incl. Replay, Logs, Metrics)70.81 kB--
CDN Bundle (incl. Tracing, Replay)85.73 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)87.04 kB--
CDN Bundle (incl. Tracing, Replay, Feedback)91.55 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)92.83 kB--
CDN Bundle - uncompressed89.35 kB--
CDN Bundle (incl. Tracing) - uncompressed145.99 kB--
CDN Bundle (incl. Logs, Metrics) - uncompressed94.05 kB--
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed149.96 kB--
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed218.75 kB--
CDN Bundle (incl. Tracing, Replay) - uncompressed265.16 kB--
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed269.12 kB--
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed278.86 kB--
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed282.81 kB--
@sentry/nextjs (client)50.94 kB--
@sentry/sveltekit (client)46.68 kB--
@sentry/core/server78.43 kB+0.06%+45 B 🔺
@sentry/core/browser64.74 kB--
@sentry/node-core63.21 kB--
@sentry/node124.73 kB-0.01%-5 B 🔽
@sentry/node (incl. diagnostics channel injection)131.75 kB+0.6%+774 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection)69.95 kB--
@sentry/node/light50.72 kB--
@sentry/node - without tracing74.82 kB--
@sentry/aws-serverless85.59 kB-0.01%-1 B 🔽
@sentry/cloudflare (withSentry) - minified181.68 kB--
@sentry/cloudflare (withSentry)449.39 kB--

View base workflow run

Comment threadpackages/server-utils/src/integrations/tracing-channel/postgres-js/utils.ts Outdated

@cursorcursorBot 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 c65871a. Configure here.

Comment threadpackages/server-utils/src/orchestrion/index.ts

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


const ORIGIN = 'auto.db.orchestrion.postgresjs';

// Not part of `@sentry/conventions`, so we keep it inline (matches the OTel `PostgresJsInstrumentation`).

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.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Right, but it's not yet released in the npm package. We can fix that once we release that and bump across the repo.

@andreiborza
andreiborza merged commit f0fc230 into developJul 8, 2026
584 of 586 checks passed
@andreiborza
andreiborza deleted the ab/postgresjs-orchestrion branch July 8, 2026 09:40
Sign up for freeto 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.

Rewrite PostgresJsInstrumentation to orchestrion

2 participants

@andreiborza@chargome