{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/mysql2/index.ts"],"sourcesContent":["import { MySQL2Instrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mysql2';\n\nexport const instrumentMysql2 = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MySQL2Instrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mysql2');\n },\n }),\n);\n\nconst _mysql2Integration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql2();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library.\n *\n * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysql2Integration = defineIntegration(_mysql2Integration);\n"],"names":["generateInstrumentOnce","MySQL2Instrumentation","addOriginToSpan","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,QAAA;AAElB,MAAM,gBAAA,GAAmBA,+BAAA;AAAA,EAC9B,gBAAA;AAAA,EACA,MACE,IAAIC,qCAAA,CAAsB;AAAA,IACxB,aAAa,IAAA,EAAM;AACjB,MAAAC,wBAAA,CAAgB,MAAM,qBAAqB,CAAA;AAAA,IAC7C;AAAA,GACD;AACL;AAEA,MAAM,sBAAsB,MAAM;AAChC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,gBAAA,EAAiB;AAAA,IACnB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,iBAAA,GAAoBC,uBAAkB,kBAAkB;;;;;"}