Skip to content

Commit 01f61fd

Browse files
chargomeclaude
andcommitted
feat(node): Add neonIntegration for @neondatabase/serverless
Queries through the Neon serverless driver produced no db spans: the package bundles its own pg, so the pg instrumentation never sees it, and the HTTP driver only showed an http.client span without SQL. Both drivers are now instrumented through orchestrion, so build-time bundler plugins get the same coverage as the runtime hook. The package ships two minified esbuild bundles with mangled identifiers, so the selectors key on property names and string literals that survive minification. The WebSocket driver reuses the pg query span builder. The HTTP executor inside neon() gets one span per request, covering sql.query(), tagged templates and transaction() batches without double counting lazy query promises. Connection attributes for HTTP come from the resolver call that runs inside that span. A unit test transforms and executes the published bundles, so a Neon release that reshapes them fails CI instead of silently dropping spans. Fixes #25144 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 03d5c1f commit 01f61fd

21 files changed

Lines changed: 700 additions & 0 deletions

File tree

‎packages/astro/src/index.server.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ export {
108108
pinoIntegration,
109109
postgresIntegration,
110110
postgresJsIntegration,
111+
neonIntegration,
111112
prismaIntegration,
112113
openTelemetryIntegration,
113114
getOtlpTracesEndpoint,

‎packages/aws-serverless/src/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export {
128128
pinoIntegration,
129129
postgresIntegration,
130130
postgresJsIntegration,
131+
neonIntegration,
131132
processSessionIntegration,
132133
prismaIntegration,
133134
openTelemetryIntegration,

‎packages/bun/src/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export {
149149
tediousIntegration,
150150
postgresIntegration,
151151
postgresJsIntegration,
152+
neonIntegration,
152153
prismaIntegration,
153154
openTelemetryIntegration,
154155
getOtlpTracesEndpoint,

‎packages/deno/src/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export {
155155
typesafeIntegration,
156156
postgresIntegration,
157157
postgresJsIntegration,
158+
neonIntegration,
158159
tediousIntegration,
159160
eveConversationHook,
160161
eveIntegration,

‎packages/elysia/src/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export {
128128
tediousIntegration,
129129
postgresIntegration,
130130
postgresJsIntegration,
131+
neonIntegration,
131132
prismaIntegration,
132133
processSessionIntegration,
133134
hapiIntegration,

‎packages/google-cloud-serverless/src/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export {
128128
pinoIntegration,
129129
postgresIntegration,
130130
postgresJsIntegration,
131+
neonIntegration,
131132
prismaIntegration,
132133
openTelemetryIntegration,
133134
getOtlpTracesEndpoint,

‎packages/node/src/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export {
3737
typesafeIntegration,
3838
postgresIntegration,
3939
postgresJsIntegration,
40+
neonIntegration,
4041
redisIntegration,
4142
tediousIntegration,
4243
vercelAIIntegration,

‎packages/server-utils/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
},
103103
"devDependencies": {
104104
"@apm-js-collab/code-transformer-bundler-plugins": "^0.7.4",
105+
"@neondatabase/serverless": "1.2.0",
105106
"@types/node": "^18.19.1",
106107
"meriyah": "^6.1.4",
107108
"vite": "^8.3.1"

‎packages/server-utils/src/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export { mysql2Integration } from './integrations/mysql2';
6666
export { openAIIntegration } from './integrations/openai';
6767
export { postgresIntegration } from './integrations/postgres';
6868
export { postgresJsIntegration } from './integrations/postgres-js';
69+
export { neonIntegration } from './integrations/neon';
6970
export { tediousIntegration } from './integrations/tedious';
7071
export { vercelAIIntegration } from './integrations/vercel-ai';
7172
export { expressIntegration } from './integrations/express';

‎packages/server-utils/src/integrations/index.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { groqIntegration } from './groq';
2626
import { togetherAIIntegration } from './together-ai';
2727
import { typesafeIntegration } from './typesafe';
2828
import { postgresJsIntegration } from './postgres-js';
29+
import { neonIntegration } from './neon';
2930
import { firebaseIntegration } from './firebase';
3031
import { expressIntegration } from './express';
3132
import { fastifyIntegration } from './fastify';
@@ -68,6 +69,7 @@ export function getTracingIntegrations(): Integration[] {
6869
togetherAIIntegration(),
6970
typesafeIntegration(),
7071
postgresJsIntegration(),
72+
neonIntegration(),
7173
firebaseIntegration(),
7274
mcpServerIntegration(),
7375
];

0 commit comments

Comments
 (0)