{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/kafka/index.ts"],"sourcesContent":["import { KafkaJsInstrumentation } 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 = 'Kafka';\n\nexport const instrumentKafka = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new KafkaJsInstrumentation({\n consumerHook(span) {\n addOriginToSpan(span, 'auto.kafkajs.otel.consumer');\n },\n producerHook(span) {\n addOriginToSpan(span, 'auto.kafkajs.otel.producer');\n },\n }),\n);\n\nconst _kafkaIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentKafka();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [kafkajs](https://www.npmjs.com/package/kafkajs) library.\n *\n * For more information, see the [`kafkaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/kafka/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.kafkaIntegration()],\n * });\n */\nexport const kafkaIntegration = defineIntegration(_kafkaIntegration);\n"],"names":["generateInstrumentOnce","KafkaJsInstrumentation","addOriginToSpan","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,OAAA;AAElB,MAAM,eAAA,GAAkBA,+BAAA;AAAA,EAC7B,gBAAA;AAAA,EACA,MACE,IAAIC,sCAAA,CAAuB;AAAA,IACzB,aAAa,IAAA,EAAM;AACjB,MAAAC,wBAAA,CAAgB,MAAM,4BAA4B,CAAA;AAAA,IACpD,CAAA;AAAA,IACA,aAAa,IAAA,EAAM;AACjB,MAAAA,wBAAA,CAAgB,MAAM,4BAA4B,CAAA;AAAA,IACpD;AAAA,GACD;AACL;AAEA,MAAM,qBAAqB,MAAM;AAC/B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,eAAA,EAAgB;AAAA,IAClB;AAAA,GACF;AACF,CAAA,CAAA;AAeO,MAAM,gBAAA,GAAmBC,uBAAkB,iBAAiB;;;;;"}