@depup/sentry__node 10.71.0-depup.0 → 10.72.0-depup.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/build/cjs/integrations/tracing/openai/instrumentation.js +1 -1
- package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -1
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +2 -2
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
- package/build/esm/integrations/tracing/openai/instrumentation.js +1 -1
- package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +2 -2
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
- package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +1 -1
- package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -1
- package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +1 -1
- package/changes.json +3 -3
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/sentry__node
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@sentry/node](https://www.npmjs.com/package/@sentry/node) @ 10.
|
|
17
|
-
| Processed | 2026-08-
|
|
16
|
+
| Original | [@sentry/node](https://www.npmjs.com/package/@sentry/node) @ 10.72.0 |
|
|
17
|
+
| Processed | 2026-08-31 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 4 |
|
|
20
20
|
|
|
@@ -24,8 +24,8 @@ npm install @depup/sentry__node
|
|
|
24
24
|
|------------|------|-----|
|
|
25
25
|
| @opentelemetry/instrumentation | ^0.220.0 | ^0.221.0 |
|
|
26
26
|
| @opentelemetry/sdk-trace-base | ^2.9.0 | ^2.10.0 |
|
|
27
|
-
| @sentry/conventions | ^0.16.0 | ^0.
|
|
28
|
-
| import-in-the-middle | ^3.0.0 | ^3.
|
|
27
|
+
| @sentry/conventions | ^0.16.0 | ^0.21.0 |
|
|
28
|
+
| import-in-the-middle | ^3.0.0 | ^3.4.0 |
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const instrumentation = require('@opentelemetry/instrumentation');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
5
|
|
|
6
|
-
const supportedVersions = [">=4.0.0 <
|
|
6
|
+
const supportedVersions = [">=4.0.0 <8"];
|
|
7
7
|
class SentryOpenAiInstrumentation extends instrumentation.InstrumentationBase {
|
|
8
8
|
constructor(config = {}) {
|
|
9
9
|
super("@sentry/instrumentation-openai", core.SDK_VERSION, config);
|
|
@@ -1 +1 @@
|
|
|
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 <
|
|
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 <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,CAAA;AAoBhC,MAAM,oCAAoCA,mCAAA,CAAkD;AAAA,EAC1F,WAAA,CAAY,MAAA,GAAuC,EAAC,EAAG;AAC5D,IAAA,KAAA,CAAM,gCAAA,EAAkCC,kBAAa,MAAM,CAAA;AAAA,EAC7D;AAAA;AAAA;AAAA;AAAA,EAKO,IAAA,GAAwC;AAC7C,IAAA,MAAM,MAAA,GAAS,IAAIC,mDAAA,CAAoC,QAAA,EAAU,mBAAmB,IAAA,CAAK,MAAA,CAAO,IAAA,CAAK,IAAI,CAAC,CAAA;AAC1G,IAAA,OAAO,MAAA;AAAA,EACT;AAAA;AAAA;AAAA;AAAA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,QAAA,IAAI,UAAA,EAAY;AACd,UAAA,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;;;;"}
|
|
@@ -8,7 +8,7 @@ const diagnosticsChannelInjection = require('./diagnosticsChannelInjection.js');
|
|
|
8
8
|
function diagnosticsChannelInjectionIntegrations() {
|
|
9
9
|
return orchestrion.channelIntegrations;
|
|
10
10
|
}
|
|
11
|
-
function experimentalUseDiagnosticsChannelInjection(
|
|
11
|
+
function experimentalUseDiagnosticsChannelInjection(_options) {
|
|
12
12
|
diagnosticsChannelInjection.setDiagnosticsChannelInjectionLoader(() => {
|
|
13
13
|
const integrations = Object.values(orchestrion.channelIntegrations).map((createIntegration) => createIntegration());
|
|
14
14
|
const replacedOtelIntegrationNames = integrations.map((i) => i.name);
|
|
@@ -22,7 +22,7 @@ function experimentalUseDiagnosticsChannelInjection(options) {
|
|
|
22
22
|
orchestrion.redisChannelIntegration({ responseHook: cache.cacheResponseHook })
|
|
23
23
|
],
|
|
24
24
|
replacedOtelIntegrationNames,
|
|
25
|
-
register: () => register.registerDiagnosticsChannelInjection(
|
|
25
|
+
register: () => register.registerDiagnosticsChannelInjection(),
|
|
26
26
|
detect: orchestrion.detectOrchestrionSetup
|
|
27
27
|
};
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
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 //
|
|
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 // 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;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
2
2
|
import { SDK_VERSION, _INTERNAL_shouldSkipAiProviderWrapping, OPENAI_INTEGRATION_NAME, instrumentOpenAiClient } from '@sentry/core';
|
|
3
3
|
|
|
4
|
-
const supportedVersions = [">=4.0.0 <
|
|
4
|
+
const supportedVersions = [">=4.0.0 <8"];
|
|
5
5
|
class SentryOpenAiInstrumentation extends InstrumentationBase {
|
|
6
6
|
constructor(config = {}) {
|
|
7
7
|
super("@sentry/instrumentation-openai", SDK_VERSION, config);
|
|
@@ -1 +1 @@
|
|
|
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 <
|
|
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 <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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I,UAAA,EAAY;AACd,UAAA,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;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.72.0","sideEffects":false}
|
|
@@ -6,7 +6,7 @@ import { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInject
|
|
|
6
6
|
function diagnosticsChannelInjectionIntegrations() {
|
|
7
7
|
return channelIntegrations;
|
|
8
8
|
}
|
|
9
|
-
function experimentalUseDiagnosticsChannelInjection(
|
|
9
|
+
function experimentalUseDiagnosticsChannelInjection(_options) {
|
|
10
10
|
setDiagnosticsChannelInjectionLoader(() => {
|
|
11
11
|
const integrations = Object.values(channelIntegrations).map((createIntegration) => createIntegration());
|
|
12
12
|
const replacedOtelIntegrationNames = integrations.map((i) => i.name);
|
|
@@ -20,7 +20,7 @@ function experimentalUseDiagnosticsChannelInjection(options) {
|
|
|
20
20
|
redisChannelIntegration({ responseHook: cacheResponseHook })
|
|
21
21
|
],
|
|
22
22
|
replacedOtelIntegrationNames,
|
|
23
|
-
register: () => registerDiagnosticsChannelInjection(
|
|
23
|
+
register: () => registerDiagnosticsChannelInjection(),
|
|
24
24
|
detect: detectOrchestrionSetup
|
|
25
25
|
};
|
|
26
26
|
});
|
|
@@ -1 +1 @@
|
|
|
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 //
|
|
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 // 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;;;;"}
|
|
@@ -33,5 +33,5 @@ export declare function diagnosticsChannelInjectionIntegrations(): typeof channe
|
|
|
33
33
|
*
|
|
34
34
|
* @experimental May change or be removed in any release.
|
|
35
35
|
*/
|
|
36
|
-
export declare function experimentalUseDiagnosticsChannelInjection(
|
|
36
|
+
export declare function experimentalUseDiagnosticsChannelInjection(_options?: RegisterDiagnosticsChannelInjectionOptions): void;
|
|
37
37
|
//# sourceMappingURL=experimentalUseDiagnosticsChannelInjection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,CAExD,QAAQ,CAAC,EAAE,0CAA0C,GACpD,IAAI,CAwBN"}
|
|
@@ -33,5 +33,5 @@ export declare function diagnosticsChannelInjectionIntegrations(): typeof channe
|
|
|
33
33
|
*
|
|
34
34
|
* @experimental May change or be removed in any release.
|
|
35
35
|
*/
|
|
36
|
-
export declare function experimentalUseDiagnosticsChannelInjection(
|
|
36
|
+
export declare function experimentalUseDiagnosticsChannelInjection(_options?: RegisterDiagnosticsChannelInjectionOptions): void;
|
|
37
37
|
//# sourceMappingURL=experimentalUseDiagnosticsChannelInjection.d.ts.map
|
package/changes.json
CHANGED
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
},
|
|
11
11
|
"@sentry/conventions": {
|
|
12
12
|
"from": "^0.16.0",
|
|
13
|
-
"to": "^0.
|
|
13
|
+
"to": "^0.21.0"
|
|
14
14
|
},
|
|
15
15
|
"import-in-the-middle": {
|
|
16
16
|
"from": "^3.0.0",
|
|
17
|
-
"to": "^3.
|
|
17
|
+
"to": "^3.4.0"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
"timestamp": "2026-08-
|
|
20
|
+
"timestamp": "2026-08-31T16:09:21.843Z",
|
|
21
21
|
"totalUpdated": 4
|
|
22
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/sentry__node",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.72.0-depup.1",
|
|
4
4
|
"description": "Sentry Node SDK using OpenTelemetry for performance instrumentation (with updated dependencies)",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"@opentelemetry/api": "^1.9.1",
|
|
68
68
|
"@opentelemetry/instrumentation": "^0.221.0",
|
|
69
69
|
"@opentelemetry/sdk-trace-base": "^2.10.0",
|
|
70
|
-
"@sentry/conventions": "^0.
|
|
71
|
-
"@sentry/core": "10.
|
|
72
|
-
"@sentry/node-core": "10.
|
|
73
|
-
"@sentry/opentelemetry": "10.
|
|
74
|
-
"@sentry/server-utils": "10.
|
|
75
|
-
"import-in-the-middle": "^3.
|
|
70
|
+
"@sentry/conventions": "^0.21.0",
|
|
71
|
+
"@sentry/core": "10.72.0",
|
|
72
|
+
"@sentry/node-core": "10.72.0",
|
|
73
|
+
"@sentry/opentelemetry": "10.72.0",
|
|
74
|
+
"@sentry/server-utils": "10.72.0",
|
|
75
|
+
"import-in-the-middle": "^3.4.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/node": "^18.19.1"
|
|
@@ -136,17 +136,17 @@
|
|
|
136
136
|
},
|
|
137
137
|
"@sentry/conventions": {
|
|
138
138
|
"from": "^0.16.0",
|
|
139
|
-
"to": "^0.
|
|
139
|
+
"to": "^0.21.0"
|
|
140
140
|
},
|
|
141
141
|
"import-in-the-middle": {
|
|
142
142
|
"from": "^3.0.0",
|
|
143
|
-
"to": "^3.
|
|
143
|
+
"to": "^3.4.0"
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
"depsUpdated": 4,
|
|
147
147
|
"originalPackage": "@sentry/node",
|
|
148
|
-
"originalVersion": "10.
|
|
149
|
-
"processedAt": "2026-08-
|
|
148
|
+
"originalVersion": "10.72.0",
|
|
149
|
+
"processedAt": "2026-08-31T16:09:26.602Z",
|
|
150
150
|
"smokeTest": "passed"
|
|
151
151
|
}
|
|
152
152
|
}
|