{"version":3,"file":"amqplib.js","sources":["../../../../src/integrations/tracing/amqplib.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { AmqplibInstrumentation, type AmqplibInstrumentationConfig } from '@opentelemetry/instrumentation-amqplib';\nimport { defineIntegration } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst INTEGRATION_NAME = 'Amqplib';\n\nconst config: AmqplibInstrumentationConfig = {\n consumeEndHook: (span: Span) => {\n addOriginToSpan(span, 'auto.amqplib.otel.consumer');\n },\n publishHook: (span: Span) => {\n addOriginToSpan(span, 'auto.amqplib.otel.publisher');\n },\n};\n\nexport const instrumentAmqplib = generateInstrumentOnce(INTEGRATION_NAME, () => new AmqplibInstrumentation(config));\n\nconst _amqplibIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentAmqplib();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [amqplib](https://www.npmjs.com/package/amqplib) library.\n *\n * For more information, see the [`amqplibIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/amqplib/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.amqplibIntegration()],\n * });\n * ```\n */\nexport const amqplibIntegration = defineIntegration(_amqplibIntegration);\n"],"names":[],"mappings":";;;;;AAOA,MAAM,gBAAA,GAAmB,SAAS;;AAElC,MAAM,MAAM,GAAiC;AAC7C,EAAE,cAAc,EAAE,CAAC,IAAI,KAAW;AAClC,IAAI,eAAe,CAAC,IAAI,EAAE,4BAA4B,CAAC;AACvD,GAAG;AACH,EAAE,WAAW,EAAE,CAAC,IAAI,KAAW;AAC/B,IAAI,eAAe,CAAC,IAAI,EAAE,6BAA6B,CAAC;AACxD,GAAG;AACH,CAAC;;AAEY,MAAA,iBAAA,GAAoB,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,IAAI,sBAAsB,CAAC,MAAM,CAAC;;AAElH,MAAM,mBAAoB,IAAG,MAAM;AACnC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,iBAAiB,EAAE;AACzB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,kBAAmB,GAAE,iBAAiB,CAAC,mBAAmB;;;;"}