ref(server-utils): Move postgres.js instrumentation and SQL utils out of core - #23828
Open
mydea wants to merge 1 commit into
Open
ref(server-utils): Move postgres.js instrumentation and SQL utils out of core#23828mydea wants to merge 1 commit into
mydea wants to merge 1 commit into
Conversation
… of core Moves the postgres.js SQL instrumentation (`instrumentPostgresJsSql` and its helpers) and the shared SQL query utils (`getSqlQuerySummary`, `sanitizeSqlQuery`, `SqlDialect`) out of `@sentry/core/server` into `@sentry/server-utils`, and drops the `_INTERNAL_` prefix these carried on the core entrypoint. `utils/sql` was only consumed inside core by `integrations/postgresjs`, so the two move together. The postgres-specific helpers (`_reconstructQuery`, `_buildConnectionContext`, `_getConnectionAttributes`, `_getOperationName`) were only ever used by server-utils' own `postgres-js` integration, so they are now plain relative imports rather than re-exported API. `instrumentPostgresJsSql` and the SQL summary/sanitize utils stay public because `@sentry/cloudflare` and `@sentry/deno` consume them — those keep re-exporting `instrumentPostgresJsSql` under the same name, so there is no user-facing change. `postgresjs` only depended on the public `@sentry/core` API (plus server-utils' own `debug-build` and `utils/sql`), so nothing had to be promoted to core's public surface. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
mydea
marked this pull request as ready for review
September 1, 2026 11:57
mydea
requested review from
JPeer264 and
isaacs
and removed request for
a team
September 1, 2026 11:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the postgres.js SQL instrumentation and the shared SQL query utils out of
@sentry/core/serverinto@sentry/server-utils, and drops the_INTERNAL_prefix they carried on the core entrypoint.Moved to
@sentry/server-utils:instrumentPostgresJsSql(+ its internal helpers)getSqlQuerySummary,sanitizeSqlQuery,SqlDialect,PostgresConnectionContextWhy they move together:
utils/sqlwas only consumed inside core byintegrations/postgresjs, so neither had an internal-to-core dependency blocking the move.postgresjsonly imports the public@sentry/coreAPI (plus server-utils' owndebug-build/utils/sql), so nothing had to be promoted to core's public surface.API shape:
_INTERNAL_prefix dropped).@sentry/cloudflareand@sentry/denore-exportinstrumentPostgresJsSqlunder the same name and@sentry/cloudflareusesgetSqlQuerySummary/sanitizeSqlQueryinternally, so there is no user-facing change._reconstructQuery,_buildConnectionContext,_getConnectionAttributes,_getOperationName) were only used by server-utils' ownpostgres-jsintegration, so they are now plain module-relative imports rather than exported API.Tests for
utils/sqlandpostgresjswere relocated into@sentry/server-utilsand their spies retargeted to the public@sentry/corenamespace.