{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/postgres/index.ts"],"sourcesContent":["import { PgInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\ninterface PostgresIntegrationOptions {\n ignoreConnectSpans?: boolean;\n}\n\nconst INTEGRATION_NAME = 'Postgres';\n\nexport const instrumentPostgres = generateInstrumentOnce(\n INTEGRATION_NAME,\n PgInstrumentation,\n (options?: PostgresIntegrationOptions) => ({\n requireParentSpan: true,\n requestHook(span) {\n addOriginToSpan(span, 'auto.db.otel.postgres');\n },\n ignoreConnectSpans: options?.ignoreConnectSpans ?? false,\n }),\n);\n\nconst _postgresIntegration = ((options?: PostgresIntegrationOptions) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentPostgres(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [pg](https://www.npmjs.com/package/pg) library.\n *\n * For more information, see the [`postgresIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/postgres/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.postgresIntegration()],\n * });\n * ```\n */\nexport const postgresIntegration = defineIntegration(_postgresIntegration);\n"],"names":[],"mappings":";;;;AASA,MAAM,gBAAA,GAAmB,UAAA;AAElB,MAAM,kBAAA,GAAqB,sBAAA;AAAA,EAChC,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,CAAC,OAAA,MAA0C;AAAA,IACzC,iBAAA,EAAmB,IAAA;AAAA,IACnB,YAAY,IAAA,EAAM;AAChB,MAAA,eAAA,CAAgB,MAAM,uBAAuB,CAAA;AAAA,IAC/C,CAAA;AAAA,IACA,kBAAA,EAAoB,SAAS,kBAAA,IAAsB;AAAA,GACrD;AACF;AAEA,MAAM,oBAAA,IAAwB,CAAC,OAAA,KAAyC;AACtE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,kBAAA,CAAmB,OAAO,CAAA;AAAA,IAC5B;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,mBAAA,GAAsB,kBAAkB,oBAAoB;;;;"}