Postgres.js for Hono
Adds instrumentation for the postgres (postgres.js) library.
Available since: v10.41.0
Import name: Sentry.instrumentPostgresJsSql
The instrumentPostgresJsSql helper adds instrumentation for the postgres (postgres.js) library to capture spans by wrapping a postgres.js sql tagged-template instance.
Type: boolean
Whether the instrumentation requires a parent span to create child spans. When set to true, spans are only created if there is an active parent span in the current scope.
Default: true
Type: (span: Span, sanitizedSqlQuery: string, postgresConnectionContext?: PostgresConnectionContext) => void
A hook called before each span is started. Use it to set additional attributes or modify the span.
Copied
const sql = Sentry.instrumentPostgresJsSql(postgres(env.DATABASE_URL), {
requestHook(span, query) {
span.setAttribute("custom.query", query);
},
});
const sql = Sentry.instrumentPostgresJsSql(postgres(env.DATABASE_URL), {
requestHook(span, query) {
span.setAttribute("custom.query", query);
},
});
Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").