@sentry/node
Advanced tools
@@ -6,3 +6,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
| const supportedVersions = [">=4.0.0 <7"]; | ||
| const supportedVersions = [">=4.0.0 <8"]; | ||
| class SentryOpenAiInstrumentation extends instrumentation.InstrumentationBase { | ||
@@ -9,0 +9,0 @@ constructor(config = {}) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing/openai/instrumentation.ts"],"sourcesContent":["import {\n InstrumentationBase,\n type InstrumentationConfig,\n type InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n} from '@opentelemetry/instrumentation';\nimport type { Integration, OpenAiClient, OpenAiOptions } from '@sentry/core';\nimport {\n _INTERNAL_shouldSkipAiProviderWrapping,\n instrumentOpenAiClient,\n OPENAI_INTEGRATION_NAME,\n SDK_VERSION,\n} from '@sentry/core';\n\nconst supportedVersions = ['>=4.0.0 <7'];\n\nexport interface OpenAiIntegration extends Integration {\n options: OpenAiOptions;\n}\n\ntype OpenAiInstrumentationOptions = InstrumentationConfig & OpenAiOptions;\n\n/**\n * Represents the patched shape of the OpenAI module export.\n */\ninterface PatchedModuleExports {\n [key: string]: unknown;\n OpenAI: abstract new (...args: unknown[]) => OpenAiClient;\n AzureOpenAI?: abstract new (...args: unknown[]) => OpenAiClient;\n}\n\n/**\n * Sentry OpenAI instrumentation using OpenTelemetry.\n */\nexport class SentryOpenAiInstrumentation extends InstrumentationBase<OpenAiInstrumentationOptions> {\n public constructor(config: OpenAiInstrumentationOptions = {}) {\n super('@sentry/instrumentation-openai', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation by defining the modules to be patched.\n */\n public init(): InstrumentationModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition('openai', supportedVersions, this._patch.bind(this));\n return module;\n }\n\n /**\n * Core patch logic applying instrumentation to the OpenAI and AzureOpenAI client constructors.\n */\n private _patch(exports: PatchedModuleExports): PatchedModuleExports | void {\n let result = exports;\n result = this._patchClient(result, 'OpenAI');\n result = this._patchClient(result, 'AzureOpenAI');\n return result;\n }\n\n /**\n * Patch logic applying instrumentation to the specified client constructor.\n */\n private _patchClient(exports: PatchedModuleExports, exportKey: 'OpenAI' | 'AzureOpenAI'): PatchedModuleExports {\n const Original = exports[exportKey];\n if (!Original) {\n return exports;\n }\n\n const config = this.getConfig();\n\n const WrappedOpenAI = function (this: unknown, ...args: unknown[]) {\n // Check if wrapping should be skipped (e.g., when LangChain is handling instrumentation)\n if (_INTERNAL_shouldSkipAiProviderWrapping(OPENAI_INTEGRATION_NAME)) {\n return Reflect.construct(Original, args) as OpenAiClient;\n }\n\n const instance = Reflect.construct(Original, args);\n\n return instrumentOpenAiClient(instance as OpenAiClient, config);\n } as unknown as abstract new (...args: unknown[]) => OpenAiClient;\n\n // Preserve static and prototype chains\n Object.setPrototypeOf(WrappedOpenAI, Original);\n Object.setPrototypeOf(WrappedOpenAI.prototype, Original.prototype);\n\n for (const key of Object.getOwnPropertyNames(Original)) {\n if (!['length', 'name', 'prototype'].includes(key)) {\n const descriptor = Object.getOwnPropertyDescriptor(Original, key);\n if (descriptor) {\n Object.defineProperty(WrappedOpenAI, key, descriptor);\n }\n }\n }\n\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n try {\n exports[exportKey] = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, exportKey, {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n\n // Wrap the default export if it points to the original constructor\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n if (exports.default === Original) {\n try {\n exports.default = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, 'default', {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n }\n return exports;\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","Instrum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;AAAA,UACd,UAAA,EAAY;AAAA,SACb,CAAA;AAAA,MACH;AAAA,IACF;AACA,IAAA,OAAO,OAAA;AAAA,EACT;AACF;;;;"} | ||
| {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing/openai/instrumentation.ts"],"sourcesContent":["import {\n InstrumentationBase,\n type InstrumentationConfig,\n type InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n} from '@opentelemetry/instrumentation';\nimport type { Integration, OpenAiClient, OpenAiOptions } from '@sentry/core';\nimport {\n _INTERNAL_shouldSkipAiProviderWrapping,\n instrumentOpenAiClient,\n OPENAI_INTEGRATION_NAME,\n SDK_VERSION,\n} from '@sentry/core';\n\nconst supportedVersions = ['>=4.0.0 <8'];\n\nexport interface OpenAiIntegration extends Integration {\n options: OpenAiOptions;\n}\n\ntype OpenAiInstrumentationOptions = InstrumentationConfig & OpenAiOptions;\n\n/**\n * Represents the patched shape of the OpenAI module export.\n */\ninterface PatchedModuleExports {\n [key: string]: unknown;\n OpenAI: abstract new (...args: unknown[]) => OpenAiClient;\n AzureOpenAI?: abstract new (...args: unknown[]) => OpenAiClient;\n}\n\n/**\n * Sentry OpenAI instrumentation using OpenTelemetry.\n */\nexport class SentryOpenAiInstrumentation extends InstrumentationBase<OpenAiInstrumentationOptions> {\n public constructor(config: OpenAiInstrumentationOptions = {}) {\n super('@sentry/instrumentation-openai', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation by defining the modules to be patched.\n */\n public init(): InstrumentationModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition('openai', supportedVersions, this._patch.bind(this));\n return module;\n }\n\n /**\n * Core patch logic applying instrumentation to the OpenAI and AzureOpenAI client constructors.\n */\n private _patch(exports: PatchedModuleExports): PatchedModuleExports | void {\n let result = exports;\n result = this._patchClient(result, 'OpenAI');\n result = this._patchClient(result, 'AzureOpenAI');\n return result;\n }\n\n /**\n * Patch logic applying instrumentation to the specified client constructor.\n */\n private _patchClient(exports: PatchedModuleExports, exportKey: 'OpenAI' | 'AzureOpenAI'): PatchedModuleExports {\n const Original = exports[exportKey];\n if (!Original) {\n return exports;\n }\n\n const config = this.getConfig();\n\n const WrappedOpenAI = function (this: unknown, ...args: unknown[]) {\n // Check if wrapping should be skipped (e.g., when LangChain is handling instrumentation)\n if (_INTERNAL_shouldSkipAiProviderWrapping(OPENAI_INTEGRATION_NAME)) {\n return Reflect.construct(Original, args) as OpenAiClient;\n }\n\n const instance = Reflect.construct(Original, args);\n\n return instrumentOpenAiClient(instance as OpenAiClient, config);\n } as unknown as abstract new (...args: unknown[]) => OpenAiClient;\n\n // Preserve static and prototype chains\n Object.setPrototypeOf(WrappedOpenAI, Original);\n Object.setPrototypeOf(WrappedOpenAI.prototype, Original.prototype);\n\n for (const key of Object.getOwnPropertyNames(Original)) {\n if (!['length', 'name', 'prototype'].includes(key)) {\n const descriptor = Object.getOwnPropertyDescriptor(Original, key);\n if (descriptor) {\n Object.defineProperty(WrappedOpenAI, key, descriptor);\n }\n }\n }\n\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n try {\n exports[exportKey] = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, exportKey, {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n\n // Wrap the default export if it points to the original constructor\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n if (exports.default === Original) {\n try {\n exports.default = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, 'default', {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n }\n return exports;\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","_INTERNAL_shouldSkipAiProviderWrapping","OPENAI_INTEGRATION_NAME","instrumentOpenAiClient"],"mappings":";;;;;AAcA,MAAM,iBAAA,GAAoB,CAAC,YAAY,CAA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perty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
| } | ||
| function experimentalUseDiagnosticsChannelInjection(options) { | ||
| function experimentalUseDiagnosticsChannelInjection(_options) { | ||
| diagnosticsChannelInjection.setDiagnosticsChannelInjectionLoader(() => { | ||
@@ -26,3 +26,3 @@ const integrations = Object.values(orchestrion.channelIntegrations).map((createIntegration) => createIntegration()); | ||
| replacedOtelIntegrationNames, | ||
| register: () => register.registerDiagnosticsChannelInjection(options), | ||
| register: () => register.registerDiagnosticsChannelInjection(), | ||
| detect: orchestrion.detectOrchestrionSetup | ||
@@ -29,0 +29,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import {\n channelIntegrations,\n ioredisChannelIntegration,\n redisChannelIntegration,\n detectOrchestrionSetup,\n} from '@sentry/server-utils/orchestrion';\nimport type { RegisterDiagnosticsChannelInjectionOptions } from '@sentry/server-utils/orchestrion/register';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport { cacheResponseHook } from '../integrations/tracing/redis/cache';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\nexport function diagnosticsChannelInjectionIntegrations(): typeof channelIntegrations {\n return channelIntegrations;\n}\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(\n // Forwarded to `registerDiagnosticsChannelInjection()`; framework SDKs whose bundlers compile\n // the SDK into the app (e.g. `@sentry/nextjs`) use it to point the runtime module hook at the\n // tracing-hooks package location resolved at build time. Plain Node apps don't need it.\n options?: RegisterDiagnosticsChannelInjectionOptions,\n): void {\n setDiagnosticsChannelInjectionLoader((): DiagnosticsChannelInjection => {\n // These channel integrations 1:1 replace the OTel integration of the\n // same name. Framework SDKs that own their own channel listener\n // (e.g. `@sentry/nestjs`'s `Nest`) are NOT here. They pick the\n // channel-vs-OTel path themselves at integration `setupOnce`, so\n // there's nothing for the central swap to do.\n const integrations = Object.values(channelIntegrations).map(createIntegration => createIntegration());\n const replacedOtelIntegrationNames = integrations.map(i => i.name);\n\n return {\n // ioredis and redis are wired separately (not in `channelIntegrations`): they need the node\n // redis cache `responseHook` and only partially replace the composite OTel `Redis` integration,\n // so they're kept OUT of `replacedOtelIntegrationNames` — `Redis` must stay (batch + >=5.11 native DC).\n integrations: [\n ...integrations,\n ioredisChannelIntegration({ responseHook: cacheResponseHook }),\n redisChannelIntegration({ responseHook: cacheResponseHook }),\n ],\n replacedOtelIntegrationNames,\n register: () => registerDiagnosticsChannelInjection(options),\n detect: detectOrchestrionSetup,\n };\n });\n}\n"],"names":["channelIntegrations","setDiagnosticsChannelInjectionLoader","ioredisChannelIntegration","cacheResponseHook","redisChannelIntegration","registerDiagnosticsChannelInjection","detectOrchestrionSetup"],"mappings":";;;;;;;AAYO,SAAS,uCAAA,GAAsE;AACpF,EAAA,OAAOA,+BAAA;AACT;AAkCO,SAAS,2CAId,OAAA,EACM;AACN,EAAAC,gEAAA,CAAqC,MAAmC;AAMtE,IAAA,MAAM,YAAA,GAAe,OAAO,MAAA,CAAOD,+BAAmB,EAAE,GAAA,CAAI,CAAA,iBAAA,KAAqB,mBAAmB,CAAA;AACpG,IAAA,MAAM,4BAAA,GAA+B,YAAA,CAAa,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,IAAI,CAAA;AAEjE,IAAA,OAAO;AAAA;AAAA;AAAA;AAAA,MAIL,YAAA,EAAc;AAAA,QACZ,GAAG,YAAA;AAAA,QACHE,qCAAA,CAA0B,EAAE,YAAA,EAAcC,uBAAA,EAAmB,CAAA;AAAA,QAC7DC,mCAAA,CAAwB,EAAE,YAAA,EAAcD,uBAAA,EAAmB;AAAA,OAC7D;AAAA,MACA,4BAAA;AAAA,MACA,QAAA,EAAU,MAAME,4CAAA,CAAoC,OAAO,CAAA;AAAA,MAC3D,MAAA,EAAQC;AAAA,KACV;AAAA,EACF,CAAC,CAAA;AACH;;;;;"} | ||
| {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import {\n channelIntegrations,\n ioredisChannelIntegration,\n redisChannelIntegration,\n detectOrchestrionSetup,\n} from '@sentry/server-utils/orchestrion';\nimport type { RegisterDiagnosticsChannelInjectionOptions } from '@sentry/server-utils/orchestrion/register';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport { cacheResponseHook } from '../integrations/tracing/redis/cache';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\nexport function diagnosticsChannelInjectionIntegrations(): typeof channelIntegrations {\n return channelIntegrations;\n}\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(\n // Kept for backwards compatibility only; every field is deprecated and ignored.\n _options?: RegisterDiagnosticsChannelInjectionOptions,\n): void {\n setDiagnosticsChannelInjectionLoader((): DiagnosticsChannelInjection => {\n // These channel integrations 1:1 replace the OTel integration of the\n // same name. Framework SDKs that own their own channel listener\n // (e.g. `@sentry/nestjs`'s `Nest`) are NOT here. They pick the\n // channel-vs-OTel path themselves at integration `setupOnce`, so\n // there's nothing for the central swap to do.\n const integrations = Object.values(channelIntegrations).map(createIntegration => createIntegration());\n const replacedOtelIntegrationNames = integrations.map(i => i.name);\n\n return {\n // ioredis and redis are wired separately (not in `channelIntegrations`): they need the node\n // redis cache `responseHook` and only partially replace the composite OTel `Redis` integration,\n // so they're kept OUT of `replacedOtelIntegrationNames` — `Redis` must stay (batch + >=5.11 native DC).\n integrations: [\n ...integrations,\n ioredisChannelIntegration({ responseHook: cacheResponseHook }),\n redisChannelIntegration({ responseHook: cacheResponseHook }),\n ],\n replacedOtelIntegrationNames,\n register: () => registerDiagnosticsChannelInjection(),\n detect: detectOrchestrionSetup,\n };\n });\n}\n"],"names":["channelIntegrations","setDiagnosticsChannelInjectionLoader","ioredisChannelIntegration","cacheResponseHook","redisChannelIntegration","registerDiagnosticsChannelInjection","detectOrchestrionSetup"],"mappings":";;;;;;;AAYO,SAAS,uCAAA,GAAsE;AACpF,EAAA,OAAOA,+BAAA;AACT;AAkCO,SAAS,2CAEd,QAAA,EACM;AACN,EAAAC,gEAAA,CAAqC,MAAmC;AAMtE,IAAA,MAAM,YAAA,GAAe,OAAO,MAAA,CAAOD,+BAAmB,EAAE,GAAA,CAAI,CAAA,iBAAA,KAAqB,mBAAmB,CAAA;AACpG,IAAA,MAAM,4BAAA,GAA+B,YAAA,CAAa,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,IAAI,CAAA;AAEjE,IAAA,OAAO;AAAA;AAAA;AAAA;AAAA,MAIL,YAAA,EAAc;AAAA,QACZ,GAAG,YAAA;AAAA,QACHE,qCAAA,CAA0B,EAAE,YAAA,EAAcC,uBAAA,EAAmB,CAAA;AAAA,QAC7DC,mCAAA,CAAwB,EAAE,YAAA,EAAcD,uBAAA,EAAmB;AAAA,OAC7D;AAAA,MACA,4BAAA;AAAA,MACA,QAAA,EAAU,MAAME,4CAAA,EAAoC;AAAA,MACpD,MAAA,EAAQC;AAAA,KACV;AAAA,EACF,CAAC,CAAA;AACH;;;;;"} |
| import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation'; | ||
| import { SDK_VERSION, _INTERNAL_shouldSkipAiProviderWrapping, OPENAI_INTEGRATION_NAME, instrumentOpenAiClient } from '@sentry/core'; | ||
| const supportedVersions = [">=4.0.0 <7"]; | ||
| const supportedVersions = [">=4.0.0 <8"]; | ||
| class SentryOpenAiInstrumentation extends InstrumentationBase { | ||
@@ -6,0 +6,0 @@ constructor(config = {}) { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing/openai/instrumentation.ts"],"sourcesContent":["import {\n InstrumentationBase,\n type InstrumentationConfig,\n type InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n} from '@opentelemetry/instrumentation';\nimport type { Integration, OpenAiClient, OpenAiOptions } from '@sentry/core';\nimport {\n _INTERNAL_shouldSkipAiProviderWrapping,\n instrumentOpenAiClient,\n OPENAI_INTEGRATION_NAME,\n SDK_VERSION,\n} from '@sentry/core';\n\nconst supportedVersions = ['>=4.0.0 <7'];\n\nexport interface OpenAiIntegration extends Integration {\n options: OpenAiOptions;\n}\n\ntype OpenAiInstrumentationOptions = InstrumentationConfig & OpenAiOptions;\n\n/**\n * Represents the patched shape of the OpenAI module export.\n */\ninterface PatchedModuleExports {\n [key: string]: unknown;\n OpenAI: abstract new (...args: unknown[]) => OpenAiClient;\n AzureOpenAI?: abstract new (...args: unknown[]) => OpenAiClient;\n}\n\n/**\n * Sentry OpenAI instrumentation using OpenTelemetry.\n */\nexport class SentryOpenAiInstrumentation extends InstrumentationBase<OpenAiInstrumentationOptions> {\n public constructor(config: OpenAiInstrumentationOptions = {}) {\n super('@sentry/instrumentation-openai', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation by defining the modules to be patched.\n */\n public init(): InstrumentationModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition('openai', supportedVersions, this._patch.bind(this));\n return module;\n }\n\n /**\n * Core patch logic applying instrumentation to the OpenAI and AzureOpenAI client constructors.\n */\n private _patch(exports: PatchedModuleExports): PatchedModuleExports | void {\n let result = exports;\n result = this._patchClient(result, 'OpenAI');\n result = this._patchClient(result, 'AzureOpenAI');\n return result;\n }\n\n /**\n * Patch logic applying instrumentation to the specified client constructor.\n */\n private _patchClient(exports: PatchedModuleExports, exportKey: 'OpenAI' | 'AzureOpenAI'): PatchedModuleExports {\n const Original = exports[exportKey];\n if (!Original) {\n return exports;\n }\n\n const config = this.getConfig();\n\n const WrappedOpenAI = function (this: unknown, ...args: unknown[]) {\n // Check if wrapping should be skipped (e.g., when LangChain is handling instrumentation)\n if (_INTERNAL_shouldSkipAiProviderWrapping(OPENAI_INTEGRATION_NAME)) {\n return Reflect.construct(Original, args) as OpenAiClient;\n }\n\n const instance = Reflect.construct(Original, args);\n\n return instrumentOpenAiClient(instance as OpenAiClient, config);\n } as unknown as abstract new (...args: unknown[]) => OpenAiClient;\n\n // Preserve static and prototype chains\n Object.setPrototypeOf(WrappedOpenAI, Original);\n Object.setPrototypeOf(WrappedOpenAI.prototype, Original.prototype);\n\n for (const key of Object.getOwnPropertyNames(Original)) {\n if (!['length', 'name', 'prototype'].includes(key)) {\n const descriptor = Object.getOwnPropertyDescriptor(Original, key);\n if (descriptor) {\n Object.defineProperty(WrappedOpenAI, key, descriptor);\n }\n }\n }\n\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n try {\n exports[exportKey] = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, exportKey, {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n\n // Wrap the default export if it points to the original constructor\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n if (exports.default === Original) {\n try {\n exports.default = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, 'default', {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n }\n return exports;\n }\n}\n"],"names":[],"mappings":";;;AAcA,MAAM,iBAAA,GAAoB,CAAC,YAAY,CAAA;AAoBhC,MAAM,oCAAoC,mBAAA,CAAkD;AAAA,EAC1F,WAAA,CAAY,MAAA,GAAuC,EAAC,EAAG;AAC5D,IAAA,KAAA,CAAM,gCAAA,EAAkC,aAAa,MAAM,CAAA;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKO,IAAA,GAAwC;AAC7C,IAAA,MAAM,MAAA,GAAS,IAAI,mCAAA,CAAoC,QAAA,EAAU,mBAAmB,IAAA,CAAK,MAAA,CAAO,IAAA,CAAK,IAAI,CAAC,CAAA;AAC1G,IAAA,OAAO,MAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKQ,OAAO,OAAA,EAA4D;AAC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A,MAAA,CAAO,cAAA,CAAe,aAAA,EAAe,GAAA,EAAK,UAAU,CAAA;AAAA,QACtD;AAAA,MACF;AAAA,IACF;AAIA,IAAA,IAAI;AACF,MAAA,OAAA,CAAQ,SAAS,CAAA,GAAI,aAAA;AAAA,IACvB,CAAA,CAAA,MAAQ;AAEN,MAAA,MAAA,CAAO,cAAA,CAAe,SAAS,SAAA,EAAW;AAAA,QACxC,KAAA,EAAO,aAAA;AAAA,QACP,QAAA,EAAU,IAAA;AAAA,QACV,YAAA,EAAc,IAAA;AAAA,QACd,UAAA,EAAY;AAAA,OACb,CAAA;AAAA,IACH;AAKA,IAAA,IAAI,OAAA,CAAQ,YAAY,QAAA,EAAU;AAChC,MAAA,IAAI;AACF,QAAA,OAAA,CAAQ,OAAA,GAAU,aAAA;AAAA,MACpB,CAAA,CAAA,MAAQ;AAEN,QAAA,MAAA,CAAO,cAAA,CAAe,SAAS,SAAA,EAAW;AAAA,UACxC,KAAA,EAAO,aAAA;AAAA,UACP,QAAA,EAAU,IAAA;AAAA,UACV,YAAA,EAAc,IAAA;AAAA,UACd,UAAA,EAAY;AAAA,SACb,CAAA;AAAA,MACH;AAAA,IACF;AACA,IAAA,OAAO,OAAA;AAAA,EACT;AACF;;;;"} | ||
| {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing/openai/instrumentation.ts"],"sourcesContent":["import {\n InstrumentationBase,\n type InstrumentationConfig,\n type InstrumentationModuleDefinition,\n InstrumentationNodeModuleDefinition,\n} from '@opentelemetry/instrumentation';\nimport type { Integration, OpenAiClient, OpenAiOptions } from '@sentry/core';\nimport {\n _INTERNAL_shouldSkipAiProviderWrapping,\n instrumentOpenAiClient,\n OPENAI_INTEGRATION_NAME,\n SDK_VERSION,\n} from '@sentry/core';\n\nconst supportedVersions = ['>=4.0.0 <8'];\n\nexport interface OpenAiIntegration extends Integration {\n options: OpenAiOptions;\n}\n\ntype OpenAiInstrumentationOptions = InstrumentationConfig & OpenAiOptions;\n\n/**\n * Represents the patched shape of the OpenAI module export.\n */\ninterface PatchedModuleExports {\n [key: string]: unknown;\n OpenAI: abstract new (...args: unknown[]) => OpenAiClient;\n AzureOpenAI?: abstract new (...args: unknown[]) => OpenAiClient;\n}\n\n/**\n * Sentry OpenAI instrumentation using OpenTelemetry.\n */\nexport class SentryOpenAiInstrumentation extends InstrumentationBase<OpenAiInstrumentationOptions> {\n public constructor(config: OpenAiInstrumentationOptions = {}) {\n super('@sentry/instrumentation-openai', SDK_VERSION, config);\n }\n\n /**\n * Initializes the instrumentation by defining the modules to be patched.\n */\n public init(): InstrumentationModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition('openai', supportedVersions, this._patch.bind(this));\n return module;\n }\n\n /**\n * Core patch logic applying instrumentation to the OpenAI and AzureOpenAI client constructors.\n */\n private _patch(exports: PatchedModuleExports): PatchedModuleExports | void {\n let result = exports;\n result = this._patchClient(result, 'OpenAI');\n result = this._patchClient(result, 'AzureOpenAI');\n return result;\n }\n\n /**\n * Patch logic applying instrumentation to the specified client constructor.\n */\n private _patchClient(exports: PatchedModuleExports, exportKey: 'OpenAI' | 'AzureOpenAI'): PatchedModuleExports {\n const Original = exports[exportKey];\n if (!Original) {\n return exports;\n }\n\n const config = this.getConfig();\n\n const WrappedOpenAI = function (this: unknown, ...args: unknown[]) {\n // Check if wrapping should be skipped (e.g., when LangChain is handling instrumentation)\n if (_INTERNAL_shouldSkipAiProviderWrapping(OPENAI_INTEGRATION_NAME)) {\n return Reflect.construct(Original, args) as OpenAiClient;\n }\n\n const instance = Reflect.construct(Original, args);\n\n return instrumentOpenAiClient(instance as OpenAiClient, config);\n } as unknown as abstract new (...args: unknown[]) => OpenAiClient;\n\n // Preserve static and prototype chains\n Object.setPrototypeOf(WrappedOpenAI, Original);\n Object.setPrototypeOf(WrappedOpenAI.prototype, Original.prototype);\n\n for (const key of Object.getOwnPropertyNames(Original)) {\n if (!['length', 'name', 'prototype'].includes(key)) {\n const descriptor = Object.getOwnPropertyDescriptor(Original, key);\n if (descriptor) {\n Object.defineProperty(WrappedOpenAI, key, descriptor);\n }\n }\n }\n\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n try {\n exports[exportKey] = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, exportKey, {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n\n // Wrap the default export if it points to the original constructor\n // Constructor replacement - handle read-only properties\n // The OpenAI property might have only a getter, so use defineProperty\n if (exports.default === Original) {\n try {\n exports.default = WrappedOpenAI;\n } catch {\n // If direct assignment fails, override the property descriptor\n Object.defineProperty(exports, 'default', {\n value: WrappedOpenAI,\n writable: true,\n configurable: true,\n enumerable: true,\n });\n }\n }\n return exports;\n }\n}\n"],"names":[],"mappings":";;;AAcA,MAAM,iBAAA,GAAoB,CAAC,YAAY,CAAA;AAoBhC,MAAM,oCAAoC,mBAAA,CAAkD;AAAA,EAC1F,WAAA,CAAY,MAAA,GAAuC,EAAC,EAAG;AAC5D,IAAA,KAAA,CAAM,gCAAA,EAAkC,aAAa,MAAM,CAAA;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKO,IAAA,GAAwC;AAC7C,IAAA,MAAM,MAAA,GAAS,IAAI,mCAAA,CAAoC,QAAA,EAAU,mBAAmB,IAAA,CAAK,MAAA,CAAO,IAAA,CAAK,IAAI,CAAC,CAAA;AAC1G,IAAA,OAAO,MAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKQ,OAAO,OAAA,EAA4D;AACzE,IAAA,IAAI,MAAA,GAAS,OAAA;AACb,IAAA,MAAA,GAAS,IAAA,CAAK,YAAA,CAAa,MAAA,EAAQ,QAAQ,CAAA;AAC3C,IAAA,MAAA,GAAS,IAAA,CAAK,YAAA,CAAa,MAAA,EAAQ,aAAa,CAAA;AAChD,IAAA,OAAO,MAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKQ,YAAA,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QACxC,KAAA,EAAO,aAAA;AAAA,QACP,QAAA,EAAU,IAAA;AAAA,QACV,YAAA,EAAc,IAAA;AAAA,QACd,UAAA,EAAY;AAAA,OACb,CAAA;AAAA,IACH;AAKA,IAAA,IAAI,OAAA,CAAQ,YAAY,QAAA,EAAU;AAChC,MAAA,IAAI;AACF,QAAA,OAAA,CAAQ,OAAA,GAAU,aAAA;AAAA,MACpB,CAAA,CAAA,MAAQ;AAEN,QAAA,MAAA,CAAO,cAAA,CAAe,SAAS,SAAA,EAAW;AAAA,UACxC,KAAA,EAAO,aAAA;AAAA,UACP,QAAA,EAAU,IAAA;AAAA,UACV,YAAA,EAAc,IAAA;AAAA,UACd,UAAA,EAAY;AAAA,SACb,CAAA;AAAA,MACH;AAAA,IACF;AACA,IAAA,OAAO,OAAA;AAAA,EACT;AACF;;;;"} |
@@ -1,1 +0,1 @@ | ||
| {"type":"module","version":"10.71.0","sideEffects":false} | ||
| {"type":"module","version":"10.72.0","sideEffects":false} |
@@ -9,3 +9,3 @@ import { channelIntegrations, detectOrchestrionSetup, ioredisChannelIntegration, redisChannelIntegration } from '@sentry/server-utils/orchestrion'; | ||
| } | ||
| function experimentalUseDiagnosticsChannelInjection(options) { | ||
| function experimentalUseDiagnosticsChannelInjection(_options) { | ||
| setDiagnosticsChannelInjectionLoader(() => { | ||
@@ -24,3 +24,3 @@ const integrations = Object.values(channelIntegrations).map((createIntegration) => createIntegration()); | ||
| replacedOtelIntegrationNames, | ||
| register: () => registerDiagnosticsChannelInjection(options), | ||
| register: () => registerDiagnosticsChannelInjection(), | ||
| detect: detectOrchestrionSetup | ||
@@ -27,0 +27,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import {\n channelIntegrations,\n ioredisChannelIntegration,\n redisChannelIntegration,\n detectOrchestrionSetup,\n} from '@sentry/server-utils/orchestrion';\nimport type { RegisterDiagnosticsChannelInjectionOptions } from '@sentry/server-utils/orchestrion/register';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport { cacheResponseHook } from '../integrations/tracing/redis/cache';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\nexport function diagnosticsChannelInjectionIntegrations(): typeof channelIntegrations {\n return channelIntegrations;\n}\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(\n // Forwarded to `registerDiagnosticsChannelInjection()`; framework SDKs whose bundlers compile\n // the SDK into the app (e.g. `@sentry/nextjs`) use it to point the runtime module hook at the\n // tracing-hooks package location resolved at build time. Plain Node apps don't need it.\n options?: RegisterDiagnosticsChannelInjectionOptions,\n): void {\n setDiagnosticsChannelInjectionLoader((): DiagnosticsChannelInjection => {\n // These channel integrations 1:1 replace the OTel integration of the\n // same name. Framework SDKs that own their own channel listener\n // (e.g. `@sentry/nestjs`'s `Nest`) are NOT here. They pick the\n // channel-vs-OTel path themselves at integration `setupOnce`, so\n // there's nothing for the central swap to do.\n const integrations = Object.values(channelIntegrations).map(createIntegration => createIntegration());\n const replacedOtelIntegrationNames = integrations.map(i => i.name);\n\n return {\n // ioredis and redis are wired separately (not in `channelIntegrations`): they need the node\n // redis cache `responseHook` and only partially replace the composite OTel `Redis` integration,\n // so they're kept OUT of `replacedOtelIntegrationNames` — `Redis` must stay (batch + >=5.11 native DC).\n integrations: [\n ...integrations,\n ioredisChannelIntegration({ responseHook: cacheResponseHook }),\n redisChannelIntegration({ responseHook: cacheResponseHook }),\n ],\n replacedOtelIntegrationNames,\n register: () => registerDiagnosticsChannelInjection(options),\n detect: detectOrchestrionSetup,\n };\n });\n}\n"],"names":[],"mappings":";;;;;AAYO,SAAS,uCAAA,GAAsE;AACpF,EAAA,OAAO,mBAAA;AACT;AAkCO,SAAS,2CAId,OAAA,EACM;AACN,EAAA,oCAAA,CAAqC,MAAmC;AAMtE,IAAA,MAAM,YAAA,GAAe,OAAO,MAAA,CAAO,mBAAmB,EAAE,GAAA,CAAI,CAAA,iBAAA,KAAqB,mBAAmB,CAAA;AACpG,IAAA,MAAM,4BAAA,GAA+B,YAAA,CAAa,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,IAAI,CAAA;AAEjE,IAAA,OAAO;AAAA;AAAA;AAAA;AAAA,MAIL,YAAA,EAAc;AAAA,QACZ,GAAG,YAAA;AAAA,QACH,yBAAA,CAA0B,EAAE,YAAA,EAAc,iBAAA,EAAmB,CAAA;AAAA,QAC7D,uBAAA,CAAwB,EAAE,YAAA,EAAc,iBAAA,EAAmB;AAAA,OAC7D;AAAA,MACA,4BAAA;AAAA,MACA,QAAA,EAAU,MAAM,mCAAA,CAAoC,OAAO,CAAA;AAAA,MAC3D,MAAA,EAAQ;AAAA,KACV;AAAA,EACF,CAAC,CAAA;AACH;;;;"} | ||
| {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import {\n channelIntegrations,\n ioredisChannelIntegration,\n redisChannelIntegration,\n detectOrchestrionSetup,\n} from '@sentry/server-utils/orchestrion';\nimport type { RegisterDiagnosticsChannelInjectionOptions } from '@sentry/server-utils/orchestrion/register';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport { cacheResponseHook } from '../integrations/tracing/redis/cache';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\nexport function diagnosticsChannelInjectionIntegrations(): typeof channelIntegrations {\n return channelIntegrations;\n}\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(\n // Kept for backwards compatibility only; every field is deprecated and ignored.\n _options?: RegisterDiagnosticsChannelInjectionOptions,\n): void {\n setDiagnosticsChannelInjectionLoader((): DiagnosticsChannelInjection => {\n // These channel integrations 1:1 replace the OTel integration of the\n // same name. Framework SDKs that own their own channel listener\n // (e.g. `@sentry/nestjs`'s `Nest`) are NOT here. They pick the\n // channel-vs-OTel path themselves at integration `setupOnce`, so\n // there's nothing for the central swap to do.\n const integrations = Object.values(channelIntegrations).map(createIntegration => createIntegration());\n const replacedOtelIntegrationNames = integrations.map(i => i.name);\n\n return {\n // ioredis and redis are wired separately (not in `channelIntegrations`): they need the node\n // redis cache `responseHook` and only partially replace the composite OTel `Redis` integration,\n // so they're kept OUT of `replacedOtelIntegrationNames` — `Redis` must stay (batch + >=5.11 native DC).\n integrations: [\n ...integrations,\n ioredisChannelIntegration({ responseHook: cacheResponseHook }),\n redisChannelIntegration({ responseHook: cacheResponseHook }),\n ],\n replacedOtelIntegrationNames,\n register: () => registerDiagnosticsChannelInjection(),\n detect: detectOrchestrionSetup,\n };\n });\n}\n"],"names":[],"mappings":";;;;;AAYO,SAAS,uCAAA,GAAsE;AACpF,EAAA,OAAO,mBAAA;AACT;AAkCO,SAAS,2CAEd,QAAA,EACM;AACN,EAAA,oCAAA,CAAqC,MAAmC;AAMtE,IAAA,MAAM,YAAA,GAAe,OAAO,MAAA,CAAO,mBAAmB,EAAE,GAAA,CAAI,CAAA,iBAAA,KAAqB,mBAAmB,CAAA;AACpG,IAAA,MAAM,4BAAA,GAA+B,YAAA,CAAa,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,IAAI,CAAA;AAEjE,IAAA,OAAO;AAAA;AAAA;AAAA;AAAA,MAIL,YAAA,EAAc;AAAA,QACZ,GAAG,YAAA;AAAA,QACH,yBAAA,CAA0B,EAAE,YAAA,EAAc,iBAAA,EAAmB,CAAA;AAAA,QAC7D,uBAAA,CAAwB,EAAE,YAAA,EAAc,iBAAA,EAAmB;AAAA,OAC7D;AAAA,MACA,4BAAA;AAAA,MACA,QAAA,EAAU,MAAM,mCAAA,EAAoC;AAAA,MACpD,MAAA,EAAQ;AAAA,KACV;AAAA,EACF,CAAC,CAAA;AACH;;;;"} |
@@ -36,3 +36,3 @@ import { channelIntegrations } from '@sentry/server-utils/orchestrion'; | ||
| */ | ||
| export declare function experimentalUseDiagnosticsChannelInjection(options?: RegisterDiagnosticsChannelInjectionOptions): void; | ||
| export declare function experimentalUseDiagnosticsChannelInjection(_options?: RegisterDiagnosticsChannelInjectionOptions): void; | ||
| //# sourceMappingURL=experimentalUseDiagnosticsChannelInjection.d.ts.map |
@@ -36,3 +36,3 @@ import { channelIntegrations } from '@sentry/server-utils/orchestrion'; | ||
| */ | ||
| export declare function experimentalUseDiagnosticsChannelInjection(options?: RegisterDiagnosticsChannelInjectionOptions): void; | ||
| export declare function experimentalUseDiagnosticsChannelInjection(_options?: RegisterDiagnosticsChannelInjectionOptions): void; | ||
| //# sourceMappingURL=experimentalUseDiagnosticsChannelInjection.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.d.ts","sourceRoot":"","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAIpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,2CAA2C,CAAC;AAM5G,wBAAgB,uCAAuC,IAAI,OAAO,mBAAmB,CAEpF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,0CAA0C,CAIxD,OAAO,CAAC,EAAE,0CAA0C,GACnD,IAAI,CAwBN"} | ||
| {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.d.ts","sourceRoot":"","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAIpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,0CAA0C,EAAE,MAAM,2CAA2C,CAAC;AAM5G,wBAAgB,uCAAuC,IAAI,OAAO,mBAAmB,CAEpF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,0CAA0C,CAExD,QAAQ,CAAC,EAAE,0CAA0C,GACpD,IAAI,CAwBN"} |
+5
-5
| { | ||
| "name": "@sentry/node", | ||
| "version": "10.71.0", | ||
| "version": "10.72.0", | ||
| "description": "Sentry Node SDK using OpenTelemetry for performance instrumentation", | ||
@@ -72,6 +72,6 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
| "@sentry/conventions": "^0.16.0", | ||
| "@sentry/core": "10.71.0", | ||
| "@sentry/node-core": "10.71.0", | ||
| "@sentry/opentelemetry": "10.71.0", | ||
| "@sentry/server-utils": "10.71.0", | ||
| "@sentry/core": "10.72.0", | ||
| "@sentry/node-core": "10.72.0", | ||
| "@sentry/opentelemetry": "10.72.0", | ||
| "@sentry/server-utils": "10.72.0", | ||
| "import-in-the-middle": "^3.0.0" | ||
@@ -78,0 +78,0 @@ }, |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
2745367
-0.02%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated