@sentry/node 10.48.0 → 10.50.0-alpha.0
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/build/cjs/integrations/tracing/express.js +4 -6
- package/build/cjs/integrations/tracing/express.js.map +1 -1
- package/build/cjs/sdk/initOtel.js +1 -10
- package/build/cjs/sdk/initOtel.js.map +1 -1
- package/build/esm/integrations/tracing/express.js +4 -6
- package/build/esm/integrations/tracing/express.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/sdk/initOtel.js +3 -12
- package/build/esm/sdk/initOtel.js.map +1 -1
- package/build/types/integrations/tracing/express.d.ts.map +1 -1
- package/build/types/integrations/tracing/vercelai/types.d.ts +5 -0
- package/build/types/integrations/tracing/vercelai/types.d.ts.map +1 -1
- package/build/types/sdk/initOtel.d.ts.map +1 -1
- package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +5 -0
- package/package.json +4 -6
|
@@ -34,16 +34,15 @@ class ExpressInstrumentation extends instrumentation.InstrumentationBase {
|
|
|
34
34
|
SUPPORTED_VERSIONS,
|
|
35
35
|
express => {
|
|
36
36
|
try {
|
|
37
|
-
core.patchExpressModule({
|
|
37
|
+
core.patchExpressModule(express, () => ({
|
|
38
38
|
...this.getConfig(),
|
|
39
|
-
express,
|
|
40
39
|
onRouteResolved(route) {
|
|
41
40
|
const rpcMetadata = core$1.getRPCMetadata(api.context.active());
|
|
42
41
|
if (route && rpcMetadata?.type === core$1.RPCType.HTTP) {
|
|
43
42
|
rpcMetadata.route = route;
|
|
44
43
|
}
|
|
45
44
|
},
|
|
46
|
-
});
|
|
45
|
+
}));
|
|
47
46
|
} catch (e) {
|
|
48
47
|
debugBuild.DEBUG_BUILD && core.debug.error('Failed to patch express module:', e);
|
|
49
48
|
}
|
|
@@ -55,8 +54,7 @@ class ExpressInstrumentation extends instrumentation.InstrumentationBase {
|
|
|
55
54
|
return module;
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
|
-
|
|
59
|
-
const _expressInstrumentation = ((options) => {
|
|
57
|
+
const _expressIntegration = ((options) => {
|
|
60
58
|
return {
|
|
61
59
|
name: INTEGRATION_NAME,
|
|
62
60
|
setupOnce() {
|
|
@@ -65,7 +63,7 @@ const _expressInstrumentation = ((options) => {
|
|
|
65
63
|
};
|
|
66
64
|
}) ;
|
|
67
65
|
|
|
68
|
-
const expressIntegration = core.defineIntegration(
|
|
66
|
+
const expressIntegration = core.defineIntegration(_expressIntegration);
|
|
69
67
|
|
|
70
68
|
exports.expressErrorHandler = core.expressErrorHandler;
|
|
71
69
|
exports.ExpressInstrumentation = ExpressInstrumentation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.js","sources":["../../../../src/integrations/tracing/express.ts"],"sourcesContent":["// Automatic istrumentation for Express using OTel\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { context } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\n\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport {\n type ExpressIntegrationOptions,\n type IntegrationFn,\n debug,\n patchExpressModule,\n SDK_VERSION,\n defineIntegration,\n setupExpressErrorHandler as coreSetupExpressErrorHandler,\n type ExpressHandlerOptions,\n} from '@sentry/core';\nexport { expressErrorHandler } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\n\nconst INTEGRATION_NAME = 'Express';\nconst SUPPORTED_VERSIONS = ['>=4.0.0 <6'];\n\nexport function setupExpressErrorHandler(\n //oxlint-disable-next-line no-explicit-any\n app: { use: (middleware: any) => unknown },\n options?: ExpressHandlerOptions,\n): void {\n coreSetupExpressErrorHandler(app, options);\n ensureIsWrapped(app.use, 'express');\n}\n\nexport type ExpressInstrumentationConfig = InstrumentationConfig &\n Omit<ExpressIntegrationOptions, 'express' | 'onRouteResolved'>;\n\nexport const instrumentExpress = generateInstrumentOnce(\n INTEGRATION_NAME,\n (options?: ExpressInstrumentationConfig) => new ExpressInstrumentation(options),\n);\n\nexport class ExpressInstrumentation extends InstrumentationBase<ExpressInstrumentationConfig> {\n public constructor(config: ExpressInstrumentationConfig = {}) {\n super('sentry-express', SDK_VERSION, config);\n }\n public init(): InstrumentationNodeModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition(\n 'express',\n SUPPORTED_VERSIONS,\n express => {\n try {\n patchExpressModule({\n ...this.getConfig(),\n
|
|
1
|
+
{"version":3,"file":"express.js","sources":["../../../../src/integrations/tracing/express.ts"],"sourcesContent":["// Automatic istrumentation for Express using OTel\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { context } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\n\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport {\n type ExpressIntegrationOptions,\n type IntegrationFn,\n debug,\n patchExpressModule,\n SDK_VERSION,\n defineIntegration,\n setupExpressErrorHandler as coreSetupExpressErrorHandler,\n type ExpressHandlerOptions,\n} from '@sentry/core';\nexport { expressErrorHandler } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\n\nconst INTEGRATION_NAME = 'Express';\nconst SUPPORTED_VERSIONS = ['>=4.0.0 <6'];\n\nexport function setupExpressErrorHandler(\n //oxlint-disable-next-line no-explicit-any\n app: { use: (middleware: any) => unknown },\n options?: ExpressHandlerOptions,\n): void {\n coreSetupExpressErrorHandler(app, options);\n ensureIsWrapped(app.use, 'express');\n}\n\nexport type ExpressInstrumentationConfig = InstrumentationConfig &\n Omit<ExpressIntegrationOptions, 'express' | 'onRouteResolved'>;\n\nexport const instrumentExpress = generateInstrumentOnce(\n INTEGRATION_NAME,\n (options?: ExpressInstrumentationConfig) => new ExpressInstrumentation(options),\n);\n\nexport class ExpressInstrumentation extends InstrumentationBase<ExpressInstrumentationConfig> {\n public constructor(config: ExpressInstrumentationConfig = {}) {\n super('sentry-express', SDK_VERSION, config);\n }\n public init(): InstrumentationNodeModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition(\n 'express',\n SUPPORTED_VERSIONS,\n express => {\n try {\n patchExpressModule(express, () => ({\n ...this.getConfig(),\n onRouteResolved(route) {\n const rpcMetadata = getRPCMetadata(context.active());\n if (route && rpcMetadata?.type === RPCType.HTTP) {\n rpcMetadata.route = route;\n }\n },\n }));\n } catch (e) {\n DEBUG_BUILD && debug.error('Failed to patch express module:', e);\n }\n return express;\n },\n // we do not ever actually unpatch in our SDKs\n express => express,\n );\n return module;\n }\n}\nconst _expressIntegration = ((options?: ExpressInstrumentationConfig) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentExpress(options);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const expressIntegration = defineIntegration(_expressIntegration);\n"],"names":["coreSetupExpressErrorHandler","ensureIsWrapped","generateInstrumentOnce","InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","patchExpressModule","getRPCMetadata","context","RPCType","DEBUG_BUILD","debug","defineIntegration"],"mappings":";;;;;;;;;AAoBA,MAAM,gBAAA,GAAmB,SAAS;AAClC,MAAM,kBAAA,GAAqB,CAAC,YAAY,CAAC;;AAElC,SAAS,wBAAwB;AACxC;AACA,EAAE,GAAG;AACL,EAAE,OAAO;AACT,EAAQ;AACR,EAAEA,6BAA4B,CAAC,GAAG,EAAE,OAAO,CAAC;AAC5C,EAAEC,wBAAe,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;AACrC;;AAKO,MAAM,iBAAA,GAAoBC,+BAAsB;AACvD,EAAE,gBAAgB;AAClB,EAAE,CAAC,OAAO,KAAoC,IAAI,sBAAsB,CAAC,OAAO,CAAC;AACjF;;AAEO,MAAM,sBAAA,SAA+BC,mCAAmB,CAA+B;AAC9F,GAAS,WAAW,CAAC,MAAM,GAAiC,E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api = require('@opentelemetry/api');
|
|
4
|
-
const resources = require('@opentelemetry/resources');
|
|
5
4
|
const sdkTraceBase = require('@opentelemetry/sdk-trace-base');
|
|
6
|
-
const semanticConventions = require('@opentelemetry/semantic-conventions');
|
|
7
5
|
const core = require('@sentry/core');
|
|
8
6
|
const nodeCore = require('@sentry/node-core');
|
|
9
7
|
const opentelemetry = require('@sentry/opentelemetry');
|
|
@@ -72,14 +70,7 @@ function setupOtel(
|
|
|
72
70
|
// Create and configure NodeTracerProvider
|
|
73
71
|
const provider = new sdkTraceBase.BasicTracerProvider({
|
|
74
72
|
sampler: new opentelemetry.SentrySampler(client),
|
|
75
|
-
resource:
|
|
76
|
-
resources.resourceFromAttributes({
|
|
77
|
-
[semanticConventions.ATTR_SERVICE_NAME]: 'node',
|
|
78
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
79
|
-
[semanticConventions.SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry',
|
|
80
|
-
[semanticConventions.ATTR_SERVICE_VERSION]: core.SDK_VERSION,
|
|
81
|
-
}),
|
|
82
|
-
),
|
|
73
|
+
resource: opentelemetry.getSentryResource('node'),
|
|
83
74
|
forceFlushTimeoutMillis: 500,
|
|
84
75
|
spanProcessors: [
|
|
85
76
|
new opentelemetry.SentrySpanProcessor({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import { context, propagation, trace } from '@opentelemetry/api';\nimport
|
|
1
|
+
{"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import { context, propagation, trace } from '@opentelemetry/api';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport { debug as coreDebug } from '@sentry/core';\nimport {\n initializeEsmLoader,\n type NodeClient,\n SentryContextManager,\n setupOpenTelemetryLogger,\n} from '@sentry/node-core';\nimport {\n type AsyncLocalStorageLookup,\n getSentryResource,\n SentryPropagator,\n SentrySampler,\n SentrySpanProcessor,\n} from '@sentry/opentelemetry';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing';\n\n// About 277h - this must fit into new Array(len)!\nconst MAX_MAX_SPAN_WAIT_DURATION = 1_000_000;\n\ninterface AdditionalOpenTelemetryOptions {\n /** Additional SpanProcessor instances that should be used. */\n spanProcessors?: SpanProcessor[];\n}\n\n/**\n * Initialize OpenTelemetry for Node.\n */\nexport function initOpenTelemetry(client: NodeClient, options: AdditionalOpenTelemetryOptions = {}): void {\n if (client.getOptions().debug) {\n setupOpenTelemetryLogger();\n }\n\n const [provider, asyncLocalStorageLookup] = setupOtel(client, options);\n client.traceProvider = provider;\n client.asyncLocalStorageLookup = asyncLocalStorageLookup;\n}\n\ninterface NodePreloadOptions {\n debug?: boolean;\n integrations?: string[];\n}\n\n/**\n * Preload OpenTelemetry for Node.\n * This can be used to preload instrumentation early, but set up Sentry later.\n * By preloading the OTEL instrumentation wrapping still happens early enough that everything works.\n */\nexport function preloadOpenTelemetry(options: NodePreloadOptions = {}): void {\n const { debug } = options;\n\n if (debug) {\n coreDebug.enable();\n }\n\n initializeEsmLoader();\n\n // These are all integrations that we need to pre-load to ensure they are set up before any other code runs\n getPreloadMethods(options.integrations).forEach(fn => {\n fn();\n\n if (debug) {\n coreDebug.log(`[Sentry] Preloaded ${fn.id} instrumentation`);\n }\n });\n}\n\nfunction getPreloadMethods(integrationNames?: string[]): ((() => void) & { id: string })[] {\n const instruments = getOpenTelemetryInstrumentationToPreload();\n\n if (!integrationNames) {\n return instruments;\n }\n\n // We match exact matches of instrumentation, but also match prefixes, e.g. \"Fastify.v5\" will match \"Fastify\"\n return instruments.filter(instrumentation => {\n const id = instrumentation.id;\n return integrationNames.some(integrationName => id === integrationName || id.startsWith(`${integrationName}.`));\n });\n}\n\n/** Just exported for tests. */\nexport function setupOtel(\n client: NodeClient,\n options: AdditionalOpenTelemetryOptions = {},\n): [BasicTracerProvider, AsyncLocalStorageLookup] {\n // Create and configure NodeTracerProvider\n const provider = new BasicTracerProvider({\n sampler: new SentrySampler(client),\n resource: getSentryResource('node'),\n forceFlushTimeoutMillis: 500,\n spanProcessors: [\n new SentrySpanProcessor({\n timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration),\n }),\n ...(options.spanProcessors || []),\n ],\n });\n\n // Register as globals\n trace.setGlobalTracerProvider(provider);\n propagation.setGlobalPropagator(new SentryPropagator());\n\n const ctxManager = new SentryContextManager();\n context.setGlobalContextManager(ctxManager);\n\n return [provider, ctxManager.getAsyncLocalStorageLookup()];\n}\n\n/** Just exported for tests. */\nexport function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined {\n if (maxSpanWaitDuration == null) {\n return undefined;\n }\n\n // We guard for a max. value here, because we create an array with this length\n // So if this value is too large, this would fail\n if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) {\n DEBUG_BUILD &&\n coreDebug.warn(`\\`maxSpanWaitDuration\\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`);\n return MAX_MAX_SPAN_WAIT_DURATION;\n } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) {\n DEBUG_BUILD && coreDebug.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.');\n return undefined;\n }\n\n return maxSpanWaitDuration;\n}\n"],"names":["setupOpenTelemetryLogger","coreDebug","initializeEsmLoader","getOpenTelemetryInstrumentationToPreload","BasicTracerProvider","SentrySampler","getSentryResource","SentrySpanProcessor","trace","propagation","SentryPropagator","SentryContextManager","context","DEBUG_BUILD"],"mappings":";;;;;;;;;;AAoBA;AACA,MAAM,0BAAA,GAA6B,OAAS;;AAO5C;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,MAAM,EAAc,OAAO,GAAmC,EAAE,EAAQ;AAC1G,EAAE,IAAI,MAAM,CAAC,UAAU,EAA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AA,CAAA,+EAAA,CAAA;AACA,IAAA,OAAA,SAAA;AACA,EAAA;;AAEA,EAAA,OAAA,mBAAA;AACA;;;;;;;"}
|
|
@@ -33,16 +33,15 @@ class ExpressInstrumentation extends InstrumentationBase {
|
|
|
33
33
|
SUPPORTED_VERSIONS,
|
|
34
34
|
express => {
|
|
35
35
|
try {
|
|
36
|
-
patchExpressModule({
|
|
36
|
+
patchExpressModule(express, () => ({
|
|
37
37
|
...this.getConfig(),
|
|
38
|
-
express,
|
|
39
38
|
onRouteResolved(route) {
|
|
40
39
|
const rpcMetadata = getRPCMetadata(context.active());
|
|
41
40
|
if (route && rpcMetadata?.type === RPCType.HTTP) {
|
|
42
41
|
rpcMetadata.route = route;
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
|
-
});
|
|
44
|
+
}));
|
|
46
45
|
} catch (e) {
|
|
47
46
|
DEBUG_BUILD && debug.error('Failed to patch express module:', e);
|
|
48
47
|
}
|
|
@@ -54,8 +53,7 @@ class ExpressInstrumentation extends InstrumentationBase {
|
|
|
54
53
|
return module;
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
|
-
|
|
58
|
-
const _expressInstrumentation = ((options) => {
|
|
56
|
+
const _expressIntegration = ((options) => {
|
|
59
57
|
return {
|
|
60
58
|
name: INTEGRATION_NAME,
|
|
61
59
|
setupOnce() {
|
|
@@ -64,7 +62,7 @@ const _expressInstrumentation = ((options) => {
|
|
|
64
62
|
};
|
|
65
63
|
}) ;
|
|
66
64
|
|
|
67
|
-
const expressIntegration = defineIntegration(
|
|
65
|
+
const expressIntegration = defineIntegration(_expressIntegration);
|
|
68
66
|
|
|
69
67
|
export { ExpressInstrumentation, expressIntegration, instrumentExpress, setupExpressErrorHandler };
|
|
70
68
|
//# sourceMappingURL=express.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.js","sources":["../../../../src/integrations/tracing/express.ts"],"sourcesContent":["// Automatic istrumentation for Express using OTel\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { context } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\n\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport {\n type ExpressIntegrationOptions,\n type IntegrationFn,\n debug,\n patchExpressModule,\n SDK_VERSION,\n defineIntegration,\n setupExpressErrorHandler as coreSetupExpressErrorHandler,\n type ExpressHandlerOptions,\n} from '@sentry/core';\nexport { expressErrorHandler } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\n\nconst INTEGRATION_NAME = 'Express';\nconst SUPPORTED_VERSIONS = ['>=4.0.0 <6'];\n\nexport function setupExpressErrorHandler(\n //oxlint-disable-next-line no-explicit-any\n app: { use: (middleware: any) => unknown },\n options?: ExpressHandlerOptions,\n): void {\n coreSetupExpressErrorHandler(app, options);\n ensureIsWrapped(app.use, 'express');\n}\n\nexport type ExpressInstrumentationConfig = InstrumentationConfig &\n Omit<ExpressIntegrationOptions, 'express' | 'onRouteResolved'>;\n\nexport const instrumentExpress = generateInstrumentOnce(\n INTEGRATION_NAME,\n (options?: ExpressInstrumentationConfig) => new ExpressInstrumentation(options),\n);\n\nexport class ExpressInstrumentation extends InstrumentationBase<ExpressInstrumentationConfig> {\n public constructor(config: ExpressInstrumentationConfig = {}) {\n super('sentry-express', SDK_VERSION, config);\n }\n public init(): InstrumentationNodeModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition(\n 'express',\n SUPPORTED_VERSIONS,\n express => {\n try {\n patchExpressModule({\n ...this.getConfig(),\n
|
|
1
|
+
{"version":3,"file":"express.js","sources":["../../../../src/integrations/tracing/express.ts"],"sourcesContent":["// Automatic istrumentation for Express using OTel\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { context } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\n\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport {\n type ExpressIntegrationOptions,\n type IntegrationFn,\n debug,\n patchExpressModule,\n SDK_VERSION,\n defineIntegration,\n setupExpressErrorHandler as coreSetupExpressErrorHandler,\n type ExpressHandlerOptions,\n} from '@sentry/core';\nexport { expressErrorHandler } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\n\nconst INTEGRATION_NAME = 'Express';\nconst SUPPORTED_VERSIONS = ['>=4.0.0 <6'];\n\nexport function setupExpressErrorHandler(\n //oxlint-disable-next-line no-explicit-any\n app: { use: (middleware: any) => unknown },\n options?: ExpressHandlerOptions,\n): void {\n coreSetupExpressErrorHandler(app, options);\n ensureIsWrapped(app.use, 'express');\n}\n\nexport type ExpressInstrumentationConfig = InstrumentationConfig &\n Omit<ExpressIntegrationOptions, 'express' | 'onRouteResolved'>;\n\nexport const instrumentExpress = generateInstrumentOnce(\n INTEGRATION_NAME,\n (options?: ExpressInstrumentationConfig) => new ExpressInstrumentation(options),\n);\n\nexport class ExpressInstrumentation extends InstrumentationBase<ExpressInstrumentationConfig> {\n public constructor(config: ExpressInstrumentationConfig = {}) {\n super('sentry-express', SDK_VERSION, config);\n }\n public init(): InstrumentationNodeModuleDefinition {\n const module = new InstrumentationNodeModuleDefinition(\n 'express',\n SUPPORTED_VERSIONS,\n express => {\n try {\n patchExpressModule(express, () => ({\n ...this.getConfig(),\n onRouteResolved(route) {\n const rpcMetadata = getRPCMetadata(context.active());\n if (route && rpcMetadata?.type === RPCType.HTTP) {\n rpcMetadata.route = route;\n }\n },\n }));\n } catch (e) {\n DEBUG_BUILD && debug.error('Failed to patch express module:', e);\n }\n return express;\n },\n // we do not ever actually unpatch in our SDKs\n express => express,\n );\n return module;\n }\n}\nconst _expressIntegration = ((options?: ExpressInstrumentationConfig) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentExpress(options);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const expressIntegration = defineIntegration(_expressIntegration);\n"],"names":["coreSetupExpressErrorHandler"],"mappings":";;;;;;;;AAoBA,MAAM,gBAAA,GAAmB,SAAS;AAClC,MAAM,kBAAA,GAAqB,CAAC,YAAY,CAAC;;AAElC,SAAS,wBAAwB;AACxC;AACA,EAAE,GAAG;AACL,EAAE,OAAO;AACT,EAAQ;AACR,EAAEA,0BAA4B,CAAC,GAAG,EAAE,OAAO,CAAC;AAC5C,EAAE,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC;AACrC;;AAKO,MAAM,iBAAA,GAAoB,sBAAsB;AACvD,EAAE,gBAAgB;AAClB,EAAE,CAAC,OAAO,KAAoC,IAAI,sBAAsB,CAAC,OAAO,CAAC;AACjF;;AAEO,MAAM,sBAAA,SAA+B,mBAAmB,CAA+B;AAC9F,GAAS,WAAW,CAAC,MAAM,GAAiC,EAAE,EAAE;AAChE,IAAI,KAAK,CAAC,gBAAgB,EAAE,WAAW,EAAE,MAAM,CAAC;AAChD,EAAE;AACF,GAAS,IAAI,GAAwC;AACrD,IAAI,MAAM,MAAA,GAAS,IAAI,mCAAmC;AAC1D,MAAM,SAAS;AACf,MAAM,kBAAkB;AACxB,MAAM,WAAW;AACjB,QAAQ,IAAI;AACZ,UAAU,kBAAkB,CAAC,OAAO,EAAE,OAAO;AAC7C,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE;AAC/B,YAAY,eAAe,CAAC,KAAK,EAAE;AACnC,cAAc,MAAM,WAAA,GAAc,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;AAClE,cAAc,IAAI,KAAA,IAAS,WAAW,EAAE,IAAA,KAAS,OAAO,CAAC,IAAI,EAAE;AAC/D,gBAAgB,WAAW,CAAC,KAAA,GAAQ,KAAK;AACzC,cAAc;AACd,YAAY,CAAC;AACb,WAAW,CAAC,CAAC;AACb,QAAQ,CAAA,CAAE,OAAO,CAAC,EAAE;AACpB,UAAU,WAAA,IAAe,KAAK,CAAC,KAAK,CAAC,iCAAiC,EAAE,CAAC,CAAC;AAC1E,QAAQ;AACR,QAAQ,OAAO,OAAO;AACtB,MAAM,CAAC;AACP;AACA,MAAM,OAAA,IAAW,OAAO;AACxB,KAAK;AACL,IAAI,OAAO,MAAM;AACjB,EAAE;AACF;AACA,MAAM,uBAAuB,CAAC,OAAO,KAAoC;AACzE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,iBAAiB,CAAC,OAAO,CAAC;AAChC,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;MAEY,kBAAA,GAAqB,iBAAiB,CAAC,mBAAmB;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.50.0-alpha.0","sideEffects":false}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { trace, propagation, context } from '@opentelemetry/api';
|
|
2
|
-
import { defaultResource, resourceFromAttributes } from '@opentelemetry/resources';
|
|
3
2
|
import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';
|
|
4
|
-
import {
|
|
5
|
-
import { SDK_VERSION, debug } from '@sentry/core';
|
|
3
|
+
import { debug } from '@sentry/core';
|
|
6
4
|
import { setupOpenTelemetryLogger, SentryContextManager, initializeEsmLoader } from '@sentry/node-core';
|
|
7
|
-
import { SentrySpanProcessor, SentrySampler, SentryPropagator } from '@sentry/opentelemetry';
|
|
5
|
+
import { SentrySpanProcessor, SentrySampler, getSentryResource, SentryPropagator } from '@sentry/opentelemetry';
|
|
8
6
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
9
7
|
import { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing/index.js';
|
|
10
8
|
|
|
@@ -70,14 +68,7 @@ function setupOtel(
|
|
|
70
68
|
// Create and configure NodeTracerProvider
|
|
71
69
|
const provider = new BasicTracerProvider({
|
|
72
70
|
sampler: new SentrySampler(client),
|
|
73
|
-
resource:
|
|
74
|
-
resourceFromAttributes({
|
|
75
|
-
[ATTR_SERVICE_NAME]: 'node',
|
|
76
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
77
|
-
[SEMRESATTRS_SERVICE_NAMESPACE]: 'sentry',
|
|
78
|
-
[ATTR_SERVICE_VERSION]: SDK_VERSION,
|
|
79
|
-
}),
|
|
80
|
-
),
|
|
71
|
+
resource: getSentryResource('node'),
|
|
81
72
|
forceFlushTimeoutMillis: 500,
|
|
82
73
|
spanProcessors: [
|
|
83
74
|
new SentrySpanProcessor({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import { context, propagation, trace } from '@opentelemetry/api';\nimport
|
|
1
|
+
{"version":3,"file":"initOtel.js","sources":["../../../src/sdk/initOtel.ts"],"sourcesContent":["import { context, propagation, trace } from '@opentelemetry/api';\nimport type { SpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport { debug as coreDebug } from '@sentry/core';\nimport {\n initializeEsmLoader,\n type NodeClient,\n SentryContextManager,\n setupOpenTelemetryLogger,\n} from '@sentry/node-core';\nimport {\n type AsyncLocalStorageLookup,\n getSentryResource,\n SentryPropagator,\n SentrySampler,\n SentrySpanProcessor,\n} from '@sentry/opentelemetry';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { getOpenTelemetryInstrumentationToPreload } from '../integrations/tracing';\n\n// About 277h - this must fit into new Array(len)!\nconst MAX_MAX_SPAN_WAIT_DURATION = 1_000_000;\n\ninterface AdditionalOpenTelemetryOptions {\n /** Additional SpanProcessor instances that should be used. */\n spanProcessors?: SpanProcessor[];\n}\n\n/**\n * Initialize OpenTelemetry for Node.\n */\nexport function initOpenTelemetry(client: NodeClient, options: AdditionalOpenTelemetryOptions = {}): void {\n if (client.getOptions().debug) {\n setupOpenTelemetryLogger();\n }\n\n const [provider, asyncLocalStorageLookup] = setupOtel(client, options);\n client.traceProvider = provider;\n client.asyncLocalStorageLookup = asyncLocalStorageLookup;\n}\n\ninterface NodePreloadOptions {\n debug?: boolean;\n integrations?: string[];\n}\n\n/**\n * Preload OpenTelemetry for Node.\n * This can be used to preload instrumentation early, but set up Sentry later.\n * By preloading the OTEL instrumentation wrapping still happens early enough that everything works.\n */\nexport function preloadOpenTelemetry(options: NodePreloadOptions = {}): void {\n const { debug } = options;\n\n if (debug) {\n coreDebug.enable();\n }\n\n initializeEsmLoader();\n\n // These are all integrations that we need to pre-load to ensure they are set up before any other code runs\n getPreloadMethods(options.integrations).forEach(fn => {\n fn();\n\n if (debug) {\n coreDebug.log(`[Sentry] Preloaded ${fn.id} instrumentation`);\n }\n });\n}\n\nfunction getPreloadMethods(integrationNames?: string[]): ((() => void) & { id: string })[] {\n const instruments = getOpenTelemetryInstrumentationToPreload();\n\n if (!integrationNames) {\n return instruments;\n }\n\n // We match exact matches of instrumentation, but also match prefixes, e.g. \"Fastify.v5\" will match \"Fastify\"\n return instruments.filter(instrumentation => {\n const id = instrumentation.id;\n return integrationNames.some(integrationName => id === integrationName || id.startsWith(`${integrationName}.`));\n });\n}\n\n/** Just exported for tests. */\nexport function setupOtel(\n client: NodeClient,\n options: AdditionalOpenTelemetryOptions = {},\n): [BasicTracerProvider, AsyncLocalStorageLookup] {\n // Create and configure NodeTracerProvider\n const provider = new BasicTracerProvider({\n sampler: new SentrySampler(client),\n resource: getSentryResource('node'),\n forceFlushTimeoutMillis: 500,\n spanProcessors: [\n new SentrySpanProcessor({\n timeout: _clampSpanProcessorTimeout(client.getOptions().maxSpanWaitDuration),\n }),\n ...(options.spanProcessors || []),\n ],\n });\n\n // Register as globals\n trace.setGlobalTracerProvider(provider);\n propagation.setGlobalPropagator(new SentryPropagator());\n\n const ctxManager = new SentryContextManager();\n context.setGlobalContextManager(ctxManager);\n\n return [provider, ctxManager.getAsyncLocalStorageLookup()];\n}\n\n/** Just exported for tests. */\nexport function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined {\n if (maxSpanWaitDuration == null) {\n return undefined;\n }\n\n // We guard for a max. value here, because we create an array with this length\n // So if this value is too large, this would fail\n if (maxSpanWaitDuration > MAX_MAX_SPAN_WAIT_DURATION) {\n DEBUG_BUILD &&\n coreDebug.warn(`\\`maxSpanWaitDuration\\` is too high, using the maximum value of ${MAX_MAX_SPAN_WAIT_DURATION}`);\n return MAX_MAX_SPAN_WAIT_DURATION;\n } else if (maxSpanWaitDuration <= 0 || Number.isNaN(maxSpanWaitDuration)) {\n DEBUG_BUILD && coreDebug.warn('`maxSpanWaitDuration` must be a positive number, using default value instead.');\n return undefined;\n }\n\n return maxSpanWaitDuration;\n}\n"],"names":["debug","coreDebug"],"mappings":";;;;;;;;AAoBA;AACA,MAAM,0BAAA,GAA6B,OAAS;;AAO5C;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,MAAM,EAAc,OAAO,GAAmC,EAAE,EAAQ;AAC1G,EAAE,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE;AACjC,IAAI,wBAAwB,EAAE;AAC9B,EAAE;;AAEF,EAAE,MAAM,CAAC,QAAQ,EAAE,uBAAuB,CAAA,GAAI,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;AACxE,EAAE,MAAM,CAAC,aAAA,GAAgB,QAAQ;AACjC,EAAE,MAAM,CAAC,uBAAA,GAA0B,uBAAuB;AAC1D;;AAOA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,OAAO,GAAuB,EAAE,EAAQ;AAC7E,EAAE,MAAM,SAAEA,OAAA,EAAM,GAAI,OAAO;;AAE3B,EAAE,IAAIA,OAAK,EAAE;AACb,IAAIC,KAAS,CAAC,MAAM,EAAE;AACtB,EAAE;;AAEF,EAAE,mBAAmB,EAAE;;AAEvB;AACA,EAAE,iBAAiB,CAAC,OAAO,CAAC,YA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;CAAE,EAC1C,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAGN;AAED,MAAM,MAAM,4BAA4B,GAAG,qBAAqB,GAC9D,IAAI,CAAC,yBAAyB,EAAE,SAAS,GAAG,iBAAiB,CAAC,CAAC;AAEjE,eAAO,MAAM,iBAAiB;;CAG7B,CAAC;AAEF,qBAAa,sBAAuB,SAAQ,mBAAmB,CAAC,4BAA4B,CAAC;gBACxE,MAAM,GAAE,4BAAiC;IAGrD,IAAI,IAAI,mCAAmC;
|
|
1
|
+
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/express.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAK1G,OAAO,EACL,KAAK,yBAAyB,EAO9B,KAAK,qBAAqB,EAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAMnD,wBAAgB,wBAAwB,CAEtC,GAAG,EAAE;IAAE,GAAG,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,OAAO,CAAA;CAAE,EAC1C,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAGN;AAED,MAAM,MAAM,4BAA4B,GAAG,qBAAqB,GAC9D,IAAI,CAAC,yBAAyB,EAAE,SAAS,GAAG,iBAAiB,CAAC,CAAC;AAEjE,eAAO,MAAM,iBAAiB;;CAG7B,CAAC;AAEF,qBAAa,sBAAuB,SAAQ,mBAAmB,CAAC,4BAA4B,CAAC;gBACxE,MAAM,GAAE,4BAAiC;IAGrD,IAAI,IAAI,mCAAmC;CAyBnD;AAUD,eAAO,MAAM,kBAAkB,4FAAyC,CAAC"}
|
|
@@ -52,6 +52,11 @@ export interface VercelAiOptions {
|
|
|
52
52
|
* If you want to register the span processors even when the ai package usage cannot be detected, you can set `force` to `true`.
|
|
53
53
|
*/
|
|
54
54
|
force?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Enable or disable truncation of recorded input messages.
|
|
57
|
+
* Defaults to `true`.
|
|
58
|
+
*/
|
|
59
|
+
enableTruncation?: boolean;
|
|
55
60
|
}
|
|
56
61
|
export interface VercelAiIntegration extends Integration {
|
|
57
62
|
options: VercelAiOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/vercelai/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,OAAO,MAAM,cAAc,GAC9B,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,GAChC,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,GAChC,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;AAEtC,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/vercelai/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC3C,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,OAAO,MAAM,cAAc,GAC9B,MAAM,GACN,MAAM,GACN,OAAO,GACP,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,GAChC,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,GAChC,KAAK,CAAC,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;AAEtC,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,OAAO,EAAE,eAAe,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initOtel.d.ts","sourceRoot":"","sources":["../../../src/sdk/initOtel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initOtel.d.ts","sourceRoot":"","sources":["../../../src/sdk/initOtel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EAEL,KAAK,UAAU,EAGhB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,uBAAuB,EAK7B,MAAM,uBAAuB,CAAC;AAO/B,UAAU,8BAA8B;IACtC,8DAA8D;IAC9D,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,GAAE,8BAAmC,GAAG,IAAI,CAQxG;AAED,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,kBAAuB,GAAG,IAAI,CAiB3E;AAgBD,+BAA+B;AAC/B,wBAAgB,SAAS,CACvB,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE,8BAAmC,GAC3C,CAAC,mBAAmB,EAAE,uBAAuB,CAAC,CAsBhD;AAED,+BAA+B;AAC/B,wBAAgB,0BAA0B,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAiBtG"}
|
|
@@ -52,6 +52,11 @@ export interface VercelAiOptions {
|
|
|
52
52
|
* If you want to register the span processors even when the ai package usage cannot be detected, you can set `force` to `true`.
|
|
53
53
|
*/
|
|
54
54
|
force?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Enable or disable truncation of recorded input messages.
|
|
57
|
+
* Defaults to `true`.
|
|
58
|
+
*/
|
|
59
|
+
enableTruncation?: boolean;
|
|
55
60
|
}
|
|
56
61
|
export interface VercelAiIntegration extends Integration {
|
|
57
62
|
options: VercelAiOptions;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/node",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.50.0-alpha.0",
|
|
4
4
|
"description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@opentelemetry/api": "^1.9.1",
|
|
69
|
-
"@opentelemetry/context-async-hooks": "^2.6.1",
|
|
70
69
|
"@opentelemetry/core": "^2.6.1",
|
|
71
70
|
"@opentelemetry/instrumentation": "^0.214.0",
|
|
72
71
|
"@opentelemetry/instrumentation-amqplib": "0.61.0",
|
|
@@ -90,14 +89,13 @@
|
|
|
90
89
|
"@opentelemetry/instrumentation-redis": "0.62.0",
|
|
91
90
|
"@opentelemetry/instrumentation-tedious": "0.33.0",
|
|
92
91
|
"@opentelemetry/instrumentation-undici": "0.24.0",
|
|
93
|
-
"@opentelemetry/resources": "^2.6.1",
|
|
94
92
|
"@opentelemetry/sdk-trace-base": "^2.6.1",
|
|
95
93
|
"@opentelemetry/semantic-conventions": "^1.40.0",
|
|
96
94
|
"@prisma/instrumentation": "7.6.0",
|
|
97
95
|
"@fastify/otel": "0.18.0",
|
|
98
|
-
"@sentry/core": "10.
|
|
99
|
-
"@sentry/node-core": "10.
|
|
100
|
-
"@sentry/opentelemetry": "10.
|
|
96
|
+
"@sentry/core": "10.50.0-alpha.0",
|
|
97
|
+
"@sentry/node-core": "10.50.0-alpha.0",
|
|
98
|
+
"@sentry/opentelemetry": "10.50.0-alpha.0",
|
|
101
99
|
"import-in-the-middle": "^3.0.0"
|
|
102
100
|
},
|
|
103
101
|
"devDependencies": {
|