Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
3.0 KiB
Plaintext
1 line
3.0 KiB
Plaintext
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/anthropic-ai/index.ts"],"sourcesContent":["import type { AnthropicAiOptions, IntegrationFn } from '@sentry/core';\nimport { ANTHROPIC_AI_INTEGRATION_NAME, defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { SentryAnthropicAiInstrumentation } from './instrumentation';\n\nexport const instrumentAnthropicAi = generateInstrumentOnce<AnthropicAiOptions>(\n ANTHROPIC_AI_INTEGRATION_NAME,\n options => new SentryAnthropicAiInstrumentation(options),\n);\n\nconst _anthropicAIIntegration = ((options: AnthropicAiOptions = {}) => {\n return {\n name: ANTHROPIC_AI_INTEGRATION_NAME,\n options,\n setupOnce() {\n instrumentAnthropicAi(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the Anthropic AI SDK.\n *\n * This integration is enabled by default.\n *\n * When configured, this integration automatically instruments Anthropic AI SDK client instances\n * to capture telemetry data following OpenTelemetry Semantic Conventions for Generative AI.\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.init({\n * integrations: [Sentry.anthropicAIIntegration()],\n * });\n * ```\n *\n * ## Options\n *\n * - `recordInputs`: Whether to record prompt messages (default: respects `sendDefaultPii` client option)\n * - `recordOutputs`: Whether to record response text (default: respects `sendDefaultPii` client option)\n *\n * ### Default Behavior\n *\n * By default, the integration will:\n * - Record inputs and outputs ONLY if `sendDefaultPii` is set to `true` in your Sentry client options\n * - Otherwise, inputs and outputs are NOT recorded unless explicitly enabled\n *\n * @example\n * ```javascript\n * // Record inputs and outputs when sendDefaultPii is false\n * Sentry.init({\n * integrations: [\n * Sentry.anthropicAIIntegration({\n * recordInputs: true,\n * recordOutputs: true\n * })\n * ],\n * });\n *\n * // Never record inputs/outputs regardless of sendDefaultPii\n * Sentry.init({\n * sendDefaultPii: true,\n * integrations: [\n * Sentry.anthropicAIIntegration({\n * recordInputs: false,\n * recordOutputs: false\n * })\n * ],\n * });\n * ```\n *\n */\nexport const anthropicAIIntegration = defineIntegration(_anthropicAIIntegration);\n"],"names":[],"mappings":";;;;AAKO,MAAM,qBAAA,GAAwB,sBAAsB;AAC3D,EAAE,6BAA6B;AAC/B,EAAE,WAAW,IAAI,gCAAgC,CAAC,OAAO,CAAC;AAC1D;;AAEA,MAAM,uBAAA,IAA2B,CAAC,OAAO,GAAuB,EAAE,KAAK;AACvE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,6BAA6B;AACvC,IAAI,OAAO;AACX,IAAI,SAAS,GAAG;AAChB,MAAM,qBAAqB,CAAC,OAAO,CAAC;AACpC,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,sBAAA,GAAyB,iBAAiB,CAAC,uBAAuB;;;;"} |