@sentry/node 8.42.0 → 8.43.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/index.js +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/anr/index.js +26 -1
- package/build/cjs/integrations/anr/index.js.map +1 -1
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js +3 -2
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
- package/build/cjs/integrations/http/index.js +12 -9
- package/build/cjs/integrations/http/index.js.map +1 -1
- package/build/cjs/integrations/http/vendor/getRequestInfo.js +130 -0
- package/build/cjs/integrations/http/vendor/getRequestInfo.js.map +1 -0
- package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
- package/build/cjs/integrations/onunhandledrejection.js +2 -8
- package/build/cjs/integrations/onunhandledrejection.js.map +1 -1
- package/build/cjs/integrations/tracing/express.js +1 -0
- package/build/cjs/integrations/tracing/express.js.map +1 -1
- package/build/cjs/integrations/tracing/index.js +5 -2
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/integrations/tracing/nest/nest.js +9 -2
- package/build/cjs/integrations/tracing/nest/nest.js.map +1 -1
- package/build/cjs/integrations/tracing/vercelai/index.js +202 -0
- package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -0
- package/build/cjs/integrations/tracing/vercelai/instrumentation.js +75 -0
- package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -0
- package/build/cjs/sdk/index.js +1 -0
- package/build/cjs/sdk/index.js.map +1 -1
- package/build/cjs/sdk/initOtel.js +30 -5
- package/build/cjs/sdk/initOtel.js.map +1 -1
- package/build/cjs/utils/errorhandling.js.map +1 -1
- package/build/cjs/utils/module.js +8 -10
- package/build/cjs/utils/module.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/integrations/anr/index.js +27 -3
- package/build/esm/integrations/anr/index.js.map +1 -1
- package/build/esm/integrations/anr/worker-script.js +2 -2
- package/build/esm/integrations/http/SentryHttpInstrumentation.js +3 -2
- package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
- package/build/esm/integrations/http/index.js +12 -9
- package/build/esm/integrations/http/index.js.map +1 -1
- package/build/esm/integrations/http/vendor/getRequestInfo.js +128 -0
- package/build/esm/integrations/http/vendor/getRequestInfo.js.map +1 -0
- package/build/esm/integrations/local-variables/local-variables-async.js +1 -1
- package/build/esm/integrations/local-variables/worker-script.js +2 -2
- package/build/esm/integrations/onunhandledrejection.js +2 -8
- package/build/esm/integrations/onunhandledrejection.js.map +1 -1
- package/build/esm/integrations/tracing/express.js +1 -0
- package/build/esm/integrations/tracing/express.js.map +1 -1
- package/build/esm/integrations/tracing/index.js +3 -0
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/integrations/tracing/nest/nest.js +9 -2
- package/build/esm/integrations/tracing/nest/nest.js.map +1 -1
- package/build/esm/integrations/tracing/vercelai/index.js +196 -0
- package/build/esm/integrations/tracing/vercelai/index.js.map +1 -0
- package/build/esm/integrations/tracing/vercelai/instrumentation.js +73 -0
- package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/sdk/index.js +1 -0
- package/build/esm/sdk/index.js.map +1 -1
- package/build/esm/sdk/initOtel.js +30 -6
- package/build/esm/sdk/initOtel.js.map +1 -1
- package/build/esm/utils/errorhandling.js.map +1 -1
- package/build/esm/utils/module.js +8 -10
- package/build/esm/utils/module.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/anr/index.d.ts +2 -0
- package/build/types/integrations/anr/index.d.ts.map +1 -1
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
- package/build/types/integrations/http/index.d.ts +9 -0
- package/build/types/integrations/http/index.d.ts.map +1 -1
- package/build/types/integrations/http/vendor/getRequestInfo.d.ts +21 -0
- package/build/types/integrations/http/vendor/getRequestInfo.d.ts.map +1 -0
- package/build/types/integrations/tracing/express.d.ts.map +1 -1
- package/build/types/integrations/tracing/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/nest/nest.d.ts.map +1 -1
- package/build/types/integrations/tracing/nest/types.d.ts +14 -6
- package/build/types/integrations/tracing/nest/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/vercelai/index.d.ts +40 -0
- package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/vercelai/instrumentation.d.ts +21 -0
- package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/vercelai/types.d.ts +38 -0
- package/build/types/integrations/tracing/vercelai/types.d.ts.map +1 -0
- package/build/types/sdk/index.d.ts.map +1 -1
- package/build/types/sdk/initOtel.d.ts +2 -0
- package/build/types/sdk/initOtel.d.ts.map +1 -1
- package/build/types/utils/errorhandling.d.ts +1 -1
- package/build/types/utils/errorhandling.d.ts.map +1 -1
- package/build/types/utils/module.d.ts.map +1 -1
- package/build/types-ts3.8/index.d.ts +1 -1
- package/build/types-ts3.8/integrations/anr/index.d.ts +2 -0
- package/build/types-ts3.8/integrations/http/index.d.ts +9 -0
- package/build/types-ts3.8/integrations/http/vendor/getRequestInfo.d.ts +21 -0
- package/build/types-ts3.8/integrations/tracing/nest/types.d.ts +14 -6
- package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +40 -0
- package/build/types-ts3.8/integrations/tracing/vercelai/instrumentation.d.ts +21 -0
- package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +38 -0
- package/build/types-ts3.8/sdk/initOtel.d.ts +2 -0
- package/build/types-ts3.8/utils/errorhandling.d.ts +1 -1
- package/package.json +33 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorhandling.js","sources":["../../../src/utils/errorhandling.ts"],"sourcesContent":["import { consoleSandbox, getClient, logger } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { NodeClient } from '../sdk/client';\n\nconst DEFAULT_SHUTDOWN_TIMEOUT = 2000;\n\n/**\n * @hidden\n */\nexport function logAndExitProcess(error:
|
|
1
|
+
{"version":3,"file":"errorhandling.js","sources":["../../../src/utils/errorhandling.ts"],"sourcesContent":["import { consoleSandbox, getClient, logger } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { NodeClient } from '../sdk/client';\n\nconst DEFAULT_SHUTDOWN_TIMEOUT = 2000;\n\n/**\n * @hidden\n */\nexport function logAndExitProcess(error: unknown): void {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(error);\n });\n\n const client = getClient<NodeClient>();\n\n if (client === undefined) {\n DEBUG_BUILD && logger.warn('No NodeClient was defined, we are exiting the process now.');\n global.process.exit(1);\n return;\n }\n\n const options = client.getOptions();\n const timeout =\n (options && options.shutdownTimeout && options.shutdownTimeout > 0 && options.shutdownTimeout) ||\n DEFAULT_SHUTDOWN_TIMEOUT;\n client.close(timeout).then(\n (result: boolean) => {\n if (!result) {\n DEBUG_BUILD && logger.warn('We reached the timeout for emptying the request buffer, still exiting now!');\n }\n global.process.exit(1);\n },\n error => {\n DEBUG_BUILD && logger.error(error);\n },\n );\n}\n"],"names":[],"mappings":";;;AAIA,MAAM,wBAAA,GAA2B,IAAI;;AAErC;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,KAAK,EAAiB;AACxD,EAAE,cAAc,CAAC,MAAM;AACvB;AACA,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;AACxB,GAAG,CAAC;;AAEJ,EAAE,MAAM,MAAA,GAAS,SAAS,EAAc;;AAExC,EAAE,IAAI,MAAO,KAAI,SAAS,EAAE;AAC5B,IAAI,eAAe,MAAM,CAAC,IAAI,CAAC,4DAA4D,CAAC;AAC5F,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1B,IAAI;AACJ;;AAEA,EAAE,MAAM,OAAQ,GAAE,MAAM,CAAC,UAAU,EAAE;AACrC,EAAE,MAAM,OAAQ;AAChB,IAAI,CAAC,OAAQ,IAAG,OAAO,CAAC,mBAAmB,OAAO,CAAC,eAAA,GAAkB,CAAE,IAAG,OAAO,CAAC,eAAe;AACjG,IAAI,wBAAwB;AAC5B,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI;AAC5B,IAAI,CAAC,MAAM,KAAc;AACzB,MAAM,IAAI,CAAC,MAAM,EAAE;AACnB,QAAQ,eAAe,MAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC;AAChH;AACA,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5B,KAAK;AACL,IAAI,SAAS;AACb,MAAM,eAAe,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;AACxC,KAAK;AACL,GAAG;AACH;;;;"}
|
|
@@ -29,6 +29,10 @@ function createGetModuleFromFilename(
|
|
|
29
29
|
file = file.slice(0, ext.length * -1);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// The file name might be URI-encoded which we want to decode to
|
|
33
|
+
// the original file name.
|
|
34
|
+
const decodedFile = decodeURIComponent(file);
|
|
35
|
+
|
|
32
36
|
if (!dir) {
|
|
33
37
|
// No dirname whatsoever
|
|
34
38
|
dir = '.';
|
|
@@ -36,23 +40,17 @@ function createGetModuleFromFilename(
|
|
|
36
40
|
|
|
37
41
|
const n = dir.lastIndexOf('/node_modules');
|
|
38
42
|
if (n > -1) {
|
|
39
|
-
return `${dir.slice(n + 14).replace(/\//g, '.')}:${
|
|
43
|
+
return `${dir.slice(n + 14).replace(/\//g, '.')}:${decodedFile}`;
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
// Let's see if it's a part of the main module
|
|
43
47
|
// To be a part of main module, it has to share the same base
|
|
44
48
|
if (dir.startsWith(normalizedBase)) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (moduleName) {
|
|
48
|
-
moduleName += ':';
|
|
49
|
-
}
|
|
50
|
-
moduleName += file;
|
|
51
|
-
|
|
52
|
-
return moduleName;
|
|
49
|
+
const moduleName = dir.slice(normalizedBase.length + 1).replace(/\//g, '.');
|
|
50
|
+
return moduleName ? `${moduleName}:${decodedFile}` : decodedFile;
|
|
53
51
|
}
|
|
54
52
|
|
|
55
|
-
return
|
|
53
|
+
return decodedFile;
|
|
56
54
|
};
|
|
57
55
|
}
|
|
58
56
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../../src/utils/module.ts"],"sourcesContent":["import { posix, sep } from 'node:path';\nimport { dirname } from '@sentry/core';\n\n/** normalizes Windows paths */\nfunction normalizeWindowsPath(path: string): string {\n return path\n .replace(/^[A-Z]:/, '') // remove Windows-style prefix\n .replace(/\\\\/g, '/'); // replace all `\\` instances with `/`\n}\n\n/** Creates a function that gets the module name from a filename */\nexport function createGetModuleFromFilename(\n basePath: string = process.argv[1] ? dirname(process.argv[1]) : process.cwd(),\n isWindows: boolean = sep === '\\\\',\n): (filename: string | undefined) => string | undefined {\n const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;\n\n return (filename: string | undefined) => {\n if (!filename) {\n return;\n }\n\n const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;\n\n // eslint-disable-next-line prefer-const\n let { dir, base: file, ext } = posix.parse(normalizedFilename);\n\n if (ext === '.js' || ext === '.mjs' || ext === '.cjs') {\n file = file.slice(0, ext.length * -1);\n }\n\n if (!dir) {\n // No dirname whatsoever\n dir = '.';\n }\n\n const n = dir.lastIndexOf('/node_modules');\n if (n > -1) {\n return `${dir.slice(n + 14).replace(/\\//g, '.')}:${
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../../../src/utils/module.ts"],"sourcesContent":["import { posix, sep } from 'node:path';\nimport { dirname } from '@sentry/core';\n\n/** normalizes Windows paths */\nfunction normalizeWindowsPath(path: string): string {\n return path\n .replace(/^[A-Z]:/, '') // remove Windows-style prefix\n .replace(/\\\\/g, '/'); // replace all `\\` instances with `/`\n}\n\n/** Creates a function that gets the module name from a filename */\nexport function createGetModuleFromFilename(\n basePath: string = process.argv[1] ? dirname(process.argv[1]) : process.cwd(),\n isWindows: boolean = sep === '\\\\',\n): (filename: string | undefined) => string | undefined {\n const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;\n\n return (filename: string | undefined) => {\n if (!filename) {\n return;\n }\n\n const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;\n\n // eslint-disable-next-line prefer-const\n let { dir, base: file, ext } = posix.parse(normalizedFilename);\n\n if (ext === '.js' || ext === '.mjs' || ext === '.cjs') {\n file = file.slice(0, ext.length * -1);\n }\n\n // The file name might be URI-encoded which we want to decode to\n // the original file name.\n const decodedFile = decodeURIComponent(file);\n\n if (!dir) {\n // No dirname whatsoever\n dir = '.';\n }\n\n const n = dir.lastIndexOf('/node_modules');\n if (n > -1) {\n return `${dir.slice(n + 14).replace(/\\//g, '.')}:${decodedFile}`;\n }\n\n // Let's see if it's a part of the main module\n // To be a part of main module, it has to share the same base\n if (dir.startsWith(normalizedBase)) {\n const moduleName = dir.slice(normalizedBase.length + 1).replace(/\\//g, '.');\n return moduleName ? `${moduleName}:${decodedFile}` : decodedFile;\n }\n\n return decodedFile;\n };\n}\n"],"names":[],"mappings":";;;AAGA;AACA,SAAS,oBAAoB,CAAC,IAAI,EAAkB;AACpD,EAAE,OAAO;AACT,KAAK,OAAO,CAAC,SAAS,EAAE,EAAE,CAAA;AAC1B,KAAK,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AACxB;;AAEA;AACO,SAAS,2BAA2B;AAC3C,EAAE,QAAQ,GAAW,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,GAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA,GAAI,OAAO,CAAC,GAAG,EAAE;AAC/E,EAAE,SAAS,GAAY,GAAA,KAAQ,IAAI;AACnC,EAAwD;AACx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AA,CAAA,EAAA,UAAA,CAAA,CAAA,EAAA,WAAA,CAAA,CAAA,GAAA,WAAA;AACA;;AAEA,IAAA,OAAA,WAAA;AACA,GAAA;AACA;;;;"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { localVariablesIntegration } from './integrations/local-variables';
|
|
|
8
8
|
export { modulesIntegration } from './integrations/modules';
|
|
9
9
|
export { onUncaughtExceptionIntegration } from './integrations/onuncaughtexception';
|
|
10
10
|
export { onUnhandledRejectionIntegration } from './integrations/onunhandledrejection';
|
|
11
|
-
export { anrIntegration } from './integrations/anr';
|
|
11
|
+
export { anrIntegration, disableAnrDetectionForCallback } from './integrations/anr';
|
|
12
12
|
export { expressIntegration, expressErrorHandler, setupExpressErrorHandler } from './integrations/tracing/express';
|
|
13
13
|
export { fastifyIntegration, setupFastifyErrorHandler } from './integrations/tracing/fastify';
|
|
14
14
|
export { graphqlIntegration } from './integrations/tracing/graphql';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,EAA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ACjB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,QAAQ,GACT,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAElB,OAAO,EACP,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,OAAO,EACP,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,GACL,MAAM,cAAc,CAAC"}
|
|
@@ -7,5 +7,7 @@ type AnrInternal = {
|
|
|
7
7
|
};
|
|
8
8
|
type AnrReturn = (options?: Partial<AnrIntegrationOptions>) => Integration & AnrInternal;
|
|
9
9
|
export declare const anrIntegration: AnrReturn;
|
|
10
|
+
export declare function disableAnrDetectionForCallback<T>(callback: () => T): T;
|
|
11
|
+
export declare function disableAnrDetectionForCallback<T>(callback: () => Promise<T>): Promise<T>;
|
|
10
12
|
export {};
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/anr/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/anr/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA8B,WAAW,EAA4B,MAAM,cAAc,CAAC;AActG,OAAO,KAAK,EAAE,qBAAqB,EAAmB,MAAM,UAAU,CAAC;AAKvE,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AA4C1D,KAAK,WAAW,GAAG;IAAE,WAAW,EAAE,MAAM,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AA6CvE,KAAK,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,WAAW,GAAG,WAAW,CAAC;AAEzF,eAAO,MAAM,cAAc,WAAkD,CAAC;AA4G9E,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AACxE,wBAAgB,8BAA8B,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentryHttpInstrumentation.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/SentryHttpInstrumentation.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,WAAW,CAAC;AAGjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"SentryHttpInstrumentation.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/SentryHttpInstrumentation.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,WAAW,CAAC;AAGjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAqB1G,KAAK,gCAAgC,GAAG,qBAAqB,GAAG;IAC9D;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC;CAC5E,CAAC;AAKF;;;;;;;;;;;;GAYG;AACH,qBAAa,yBAA0B,SAAQ,mBAAmB,CAAC,gCAAgC,CAAC;gBAC/E,MAAM,GAAE,gCAAqC;IAIhE,kBAAkB;IACX,IAAI,IAAI,CAAC,mCAAmC,EAAE,mCAAmC,CAAC;IAIzF,mDAAmD;IACnD,OAAO,CAAC,uBAAuB;IAoB/B,oDAAoD;IACpD,OAAO,CAAC,wBAAwB;IAoBhC;;OAEG;IACH,OAAO,CAAC,gCAAgC;IAsDxC;;OAEG;IACH,OAAO,CAAC,gCAAgC;IAgDxC,sDAAsD;IAEtD,OAAO,CAAC,4BAA4B;CAmBrC"}
|
|
@@ -16,6 +16,15 @@ interface HttpOptions {
|
|
|
16
16
|
* only the Sentry-specific instrumentation for request isolation is applied.
|
|
17
17
|
*/
|
|
18
18
|
spans?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.
|
|
21
|
+
* Read more about Release Health: https://docs.sentry.io/product/releases/health/
|
|
22
|
+
*
|
|
23
|
+
* Defaults to `true`.
|
|
24
|
+
*
|
|
25
|
+
* Note: If `autoSessionTracking` is set to `false` in `Sentry.init()` or the Client owning this integration, this option will be ignored.
|
|
26
|
+
*/
|
|
27
|
+
trackIncomingRequestsAsSessions?: boolean;
|
|
19
28
|
/**
|
|
20
29
|
* Do not capture spans or breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.
|
|
21
30
|
* This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/index.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eA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AC5E,CAAC;CACH;AAED,eAAO,MAAM,oBAAoB;kBACjB,WAAW,CAAC,aAAa,CAAC;6BACf,WAAW,CAAC,wBAAwB,CAAC;;;CAM9D,CAAC;AAEH,eAAO,MAAM,kBAAkB;;CAe7B,CAAC;AAkBH;;;GAGG;AACH,eAAO,MAAM,eAAe,2EAO1B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored in from https://github.com/open-telemetry/opentelemetry-js/commit/87bd98edd24c98a5fbb9a56fed4b673b7f17a724
|
|
3
|
+
*/
|
|
4
|
+
import type { RequestOptions } from 'node:http';
|
|
5
|
+
import * as url from 'url';
|
|
6
|
+
import type { DiagLogger } from '@opentelemetry/api';
|
|
7
|
+
/**
|
|
8
|
+
* Makes sure options is an url object
|
|
9
|
+
* return an object with default value and parsed options
|
|
10
|
+
* @param logger component logger
|
|
11
|
+
* @param options original options for the request
|
|
12
|
+
* @param [extraOptions] additional options for the request
|
|
13
|
+
*/
|
|
14
|
+
export declare const getRequestInfo: (logger: DiagLogger, options: url.URL | RequestOptions | string, extraOptions?: RequestOptions) => {
|
|
15
|
+
origin: string;
|
|
16
|
+
pathname: string;
|
|
17
|
+
method: string;
|
|
18
|
+
invalidUrl: boolean;
|
|
19
|
+
optionsParsed: RequestOptions;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=getRequestInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRequestInfo.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/http/vendor/getRequestInfo.ts"],"names":[],"mappings":"AAEA;;GAEG;AAiBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,WACjB,UAAU,WACT,OAAO,GAAG,cAAc,GAAG,MAAM,iBAC3B,cAAc;YAErB,MAAM;cACJ,MAAM;YACR,MAAM;gBACF,OAAO;mBACJ,cAAc;CAwE9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/express.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAqBvC,eAAO,MAAM,iBAAiB;;CAoC7B,CAAC;AAWF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,0CAAyC,CAAC;AAEzE,UAAU,eAAgB,SAAQ,KAAK;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9B,CAAC;CACH;AAED,KAAK,iBAAiB,GAAG,CACvB,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,IAAI,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,KACnC,IAAI,CAAC;AAEV,UAAU,qBAAqB;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC;CACjE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/express.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAqBvC,eAAO,MAAM,iBAAiB;;CAoC7B,CAAC;AAWF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,0CAAyC,CAAC;AAEzE,UAAU,eAAgB,SAAQ,KAAK;IACrC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,MAAM,CAAC,EAAE;QACP,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9B,CAAC;CACH;AAED,KAAK,iBAAiB,GAAG,CACvB,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,IAAI,CAAC,eAAe,EACzB,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,IAAI,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,KACnC,IAAI,CAAC;AAEV,UAAU,qBAAqB;IAC7B;;;OAGG;IACH,iBAAiB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC;CACjE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,iBAAiB,CAsCtF;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE;IAAE,GAAG,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,OAAO,CAAA;CAAE,EACxD,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAGN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAuBhD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CA2B9D;AAED;;GAEG;AAEH,wBAAgB,wCAAwC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,CAyBzG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nest.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/nest/nest.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgBnE,eAAO,MAAM,cAAc,SACrB,IAAI;;CAMT,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,0CAO1B,CAAC;AAEH;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"nest.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/nest/nest.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgBnE,eAAO,MAAM,cAAc,SACrB,IAAI;;CAMT,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,0CAO1B,CAAC;AAEH;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAuEhG"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
interface FastifyRequest {
|
|
2
|
+
routeOptions?: {
|
|
3
|
+
method?: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
interface ExpressRequest {
|
|
8
|
+
route?: {
|
|
9
|
+
path?: string;
|
|
10
|
+
};
|
|
11
|
+
method?: string;
|
|
12
|
+
}
|
|
1
13
|
export interface MinimalNestJsExecutionContext {
|
|
2
14
|
getType: () => string;
|
|
3
15
|
switchToHttp: () => {
|
|
4
|
-
getRequest: () =>
|
|
5
|
-
route?: {
|
|
6
|
-
path?: string;
|
|
7
|
-
};
|
|
8
|
-
method?: string;
|
|
9
|
-
};
|
|
16
|
+
getRequest: () => FastifyRequest | ExpressRequest;
|
|
10
17
|
};
|
|
11
18
|
_sentryInterceptorInstrumented?: boolean;
|
|
12
19
|
}
|
|
@@ -73,4 +80,5 @@ export interface OnEventTarget {
|
|
|
73
80
|
* Represents an express NextFunction.
|
|
74
81
|
*/
|
|
75
82
|
export type NextFunction = (err?: any) => void;
|
|
83
|
+
export {};
|
|
76
84
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/nest/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/nest/types.ts"],"names":[],"mappings":"AAIA,UAAU,cAAc;IACtB,YAAY,CAAC,EAAE;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAGD,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,MAAM,MAAM,CAAC;IAEtB,YAAY,EAAE,MAAM;QAIlB,UAAU,EAAE,MAAM,cAAc,GAAG,cAAc,CAAC;KACnD,CAAC;IAEF,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,SAAS,EA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UAAU,CAAC,OAAO,CAAC,CAAC;QACnF,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;QACpC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,UAAU,CAAC,GAAG,CAAC,CAAC;KACtF,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE;QACT,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;KACjC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const instrumentVercelAi: ((options?: unknown) => void) & {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
|
|
6
|
+
*
|
|
7
|
+
* For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```javascript
|
|
11
|
+
* const Sentry = require('@sentry/node');
|
|
12
|
+
*
|
|
13
|
+
* Sentry.init({
|
|
14
|
+
* integrations: [Sentry.vercelAIIntegration()],
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* By default this integration adds tracing support to all `ai` function calls. If you need to disable
|
|
19
|
+
* collecting spans for a specific call, you can do so by setting `experimental_telemetry.isEnabled` to
|
|
20
|
+
* `false` in the first argument of the function call.
|
|
21
|
+
*
|
|
22
|
+
* ```javascript
|
|
23
|
+
* const result = await generateText({
|
|
24
|
+
* model: openai('gpt-4-turbo'),
|
|
25
|
+
* experimental_telemetry: { isEnabled: false },
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each
|
|
30
|
+
* function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`
|
|
31
|
+
* to `true`.
|
|
32
|
+
*
|
|
33
|
+
* ```javascript
|
|
34
|
+
* const result = await generateText({
|
|
35
|
+
* model: openai('gpt-4-turbo'),
|
|
36
|
+
* experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },
|
|
37
|
+
* });
|
|
38
|
+
*/
|
|
39
|
+
export declare const vercelAIIntegration: () => import("@sentry/core").Integration;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/vercelai/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB;;CAAkF,CAAC;AAqJlH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,mBAAmB,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InstrumentationBase } from '@opentelemetry/instrumentation';
|
|
2
|
+
import type { InstrumentationConfig, InstrumentationModuleDefinition } from '@opentelemetry/instrumentation';
|
|
3
|
+
export declare let sentryVercelAiPatched: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* This detects is added by the Sentry Vercel AI Integration to detect if the integration should
|
|
6
|
+
* be enabled.
|
|
7
|
+
*
|
|
8
|
+
* It also patches the `ai` module to enable Vercel AI telemetry automatically for all methods.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SentryVercelAiInstrumentation extends InstrumentationBase {
|
|
11
|
+
constructor(config?: InstrumentationConfig);
|
|
12
|
+
/**
|
|
13
|
+
* Initializes the instrumentation by defining the modules to be patched.
|
|
14
|
+
*/
|
|
15
|
+
init(): InstrumentationModuleDefinition;
|
|
16
|
+
/**
|
|
17
|
+
* Patches module exports to enable Vercel AI telemetry.
|
|
18
|
+
*/
|
|
19
|
+
private _patch;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/vercelai/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAuC,MAAM,gCAAgC,CAAC;AAC1G,OAAO,KAAK,EAAE,qBAAqB,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAwB7G,eAAO,IAAI,qBAAqB,SAAQ,CAAC;AAEzC;;;;;GAKG;AACH,qBAAa,6BAA8B,SAAQ,mBAAmB;gBACjD,MAAM,GAAE,qBAA0B;IAIrD;;OAEG;IACI,IAAI,IAAI,+BAA+B;IAK9C;;OAEG;IACH,OAAO,CAAC,MAAM;CA+Bf"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telemetry configuration.
|
|
3
|
+
*/
|
|
4
|
+
export type TelemetrySettings = {
|
|
5
|
+
/**
|
|
6
|
+
* Enable or disable telemetry. Disabled by default while experimental.
|
|
7
|
+
*/
|
|
8
|
+
isEnabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Enable or disable input recording. Enabled by default.
|
|
11
|
+
*
|
|
12
|
+
* You might want to disable input recording to avoid recording sensitive
|
|
13
|
+
* information, to reduce data transfers, or to increase performance.
|
|
14
|
+
*/
|
|
15
|
+
recordInputs?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Enable or disable output recording. Enabled by default.
|
|
18
|
+
*
|
|
19
|
+
* You might want to disable output recording to avoid recording sensitive
|
|
20
|
+
* information, to reduce data transfers, or to increase performance.
|
|
21
|
+
*/
|
|
22
|
+
recordOutputs?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Identifier for this function. Used to group telemetry data by function.
|
|
25
|
+
*/
|
|
26
|
+
functionId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Additional information to include in the telemetry data.
|
|
29
|
+
*/
|
|
30
|
+
metadata?: Record<string, AttributeValue>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Attribute values may be any non-nullish primitive value except an object.
|
|
34
|
+
*
|
|
35
|
+
* null or undefined attribute values are invalid and will result in undefined behavior.
|
|
36
|
+
*/
|
|
37
|
+
export declare type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/vercelai/types.ts"],"names":[],"mappings":"AAAA;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAuCzD,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,UAAU,CAAC;AAI/D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAOtC;;GAEG;AACH,wBAAgB,wCAAwC,IAAI,WAAW,EAAE,CAqBxE;AAED,qDAAqD;AACrD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CAStE;AAYD;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,GAAG,SAAS,CAElF;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,CAEhG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAuCzD,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,UAAU,CAAC;AAI/D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAOtC;;GAEG;AACH,wBAAgB,wCAAwC,IAAI,WAAW,EAAE,CAqBxE;AAED,qDAAqD;AACrD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CAStE;AAYD;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,GAAG,SAAS,CAElF;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,CAEhG;AAsED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CA0BjD"}
|
|
@@ -20,5 +20,7 @@ interface NodePreloadOptions {
|
|
|
20
20
|
export declare function preloadOpenTelemetry(options?: NodePreloadOptions): void;
|
|
21
21
|
/** Just exported for tests. */
|
|
22
22
|
export declare function setupOtel(client: NodeClient): BasicTracerProvider;
|
|
23
|
+
/** Just exported for tests. */
|
|
24
|
+
export declare function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined;
|
|
23
25
|
export {};
|
|
24
26
|
//# sourceMappingURL=initOtel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initOtel.d.ts","sourceRoot":"","sources":["../../../src/sdk/initOtel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"initOtel.d.ts","sourceRoot":"","sources":["../../../src/sdk/initOtel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAYpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAO3C;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAO1D;AAwBD,iCAAiC;AACjC,wBAAgB,wBAAwB,CAAC,aAAa,CAAC,EAAE,oBAAoB,GAAG,IAAI,CA0BnF;AAED,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,sBAAsB,CAAC,EAAE,oBAAoB,CAAC;CAC/C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,kBAAuB,GAAG,IAAI,CAoB3E;AAYD,+BAA+B;AAC/B,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,mBAAmB,CAyBjE;AAED,+BAA+B;AAC/B,wBAAgB,0BAA0B,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAiBtG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorhandling.d.ts","sourceRoot":"","sources":["../../../src/utils/errorhandling.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"errorhandling.d.ts","sourceRoot":"","sources":["../../../src/utils/errorhandling.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CA6BtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/utils/module.ts"],"names":[],"mappings":"AAUA,mEAAmE;AACnE,wBAAgB,2BAA2B,CACzC,QAAQ,GAAE,MAAmE,EAC7E,SAAS,GAAE,OAAsB,GAChC,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/utils/module.ts"],"names":[],"mappings":"AAUA,mEAAmE;AACnE,wBAAgB,2BAA2B,CACzC,QAAQ,GAAE,MAAmE,EAC7E,SAAS,GAAE,OAAsB,GAChC,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,CAwCtD"}
|
|
@@ -8,7 +8,7 @@ export { localVariablesIntegration } from './integrations/local-variables';
|
|
|
8
8
|
export { modulesIntegration } from './integrations/modules';
|
|
9
9
|
export { onUncaughtExceptionIntegration } from './integrations/onuncaughtexception';
|
|
10
10
|
export { onUnhandledRejectionIntegration } from './integrations/onunhandledrejection';
|
|
11
|
-
export { anrIntegration } from './integrations/anr';
|
|
11
|
+
export { anrIntegration, disableAnrDetectionForCallback } from './integrations/anr';
|
|
12
12
|
export { expressIntegration, expressErrorHandler, setupExpressErrorHandler } from './integrations/tracing/express';
|
|
13
13
|
export { fastifyIntegration, setupFastifyErrorHandler } from './integrations/tracing/fastify';
|
|
14
14
|
export { graphqlIntegration } from './integrations/tracing/graphql';
|
|
@@ -7,5 +7,7 @@ type AnrInternal = {
|
|
|
7
7
|
};
|
|
8
8
|
type AnrReturn = (options?: Partial<AnrIntegrationOptions>) => Integration & AnrInternal;
|
|
9
9
|
export declare const anrIntegration: AnrReturn;
|
|
10
|
+
export declare function disableAnrDetectionForCallback<T>(callback: () => T): T;
|
|
11
|
+
export declare function disableAnrDetectionForCallback<T>(callback: () => Promise<T>): Promise<T>;
|
|
10
12
|
export {};
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -16,6 +16,15 @@ interface HttpOptions {
|
|
|
16
16
|
* only the Sentry-specific instrumentation for request isolation is applied.
|
|
17
17
|
*/
|
|
18
18
|
spans?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.
|
|
21
|
+
* Read more about Release Health: https://docs.sentry.io/product/releases/health/
|
|
22
|
+
*
|
|
23
|
+
* Defaults to `true`.
|
|
24
|
+
*
|
|
25
|
+
* Note: If `autoSessionTracking` is set to `false` in `Sentry.init()` or the Client owning this integration, this option will be ignored.
|
|
26
|
+
*/
|
|
27
|
+
trackIncomingRequestsAsSessions?: boolean;
|
|
19
28
|
/**
|
|
20
29
|
* Do not capture spans or breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.
|
|
21
30
|
* This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vendored in from https://github.com/open-telemetry/opentelemetry-js/commit/87bd98edd24c98a5fbb9a56fed4b673b7f17a724
|
|
3
|
+
*/
|
|
4
|
+
import { RequestOptions } from 'node:http';
|
|
5
|
+
import * as url from 'url';
|
|
6
|
+
import { DiagLogger } from '@opentelemetry/api';
|
|
7
|
+
/**
|
|
8
|
+
* Makes sure options is an url object
|
|
9
|
+
* return an object with default value and parsed options
|
|
10
|
+
* @param logger component logger
|
|
11
|
+
* @param options original options for the request
|
|
12
|
+
* @param [extraOptions] additional options for the request
|
|
13
|
+
*/
|
|
14
|
+
export declare const getRequestInfo: (logger: DiagLogger, options: url.URL | RequestOptions | string, extraOptions?: RequestOptions) => {
|
|
15
|
+
origin: string;
|
|
16
|
+
pathname: string;
|
|
17
|
+
method: string;
|
|
18
|
+
invalidUrl: boolean;
|
|
19
|
+
optionsParsed: RequestOptions;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=getRequestInfo.d.ts.map
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
interface FastifyRequest {
|
|
2
|
+
routeOptions?: {
|
|
3
|
+
method?: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
interface ExpressRequest {
|
|
8
|
+
route?: {
|
|
9
|
+
path?: string;
|
|
10
|
+
};
|
|
11
|
+
method?: string;
|
|
12
|
+
}
|
|
1
13
|
export interface MinimalNestJsExecutionContext {
|
|
2
14
|
getType: () => string;
|
|
3
15
|
switchToHttp: () => {
|
|
4
|
-
getRequest: () =>
|
|
5
|
-
route?: {
|
|
6
|
-
path?: string;
|
|
7
|
-
};
|
|
8
|
-
method?: string;
|
|
9
|
-
};
|
|
16
|
+
getRequest: () => FastifyRequest | ExpressRequest;
|
|
10
17
|
};
|
|
11
18
|
_sentryInterceptorInstrumented?: boolean;
|
|
12
19
|
}
|
|
@@ -73,4 +80,5 @@ export interface OnEventTarget {
|
|
|
73
80
|
* Represents an express NextFunction.
|
|
74
81
|
*/
|
|
75
82
|
export type NextFunction = (err?: any) => void;
|
|
83
|
+
export {};
|
|
76
84
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const instrumentVercelAi: ((options?: unknown) => void) & {
|
|
2
|
+
id: string;
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
|
|
6
|
+
*
|
|
7
|
+
* For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```javascript
|
|
11
|
+
* const Sentry = require('@sentry/node');
|
|
12
|
+
*
|
|
13
|
+
* Sentry.init({
|
|
14
|
+
* integrations: [Sentry.vercelAIIntegration()],
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* By default this integration adds tracing support to all `ai` function calls. If you need to disable
|
|
19
|
+
* collecting spans for a specific call, you can do so by setting `experimental_telemetry.isEnabled` to
|
|
20
|
+
* `false` in the first argument of the function call.
|
|
21
|
+
*
|
|
22
|
+
* ```javascript
|
|
23
|
+
* const result = await generateText({
|
|
24
|
+
* model: openai('gpt-4-turbo'),
|
|
25
|
+
* experimental_telemetry: { isEnabled: false },
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each
|
|
30
|
+
* function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`
|
|
31
|
+
* to `true`.
|
|
32
|
+
*
|
|
33
|
+
* ```javascript
|
|
34
|
+
* const result = await generateText({
|
|
35
|
+
* model: openai('gpt-4-turbo'),
|
|
36
|
+
* experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },
|
|
37
|
+
* });
|
|
38
|
+
*/
|
|
39
|
+
export declare const vercelAIIntegration: () => import("@sentry/core").Integration;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InstrumentationBase } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { InstrumentationConfig, InstrumentationModuleDefinition } from '@opentelemetry/instrumentation';
|
|
3
|
+
export declare let sentryVercelAiPatched: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* This detects is added by the Sentry Vercel AI Integration to detect if the integration should
|
|
6
|
+
* be enabled.
|
|
7
|
+
*
|
|
8
|
+
* It also patches the `ai` module to enable Vercel AI telemetry automatically for all methods.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SentryVercelAiInstrumentation extends InstrumentationBase {
|
|
11
|
+
constructor(config?: InstrumentationConfig);
|
|
12
|
+
/**
|
|
13
|
+
* Initializes the instrumentation by defining the modules to be patched.
|
|
14
|
+
*/
|
|
15
|
+
init(): InstrumentationModuleDefinition;
|
|
16
|
+
/**
|
|
17
|
+
* Patches module exports to enable Vercel AI telemetry.
|
|
18
|
+
*/
|
|
19
|
+
private _patch;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=instrumentation.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telemetry configuration.
|
|
3
|
+
*/
|
|
4
|
+
export type TelemetrySettings = {
|
|
5
|
+
/**
|
|
6
|
+
* Enable or disable telemetry. Disabled by default while experimental.
|
|
7
|
+
*/
|
|
8
|
+
isEnabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Enable or disable input recording. Enabled by default.
|
|
11
|
+
*
|
|
12
|
+
* You might want to disable input recording to avoid recording sensitive
|
|
13
|
+
* information, to reduce data transfers, or to increase performance.
|
|
14
|
+
*/
|
|
15
|
+
recordInputs?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Enable or disable output recording. Enabled by default.
|
|
18
|
+
*
|
|
19
|
+
* You might want to disable output recording to avoid recording sensitive
|
|
20
|
+
* information, to reduce data transfers, or to increase performance.
|
|
21
|
+
*/
|
|
22
|
+
recordOutputs?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Identifier for this function. Used to group telemetry data by function.
|
|
25
|
+
*/
|
|
26
|
+
functionId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Additional information to include in the telemetry data.
|
|
29
|
+
*/
|
|
30
|
+
metadata?: Record<string, AttributeValue>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Attribute values may be any non-nullish primitive value except an object.
|
|
34
|
+
*
|
|
35
|
+
* null or undefined attribute values are invalid and will result in undefined behavior.
|
|
36
|
+
*/
|
|
37
|
+
export declare type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -20,5 +20,7 @@ interface NodePreloadOptions {
|
|
|
20
20
|
export declare function preloadOpenTelemetry(options?: NodePreloadOptions): void;
|
|
21
21
|
/** Just exported for tests. */
|
|
22
22
|
export declare function setupOtel(client: NodeClient): BasicTracerProvider;
|
|
23
|
+
/** Just exported for tests. */
|
|
24
|
+
export declare function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined;
|
|
23
25
|
export {};
|
|
24
26
|
//# sourceMappingURL=initOtel.d.ts.map
|