FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add Queries support for the Neon serverless driver (`@neondatabase/serverless`) · Issue #25144 · getsentry/sentry-javascript · GitHub

Repository navigation

Add Queries support for the Neon serverless driver (@neondatabase/serverless) #25144

Description

Problem Statement

pg and postgres queries get db spans automatically (#8117). Queries through @neondatabase/serverless do not, so Neon apps, including Drizzle on neon-http or neon-serverless, show nothing in Queries Insights:

  • neon() (HTTP): only an http.client span, POST api.<region>.aws.neon.tech, with no SQL.
  • Pool / Client (WebSocket): no span at all.

The package bundles its own copy of pg and imports no outside modules (CJS or ESM), so the pg instrumentation never sees it.

Repro (runs select 1 with pg as the control): https://gist.github.com/sergical/debe1601f4e952f1a8605a8649c7b6ce#file-repro-cjs

Solution Brainstorm

A neonIntegration with the same span shape as postgresJsIntegration: op db, db.system.name: postgres, db.query.text, db.query.summary, db.operation.name, server.address, db.namespace.

  • HTTP: wrap query and transaction on the neon() function. NeonQueryPromise is lazy, and transaction() reads its queryData without running it, so wrap execute, not the query call. Otherwise batched queries get spans twice.
  • WebSocket: wrap Client.prototype.query, as the pg instrumentation does.

Userland version of the HTTP part, tested with Drizzle in a Next.js app: https://gist.github.com/sergical/debe1601f4e952f1a8605a8649c7b6ce#file-traced-neon-ts

Additional Context

@sentry/node 11.4.0, @neondatabase/serverless 1.1.0, pg 8, Node 24.

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL