@sentry/node 9.6.1 → 9.7.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/anr/index.js +1 -1
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js +28 -55
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
- package/build/cjs/integrations/http/SentryHttpInstrumentationBeforeOtel.js +115 -0
- package/build/cjs/integrations/http/SentryHttpInstrumentationBeforeOtel.js.map +1 -0
- package/build/cjs/integrations/http/index.js +18 -10
- package/build/cjs/integrations/http/index.js.map +1 -1
- package/build/cjs/integrations/http/utils.js +44 -0
- package/build/cjs/integrations/http/utils.js.map +1 -0
- package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
- package/build/cjs/integrations/onunhandledrejection.js +12 -6
- package/build/cjs/integrations/onunhandledrejection.js.map +1 -1
- package/build/esm/integrations/anr/index.js +1 -1
- package/build/esm/integrations/anr/worker-script.js +2 -2
- package/build/esm/integrations/http/SentryHttpInstrumentation.js +23 -50
- package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
- package/build/esm/integrations/http/SentryHttpInstrumentationBeforeOtel.js +113 -0
- package/build/esm/integrations/http/SentryHttpInstrumentationBeforeOtel.js.map +1 -0
- package/build/esm/integrations/http/index.js +18 -10
- package/build/esm/integrations/http/index.js.map +1 -1
- package/build/esm/integrations/http/utils.js +42 -0
- package/build/esm/integrations/http/utils.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 +12 -6
- package/build/esm/integrations/onunhandledrejection.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +11 -4
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
- package/build/types/integrations/http/SentryHttpInstrumentationBeforeOtel.d.ts +17 -0
- package/build/types/integrations/http/SentryHttpInstrumentationBeforeOtel.d.ts.map +1 -0
- package/build/types/integrations/http/index.d.ts.map +1 -1
- package/build/types/integrations/http/utils.d.ts +14 -0
- package/build/types/integrations/http/utils.d.ts.map +1 -0
- package/build/types/integrations/onunhandledrejection.d.ts.map +1 -1
- package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +11 -4
- package/build/types-ts3.8/integrations/http/SentryHttpInstrumentationBeforeOtel.d.ts +20 -0
- package/build/types-ts3.8/integrations/http/utils.d.ts +14 -0
- package/package.json +3 -3
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import type { RequestOptions } from 'node:http';
|
|
4
|
-
import type { EventEmitter } from 'node:stream';
|
|
5
3
|
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
6
4
|
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
7
5
|
import type { Scope } from '@sentry/core';
|
|
8
|
-
type
|
|
6
|
+
import type { RequestOptions } from 'node:http';
|
|
7
|
+
import type { EventEmitter } from 'node:stream';
|
|
8
|
+
export type SentryHttpInstrumentationOptions = InstrumentationConfig & {
|
|
9
9
|
/**
|
|
10
10
|
* Whether breadcrumbs should be recorded for requests.
|
|
11
11
|
*
|
|
12
12
|
* @default `true`
|
|
13
13
|
*/
|
|
14
14
|
breadcrumbs?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whether to extract the trace ID from the `sentry-trace` header for incoming requests.
|
|
17
|
+
* By default this is done by the HttpInstrumentation, but if that is not added (e.g. because tracing is disabled, ...)
|
|
18
|
+
* then this instrumentation can take over.
|
|
19
|
+
*
|
|
20
|
+
* @default `false`
|
|
21
|
+
*/
|
|
22
|
+
extractIncomingTraceFromHeader?: boolean;
|
|
15
23
|
/**
|
|
16
24
|
* Do not capture breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.
|
|
17
25
|
* For the scope of this instrumentation, this callback only controls breadcrumb creation.
|
|
@@ -82,5 +90,4 @@ export declare function recordRequestSession({ requestIsolationScope, response,
|
|
|
82
90
|
response: EventEmitter;
|
|
83
91
|
sessionFlushingDelayMS?: number;
|
|
84
92
|
}): void;
|
|
85
|
-
export {};
|
|
86
93
|
//# sourceMappingURL=SentryHttpInstrumentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentryHttpInstrumentation.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/SentryHttpInstrumentation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"SentryHttpInstrumentation.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/SentryHttpInstrumentation.ts"],"names":[],"mappings":";;AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,KAAK,EAAqE,KAAK,EAAE,MAAM,cAAc,CAAC;AAgB7G,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAShD,MAAM,MAAM,gCAAgC,GAAG,qBAAqB,GAAG;IACrE;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;OAMG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IAEzC;;;;;;;;OAQG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC;IAE3E;;;;;OAKG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAE1C;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,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;IAqExC;;OAEG;IACH,OAAO,CAAC,gCAAgC;IAgDxC,sDAAsD;IAEtD,OAAO,CAAC,4BAA4B;CAmBrC;AAuJD;;;;;;;;GAQG;AAEH,wBAAgB,oBAAoB,CAAC,EACnC,qBAAqB,EACrB,QAAQ,EACR,sBAAsB,GACvB,EAAE;IACD,qBAAqB,EAAE,KAAK,CAAC;IAC7B,QAAQ,EAAE,YAAY,CAAC;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,GAAG,IAAI,CAsDP"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
2
|
+
/**
|
|
3
|
+
* A Sentry specific http instrumentation that is applied before the otel instrumentation.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SentryHttpInstrumentationBeforeOtel extends InstrumentationBase {
|
|
6
|
+
constructor();
|
|
7
|
+
init(): [InstrumentationNodeModuleDefinition, InstrumentationNodeModuleDefinition];
|
|
8
|
+
/** Get the instrumentation for the http module. */
|
|
9
|
+
private _getHttpInstrumentation;
|
|
10
|
+
/** Get the instrumentation for the https module. */
|
|
11
|
+
private _getHttpsInstrumentation;
|
|
12
|
+
/**
|
|
13
|
+
* Patch the incoming request function for request isolation.
|
|
14
|
+
*/
|
|
15
|
+
private _getPatchIncomingRequestFunction;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=SentryHttpInstrumentationBeforeOtel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SentryHttpInstrumentationBeforeOtel.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/SentryHttpInstrumentationBeforeOtel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAU1G;;GAEG;AACH,qBAAa,mCAAoC,SAAQ,mBAAmB;;IAMnE,IAAI,IAAI,CAAC,mCAAmC,EAAE,mCAAmC,CAAC;IAIzF,mDAAmD;IACnD,OAAO,CAAC,uBAAuB;IAS/B,oDAAoD;IACpD,OAAO,CAAC,wBAAwB;IAShC;;OAEG;IACH,OAAO,CAAC,gCAAgC;CAoBzC"}
|
|
@@ -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,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;
|
|
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,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,KAAK,EAAE,g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AE,OAAO,CAAC,iBAAiB,CAAM,GAAG,OAAO,CAIpH;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,2EAyB1B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a minimal version of `wrap` from shimmer:
|
|
3
|
+
* https://github.com/othiym23/shimmer/blob/master/index.js
|
|
4
|
+
*
|
|
5
|
+
* In contrast to the original implementation, this version does not allow to unwrap,
|
|
6
|
+
* and does not make it clear that the method is wrapped.
|
|
7
|
+
* This is necessary because we want to wrap the http module with our own code,
|
|
8
|
+
* while still allowing to use the HttpInstrumentation from OTEL.
|
|
9
|
+
*
|
|
10
|
+
* Without this, if we'd just use `wrap` from shimmer, the OTEL instrumentation would remove our wrapping,
|
|
11
|
+
* because it only allows any module to be wrapped a single time.
|
|
12
|
+
*/
|
|
13
|
+
export declare function stealthWrap<Nodule extends object, FieldName extends keyof Nodule>(nodule: Nodule, name: FieldName, wrapper: (original: Nodule[FieldName]) => Nodule[FieldName]): Nodule[FieldName];
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,MAAM,SAAS,MAAM,EAAE,SAAS,SAAS,MAAM,MAAM,EAC/E,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,EACf,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,MAAM,CAAC,SAAS,CAAC,GAC1D,MAAM,CAAC,SAAS,CAAC,CAMnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onunhandledrejection.d.ts","sourceRoot":"","sources":["../../../src/integrations/onunhandledrejection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"onunhandledrejection.d.ts","sourceRoot":"","sources":["../../../src/integrations/onunhandledrejection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAgC,MAAM,cAAc,CAAC;AAIzE,KAAK,sBAAsB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzD,UAAU,2BAA2B;IACnC;;;OAGG;IACH,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAkBD;;GAEG;AACH,eAAO,MAAM,+BAA+B,oGAAsD,CAAC;AAEnG;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,2BAA2B,GACnC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAsB7C"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { RequestOptions } from 'node:http';
|
|
3
|
-
import { EventEmitter } from 'node:stream';
|
|
4
2
|
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
5
3
|
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
6
4
|
import { Scope } from '@sentry/core';
|
|
7
|
-
|
|
5
|
+
import { RequestOptions } from 'node:http';
|
|
6
|
+
import { EventEmitter } from 'node:stream';
|
|
7
|
+
export type SentryHttpInstrumentationOptions = InstrumentationConfig & {
|
|
8
8
|
/**
|
|
9
9
|
* Whether breadcrumbs should be recorded for requests.
|
|
10
10
|
*
|
|
11
11
|
* @default `true`
|
|
12
12
|
*/
|
|
13
13
|
breadcrumbs?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to extract the trace ID from the `sentry-trace` header for incoming requests.
|
|
16
|
+
* By default this is done by the HttpInstrumentation, but if that is not added (e.g. because tracing is disabled, ...)
|
|
17
|
+
* then this instrumentation can take over.
|
|
18
|
+
*
|
|
19
|
+
* @default `false`
|
|
20
|
+
*/
|
|
21
|
+
extractIncomingTraceFromHeader?: boolean;
|
|
14
22
|
/**
|
|
15
23
|
* Do not capture breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.
|
|
16
24
|
* For the scope of this instrumentation, this callback only controls breadcrumb creation.
|
|
@@ -84,5 +92,4 @@ export declare function recordRequestSession({ requestIsolationScope, response,
|
|
|
84
92
|
response: EventEmitter;
|
|
85
93
|
sessionFlushingDelayMS?: number;
|
|
86
94
|
}): void;
|
|
87
|
-
export {};
|
|
88
95
|
//# sourceMappingURL=SentryHttpInstrumentation.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
2
|
+
/**
|
|
3
|
+
* A Sentry specific http instrumentation that is applied before the otel instrumentation.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SentryHttpInstrumentationBeforeOtel extends InstrumentationBase {
|
|
6
|
+
constructor();
|
|
7
|
+
init(): [
|
|
8
|
+
InstrumentationNodeModuleDefinition,
|
|
9
|
+
InstrumentationNodeModuleDefinition
|
|
10
|
+
];
|
|
11
|
+
/** Get the instrumentation for the http module. */
|
|
12
|
+
private _getHttpInstrumentation;
|
|
13
|
+
/** Get the instrumentation for the https module. */
|
|
14
|
+
private _getHttpsInstrumentation;
|
|
15
|
+
/**
|
|
16
|
+
* Patch the incoming request function for request isolation.
|
|
17
|
+
*/
|
|
18
|
+
private _getPatchIncomingRequestFunction;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=SentryHttpInstrumentationBeforeOtel.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a minimal version of `wrap` from shimmer:
|
|
3
|
+
* https://github.com/othiym23/shimmer/blob/master/index.js
|
|
4
|
+
*
|
|
5
|
+
* In contrast to the original implementation, this version does not allow to unwrap,
|
|
6
|
+
* and does not make it clear that the method is wrapped.
|
|
7
|
+
* This is necessary because we want to wrap the http module with our own code,
|
|
8
|
+
* while still allowing to use the HttpInstrumentation from OTEL.
|
|
9
|
+
*
|
|
10
|
+
* Without this, if we'd just use `wrap` from shimmer, the OTEL instrumentation would remove our wrapping,
|
|
11
|
+
* because it only allows any module to be wrapped a single time.
|
|
12
|
+
*/
|
|
13
|
+
export declare function stealthWrap<Nodule extends object, FieldName extends keyof Nodule>(nodule: Nodule, name: FieldName, wrapper: (original: Nodule[FieldName]) => Nodule[FieldName]): Nodule[FieldName];
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/node",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.7.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",
|
|
@@ -96,8 +96,8 @@
|
|
|
96
96
|
"@opentelemetry/sdk-trace-base": "^1.30.1",
|
|
97
97
|
"@opentelemetry/semantic-conventions": "^1.30.0",
|
|
98
98
|
"@prisma/instrumentation": "6.5.0",
|
|
99
|
-
"@sentry/core": "9.
|
|
100
|
-
"@sentry/opentelemetry": "9.
|
|
99
|
+
"@sentry/core": "9.7.0",
|
|
100
|
+
"@sentry/opentelemetry": "9.7.0",
|
|
101
101
|
"import-in-the-middle": "^1.13.0"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|