@sentry/node 9.15.0 → 9.16.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/context.js +1 -0
- package/build/cjs/integrations/context.js.map +1 -1
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js +130 -126
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
- package/build/cjs/integrations/http/SentryHttpInstrumentationBeforeOtel.js +50 -44
- package/build/cjs/integrations/http/SentryHttpInstrumentationBeforeOtel.js.map +1 -1
- package/build/cjs/integrations/http/index.js +31 -7
- package/build/cjs/integrations/http/index.js.map +1 -1
- package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
- package/build/cjs/integrations/tracing/express-v5/instrumentation.js +4 -2
- package/build/cjs/integrations/tracing/express-v5/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/index.js +2 -4
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/integrations/tracing/prisma.js +2 -7
- package/build/cjs/integrations/tracing/prisma.js.map +1 -1
- package/build/cjs/integrations/winston.js +2 -2
- package/build/cjs/integrations/winston.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/context.js +1 -0
- package/build/esm/integrations/context.js.map +1 -1
- package/build/esm/integrations/http/SentryHttpInstrumentation.js +131 -127
- package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
- package/build/esm/integrations/http/SentryHttpInstrumentationBeforeOtel.js +51 -45
- package/build/esm/integrations/http/SentryHttpInstrumentationBeforeOtel.js.map +1 -1
- package/build/esm/integrations/http/index.js +31 -7
- package/build/esm/integrations/http/index.js.map +1 -1
- 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/tracing/express-v5/instrumentation.js +4 -2
- package/build/esm/integrations/tracing/express-v5/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/index.js +2 -4
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/integrations/tracing/prisma.js +2 -7
- package/build/esm/integrations/tracing/prisma.js.map +1 -1
- package/build/esm/integrations/winston.js +2 -2
- package/build/esm/integrations/winston.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/integrations/context.d.ts.map +1 -1
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +9 -13
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
- package/build/types/integrations/http/SentryHttpInstrumentationBeforeOtel.d.ts.map +1 -1
- package/build/types/integrations/http/index.d.ts +8 -0
- package/build/types/integrations/http/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/express-v5/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/prisma.d.ts.map +1 -1
- package/build/types/integrations/winston.d.ts +3 -3
- package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +9 -13
- package/build/types-ts3.8/integrations/http/index.d.ts +11 -0
- package/build/types-ts3.8/integrations/winston.d.ts +3 -3
- package/package.json +4 -4
- package/build/cjs/integrations/http/vendor/getRequestInfo.js +0 -130
- package/build/cjs/integrations/http/vendor/getRequestInfo.js.map +0 -1
- package/build/esm/integrations/http/vendor/getRequestInfo.js +0 -128
- package/build/esm/integrations/http/vendor/getRequestInfo.js.map +0 -1
- package/build/types/integrations/http/vendor/getRequestInfo.d.ts +0 -21
- package/build/types/integrations/http/vendor/getRequestInfo.d.ts.map +0 -1
- package/build/types-ts3.8/integrations/http/vendor/getRequestInfo.d.ts +0 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import type
|
|
3
|
+
import type * as http from 'node:http';
|
|
4
4
|
import type { EventEmitter } from 'node:stream';
|
|
5
5
|
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
6
6
|
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
@@ -29,7 +29,7 @@ export type SentryHttpInstrumentationOptions = InstrumentationConfig & {
|
|
|
29
29
|
* @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.
|
|
30
30
|
* @param request Contains the {@type RequestOptions} object used to make the outgoing request.
|
|
31
31
|
*/
|
|
32
|
-
ignoreOutgoingRequests?: (url: string, request: RequestOptions) => boolean;
|
|
32
|
+
ignoreOutgoingRequests?: (url: string, request: http.RequestOptions) => boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
|
|
35
35
|
* This can be useful for long running requests where the body is not needed and we want to avoid capturing it.
|
|
@@ -37,7 +37,7 @@ export type SentryHttpInstrumentationOptions = InstrumentationConfig & {
|
|
|
37
37
|
* @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.
|
|
38
38
|
* @param request Contains the {@type RequestOptions} object used to make the outgoing request.
|
|
39
39
|
*/
|
|
40
|
-
ignoreIncomingRequestBody?: (url: string, request: RequestOptions) => boolean;
|
|
40
|
+
ignoreIncomingRequestBody?: (url: string, request: http.RequestOptions) => boolean;
|
|
41
41
|
/**
|
|
42
42
|
* 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.
|
|
43
43
|
* Read more about Release Health: https://docs.sentry.io/product/releases/health/
|
|
@@ -69,20 +69,16 @@ export declare class SentryHttpInstrumentation extends InstrumentationBase<Sentr
|
|
|
69
69
|
constructor(config?: SentryHttpInstrumentationOptions);
|
|
70
70
|
/** @inheritdoc */
|
|
71
71
|
init(): [InstrumentationNodeModuleDefinition, InstrumentationNodeModuleDefinition];
|
|
72
|
-
/** Get the instrumentation for the http module. */
|
|
73
|
-
private _getHttpInstrumentation;
|
|
74
|
-
/** Get the instrumentation for the https module. */
|
|
75
|
-
private _getHttpsInstrumentation;
|
|
76
72
|
/**
|
|
77
|
-
*
|
|
73
|
+
* This is triggered when an outgoing request finishes.
|
|
74
|
+
* It has access to the final request and response objects.
|
|
78
75
|
*/
|
|
79
|
-
private
|
|
76
|
+
private _onOutgoingRequestFinish;
|
|
80
77
|
/**
|
|
81
|
-
* Patch
|
|
78
|
+
* Patch a server.emit function to handle process isolation for incoming requests.
|
|
79
|
+
* This will only patch the emit function if it was not already patched.
|
|
82
80
|
*/
|
|
83
|
-
private
|
|
84
|
-
/** Path the outgoing get function for breadcrumbs. */
|
|
85
|
-
private _getPatchOutgoingGetFunction;
|
|
81
|
+
private _patchServerEmitOnce;
|
|
86
82
|
}
|
|
87
83
|
/**
|
|
88
84
|
* Starts a session and tracks it in the context of a given isolation scope.
|
|
@@ -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,KAAK,IAAI,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,KAAK,EAAmD,KAAK,EAAE,MAAM,cAAc,CAAC;AAwB3F,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,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC;IAEhF;;;;;;OAMG;IACH,yBAAyB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,cAAc,KAAK,OAAO,CAAC;IAEnF;;;;;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;IAkFzF;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAgBhC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;CAkF7B;AAgKD;;;;;;;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentryHttpInstrumentationBeforeOtel.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/SentryHttpInstrumentationBeforeOtel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAmB1G;;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;
|
|
1
|
+
{"version":3,"file":"SentryHttpInstrumentationBeforeOtel.d.ts","sourceRoot":"","sources":["../../../../src/integrations/http/SentryHttpInstrumentationBeforeOtel.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,MAAM,gCAAgC,CAAC;AAmB1G;;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;CAmBzC"}
|
|
@@ -54,6 +54,14 @@ interface HttpOptions {
|
|
|
54
54
|
* You can use it to filter on additional properties like method, headers, etc.
|
|
55
55
|
*/
|
|
56
56
|
ignoreIncomingRequests?: (urlPath: string, request: IncomingMessage) => boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Do not capture spans for incoming HTTP requests with the given status codes.
|
|
59
|
+
* By default, spans with 404 status code are ignored.
|
|
60
|
+
* Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.
|
|
61
|
+
*
|
|
62
|
+
* @default `[404]`
|
|
63
|
+
*/
|
|
64
|
+
dropSpansForIncomingRequestStatusCodes?: (number | [number, number])[];
|
|
57
65
|
/**
|
|
58
66
|
* Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
|
|
59
67
|
* This can be useful for long running requests where the body is not needed and we want to avoid capturing it.
|
|
@@ -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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AAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC;IAEhF;;;;;;OAMG;IACH,sCAAsC,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;IAEvE;;;;;;OAMG;IACH,yBAAyB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC;IAE9E;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;OAEG;IACH,eAAe,CAAC,EAAE;QAChB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,GAAG,gCAAgC,KAAK,IAAI,CAAC;QAC1F,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,gCAAgC,GAAG,cAAc,KAAK,IAAI,CAAC;QACjG,2BAA2B,CAAC,EAAE,CAC5B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,aAAa,GAAG,gCAAgC,EACzD,QAAQ,EAAE,gCAAgC,GAAG,cAAc,KACxD,IAAI,CAAC;QAEV;;;WAGG;QACH,mBAAmB,CAAC,EAAE,qBAAqB,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;KAC5E,CAAC;CACH;AAaD,eAAO,MAAM,kBAAkB;;CAe7B,CAAC;AAEH,+BAA+B;AAC/B,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,GAAE,OAAO,CAAC,iBAAiB,CAAM,GAAG,OAAO,CAIpH;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,2EAyD1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/express-v5/instrumentation.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,mBAAmB,EACnB,mCAAmC,EAGpC,MAAM,gCAAgC,CAAC;AAOxC,OAAO,KAAK,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGhF,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,YAAY,uCAAuC,CAAC;AAEjE,gDAAgD;AAChD,qBAAa,wBAAyB,SAAQ,mBAAmB,CAAC,4BAA4B,CAAC;gBACjF,MAAM,GAAE,4BAAiC;IAIrD,IAAI;IAWJ,OAAO,CAAC,MAAM;IAoBd,OAAO,CAAC,SAAS;IAQjB;;OAEG;IACH,OAAO,CAAC,cAAc;IAYtB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAY1B;;OAEG;IACH,OAAO,CAAC,eAAe;IAqBvB,oEAAoE;IACpE,OAAO,CAAC,WAAW;
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/express-v5/instrumentation.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,mBAAmB,EACnB,mCAAmC,EAGpC,MAAM,gCAAgC,CAAC;AAOxC,OAAO,KAAK,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGhF,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,YAAY,uCAAuC,CAAC;AAEjE,gDAAgD;AAChD,qBAAa,wBAAyB,SAAQ,mBAAmB,CAAC,4BAA4B,CAAC;gBACjF,MAAM,GAAE,4BAAiC;IAIrD,IAAI;IAWJ,OAAO,CAAC,MAAM;IAoBd,OAAO,CAAC,SAAS;IAQjB;;OAEG;IACH,OAAO,CAAC,cAAc;IAYtB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAY1B;;OAEG;IACH,OAAO,CAAC,eAAe;IAqBvB,oEAAoE;IACpE,OAAO,CAAC,WAAW;IAmKnB,YAAY,CAAC,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM;CAc3D"}
|
|
@@ -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;AAsBhD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CAsB9D;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,CAwBzG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/prisma.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/prisma.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AA0DtE,eAAO,MAAM,gBAAgB;;;;CAU5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,iBAAiB;IAI1B;;;;;;OAMG;;oDAmCN,CAAC"}
|
|
@@ -8,7 +8,7 @@ interface WinstonTransportOptions {
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
|
-
* const
|
|
11
|
+
* const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport, {
|
|
12
12
|
* // Only capture error and warn logs
|
|
13
13
|
* levels: ['error', 'warn'],
|
|
14
14
|
* });
|
|
@@ -32,10 +32,10 @@ interface WinstonTransportOptions {
|
|
|
32
32
|
* const winston = require('winston');
|
|
33
33
|
* const Transport = require('winston-transport');
|
|
34
34
|
*
|
|
35
|
-
* const
|
|
35
|
+
* const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport);
|
|
36
36
|
*
|
|
37
37
|
* const logger = winston.createLogger({
|
|
38
|
-
* transports: [
|
|
38
|
+
* transports: [new SentryWinstonTransport()],
|
|
39
39
|
* });
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import
|
|
2
|
+
import * as http from 'node:http';
|
|
3
3
|
import { EventEmitter } from 'node:stream';
|
|
4
4
|
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
5
5
|
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
@@ -28,7 +28,7 @@ export type SentryHttpInstrumentationOptions = InstrumentationConfig & {
|
|
|
28
28
|
* @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.
|
|
29
29
|
* @param request Contains the {@type RequestOptions} object used to make the outgoing request.
|
|
30
30
|
*/
|
|
31
|
-
ignoreOutgoingRequests?: (url: string, request: RequestOptions) => boolean;
|
|
31
|
+
ignoreOutgoingRequests?: (url: string, request: http.RequestOptions) => boolean;
|
|
32
32
|
/**
|
|
33
33
|
* Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
|
|
34
34
|
* This can be useful for long running requests where the body is not needed and we want to avoid capturing it.
|
|
@@ -36,7 +36,7 @@ export type SentryHttpInstrumentationOptions = InstrumentationConfig & {
|
|
|
36
36
|
* @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.
|
|
37
37
|
* @param request Contains the {@type RequestOptions} object used to make the outgoing request.
|
|
38
38
|
*/
|
|
39
|
-
ignoreIncomingRequestBody?: (url: string, request: RequestOptions) => boolean;
|
|
39
|
+
ignoreIncomingRequestBody?: (url: string, request: http.RequestOptions) => boolean;
|
|
40
40
|
/**
|
|
41
41
|
* 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.
|
|
42
42
|
* Read more about Release Health: https://docs.sentry.io/product/releases/health/
|
|
@@ -71,20 +71,16 @@ export declare class SentryHttpInstrumentation extends InstrumentationBase<Sentr
|
|
|
71
71
|
InstrumentationNodeModuleDefinition,
|
|
72
72
|
InstrumentationNodeModuleDefinition
|
|
73
73
|
];
|
|
74
|
-
/** Get the instrumentation for the http module. */
|
|
75
|
-
private _getHttpInstrumentation;
|
|
76
|
-
/** Get the instrumentation for the https module. */
|
|
77
|
-
private _getHttpsInstrumentation;
|
|
78
74
|
/**
|
|
79
|
-
*
|
|
75
|
+
* This is triggered when an outgoing request finishes.
|
|
76
|
+
* It has access to the final request and response objects.
|
|
80
77
|
*/
|
|
81
|
-
private
|
|
78
|
+
private _onOutgoingRequestFinish;
|
|
82
79
|
/**
|
|
83
|
-
* Patch
|
|
80
|
+
* Patch a server.emit function to handle process isolation for incoming requests.
|
|
81
|
+
* This will only patch the emit function if it was not already patched.
|
|
84
82
|
*/
|
|
85
|
-
private
|
|
86
|
-
/** Path the outgoing get function for breadcrumbs. */
|
|
87
|
-
private _getPatchOutgoingGetFunction;
|
|
83
|
+
private _patchServerEmitOnce;
|
|
88
84
|
}
|
|
89
85
|
/**
|
|
90
86
|
* Starts a session and tracks it in the context of a given isolation scope.
|
|
@@ -54,6 +54,17 @@ interface HttpOptions {
|
|
|
54
54
|
* You can use it to filter on additional properties like method, headers, etc.
|
|
55
55
|
*/
|
|
56
56
|
ignoreIncomingRequests?: (urlPath: string, request: IncomingMessage) => boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Do not capture spans for incoming HTTP requests with the given status codes.
|
|
59
|
+
* By default, spans with 404 status code are ignored.
|
|
60
|
+
* Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.
|
|
61
|
+
*
|
|
62
|
+
* @default `[404]`
|
|
63
|
+
*/
|
|
64
|
+
dropSpansForIncomingRequestStatusCodes?: (number | [
|
|
65
|
+
number,
|
|
66
|
+
number
|
|
67
|
+
])[];
|
|
57
68
|
/**
|
|
58
69
|
* Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
|
|
59
70
|
* This can be useful for long running requests where the body is not needed and we want to avoid capturing it.
|
|
@@ -8,7 +8,7 @@ interface WinstonTransportOptions {
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```ts
|
|
11
|
-
* const
|
|
11
|
+
* const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport, {
|
|
12
12
|
* // Only capture error and warn logs
|
|
13
13
|
* levels: ['error', 'warn'],
|
|
14
14
|
* });
|
|
@@ -32,10 +32,10 @@ interface WinstonTransportOptions {
|
|
|
32
32
|
* const winston = require('winston');
|
|
33
33
|
* const Transport = require('winston-transport');
|
|
34
34
|
*
|
|
35
|
-
* const
|
|
35
|
+
* const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport);
|
|
36
36
|
*
|
|
37
37
|
* const logger = winston.createLogger({
|
|
38
|
-
* transports: [
|
|
38
|
+
* transports: [new SentryWinstonTransport()],
|
|
39
39
|
* });
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/node",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.16.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",
|
|
@@ -95,9 +95,9 @@
|
|
|
95
95
|
"@opentelemetry/resources": "^1.30.1",
|
|
96
96
|
"@opentelemetry/sdk-trace-base": "^1.30.1",
|
|
97
97
|
"@opentelemetry/semantic-conventions": "^1.30.0",
|
|
98
|
-
"@prisma/instrumentation": "6.
|
|
99
|
-
"@sentry/core": "9.
|
|
100
|
-
"@sentry/opentelemetry": "9.
|
|
98
|
+
"@prisma/instrumentation": "6.7.0",
|
|
99
|
+
"@sentry/core": "9.16.0",
|
|
100
|
+
"@sentry/opentelemetry": "9.16.0",
|
|
101
101
|
"import-in-the-middle": "^1.13.0"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const url = require('url');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Makes sure options is an url object
|
|
7
|
-
* return an object with default value and parsed options
|
|
8
|
-
* @param logger component logger
|
|
9
|
-
* @param options original options for the request
|
|
10
|
-
* @param [extraOptions] additional options for the request
|
|
11
|
-
*/
|
|
12
|
-
const getRequestInfo = (
|
|
13
|
-
logger,
|
|
14
|
-
options,
|
|
15
|
-
extraOptions,
|
|
16
|
-
|
|
17
|
-
) => {
|
|
18
|
-
let pathname;
|
|
19
|
-
let origin;
|
|
20
|
-
let optionsParsed;
|
|
21
|
-
let invalidUrl = false;
|
|
22
|
-
if (typeof options === 'string') {
|
|
23
|
-
try {
|
|
24
|
-
const convertedOptions = stringUrlToHttpOptions(options);
|
|
25
|
-
optionsParsed = convertedOptions;
|
|
26
|
-
pathname = convertedOptions.pathname || '/';
|
|
27
|
-
} catch (e) {
|
|
28
|
-
invalidUrl = true;
|
|
29
|
-
logger.verbose(
|
|
30
|
-
'Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:',
|
|
31
|
-
e,
|
|
32
|
-
);
|
|
33
|
-
// for backward compatibility with how url.parse() behaved.
|
|
34
|
-
optionsParsed = {
|
|
35
|
-
path: options,
|
|
36
|
-
};
|
|
37
|
-
pathname = optionsParsed.path || '/';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
origin = `${optionsParsed.protocol || 'http:'}//${optionsParsed.host}`;
|
|
41
|
-
if (extraOptions !== undefined) {
|
|
42
|
-
Object.assign(optionsParsed, extraOptions);
|
|
43
|
-
}
|
|
44
|
-
} else if (options instanceof url.URL) {
|
|
45
|
-
optionsParsed = {
|
|
46
|
-
protocol: options.protocol,
|
|
47
|
-
hostname:
|
|
48
|
-
typeof options.hostname === 'string' && options.hostname.startsWith('[')
|
|
49
|
-
? options.hostname.slice(1, -1)
|
|
50
|
-
: options.hostname,
|
|
51
|
-
path: `${options.pathname || ''}${options.search || ''}`,
|
|
52
|
-
};
|
|
53
|
-
if (options.port !== '') {
|
|
54
|
-
optionsParsed.port = Number(options.port);
|
|
55
|
-
}
|
|
56
|
-
if (options.username || options.password) {
|
|
57
|
-
optionsParsed.auth = `${options.username}:${options.password}`;
|
|
58
|
-
}
|
|
59
|
-
pathname = options.pathname;
|
|
60
|
-
origin = options.origin;
|
|
61
|
-
if (extraOptions !== undefined) {
|
|
62
|
-
Object.assign(optionsParsed, extraOptions);
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
optionsParsed = Object.assign({ protocol: options.host ? 'http:' : undefined }, options);
|
|
66
|
-
|
|
67
|
-
const hostname =
|
|
68
|
-
optionsParsed.host ||
|
|
69
|
-
(optionsParsed.port != null ? `${optionsParsed.hostname}${optionsParsed.port}` : optionsParsed.hostname);
|
|
70
|
-
origin = `${optionsParsed.protocol || 'http:'}//${hostname}`;
|
|
71
|
-
|
|
72
|
-
pathname = (options ).pathname;
|
|
73
|
-
if (!pathname && optionsParsed.path) {
|
|
74
|
-
try {
|
|
75
|
-
const parsedUrl = new URL(optionsParsed.path, origin);
|
|
76
|
-
pathname = parsedUrl.pathname || '/';
|
|
77
|
-
} catch (e) {
|
|
78
|
-
pathname = '/';
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// some packages return method in lowercase..
|
|
84
|
-
// ensure upperCase for consistency
|
|
85
|
-
const method = optionsParsed.method ? optionsParsed.method.toUpperCase() : 'GET';
|
|
86
|
-
|
|
87
|
-
return { origin, pathname, method, optionsParsed, invalidUrl };
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Mimics Node.js conversion of URL strings to RequestOptions expected by
|
|
92
|
-
* `http.request` and `https.request` APIs.
|
|
93
|
-
*
|
|
94
|
-
* See https://github.com/nodejs/node/blob/2505e217bba05fc581b572c685c5cf280a16c5a3/lib/internal/url.js#L1415-L1437
|
|
95
|
-
*
|
|
96
|
-
* @param stringUrl
|
|
97
|
-
* @throws TypeError if the URL is not valid.
|
|
98
|
-
*/
|
|
99
|
-
function stringUrlToHttpOptions(stringUrl) {
|
|
100
|
-
// This is heavily inspired by Node.js handling of the same situation, trying
|
|
101
|
-
// to follow it as closely as possible while keeping in mind that we only
|
|
102
|
-
// deal with string URLs, not URL objects.
|
|
103
|
-
const { hostname, pathname, port, username, password, search, protocol, hash, href, origin, host } = new URL(
|
|
104
|
-
stringUrl,
|
|
105
|
-
);
|
|
106
|
-
|
|
107
|
-
const options
|
|
108
|
-
|
|
109
|
-
= {
|
|
110
|
-
protocol: protocol,
|
|
111
|
-
hostname: hostname && hostname[0] === '[' ? hostname.slice(1, -1) : hostname,
|
|
112
|
-
hash: hash,
|
|
113
|
-
search: search,
|
|
114
|
-
pathname: pathname,
|
|
115
|
-
path: `${pathname || ''}${search || ''}`,
|
|
116
|
-
href: href,
|
|
117
|
-
origin: origin,
|
|
118
|
-
host: host,
|
|
119
|
-
};
|
|
120
|
-
if (port !== '') {
|
|
121
|
-
options.port = Number(port);
|
|
122
|
-
}
|
|
123
|
-
if (username || password) {
|
|
124
|
-
options.auth = `${decodeURIComponent(username)}:${decodeURIComponent(password)}`;
|
|
125
|
-
}
|
|
126
|
-
return options;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
exports.getRequestInfo = getRequestInfo;
|
|
130
|
-
//# sourceMappingURL=getRequestInfo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRequestInfo.js","sources":["../../../../../src/integrations/http/vendor/getRequestInfo.ts"],"sourcesContent":["/* eslint-disable complexity */\n\n/**\n * Vendored in from https://github.com/open-telemetry/opentelemetry-js/commit/87bd98edd24c98a5fbb9a56fed4b673b7f17a724\n */\n\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { RequestOptions } from 'node:http';\nimport type { DiagLogger } from '@opentelemetry/api';\nimport * as url from 'url';\n\n/**\n * Makes sure options is an url object\n * return an object with default value and parsed options\n * @param logger component logger\n * @param options original options for the request\n * @param [extraOptions] additional options for the request\n */\nexport const getRequestInfo = (\n logger: DiagLogger,\n options: url.URL | RequestOptions | string,\n extraOptions?: RequestOptions,\n): {\n origin: string;\n pathname: string;\n method: string;\n invalidUrl: boolean;\n optionsParsed: RequestOptions;\n} => {\n let pathname: string;\n let origin: string;\n let optionsParsed: RequestOptions;\n let invalidUrl = false;\n if (typeof options === 'string') {\n try {\n const convertedOptions = stringUrlToHttpOptions(options);\n optionsParsed = convertedOptions;\n pathname = convertedOptions.pathname || '/';\n } catch (e) {\n invalidUrl = true;\n logger.verbose(\n 'Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:',\n e,\n );\n // for backward compatibility with how url.parse() behaved.\n optionsParsed = {\n path: options,\n };\n pathname = optionsParsed.path || '/';\n }\n\n origin = `${optionsParsed.protocol || 'http:'}//${optionsParsed.host}`;\n if (extraOptions !== undefined) {\n Object.assign(optionsParsed, extraOptions);\n }\n } else if (options instanceof url.URL) {\n optionsParsed = {\n protocol: options.protocol,\n hostname:\n typeof options.hostname === 'string' && options.hostname.startsWith('[')\n ? options.hostname.slice(1, -1)\n : options.hostname,\n path: `${options.pathname || ''}${options.search || ''}`,\n };\n if (options.port !== '') {\n optionsParsed.port = Number(options.port);\n }\n if (options.username || options.password) {\n optionsParsed.auth = `${options.username}:${options.password}`;\n }\n pathname = options.pathname;\n origin = options.origin;\n if (extraOptions !== undefined) {\n Object.assign(optionsParsed, extraOptions);\n }\n } else {\n optionsParsed = Object.assign({ protocol: options.host ? 'http:' : undefined }, options);\n\n const hostname =\n optionsParsed.host ||\n (optionsParsed.port != null ? `${optionsParsed.hostname}${optionsParsed.port}` : optionsParsed.hostname);\n origin = `${optionsParsed.protocol || 'http:'}//${hostname}`;\n\n pathname = (options as url.URL).pathname;\n if (!pathname && optionsParsed.path) {\n try {\n const parsedUrl = new URL(optionsParsed.path, origin);\n pathname = parsedUrl.pathname || '/';\n } catch (e) {\n pathname = '/';\n }\n }\n }\n\n // some packages return method in lowercase..\n // ensure upperCase for consistency\n const method = optionsParsed.method ? optionsParsed.method.toUpperCase() : 'GET';\n\n return { origin, pathname, method, optionsParsed, invalidUrl };\n};\n\n/**\n * Mimics Node.js conversion of URL strings to RequestOptions expected by\n * `http.request` and `https.request` APIs.\n *\n * See https://github.com/nodejs/node/blob/2505e217bba05fc581b572c685c5cf280a16c5a3/lib/internal/url.js#L1415-L1437\n *\n * @param stringUrl\n * @throws TypeError if the URL is not valid.\n */\nfunction stringUrlToHttpOptions(stringUrl: string): RequestOptions & { pathname: string } {\n // This is heavily inspired by Node.js handling of the same situation, trying\n // to follow it as closely as possible while keeping in mind that we only\n // deal with string URLs, not URL objects.\n const { hostname, pathname, port, username, password, search, protocol, hash, href, origin, host } = new URL(\n stringUrl,\n );\n\n const options: RequestOptions & {\n pathname: string;\n hash: string;\n search: string;\n href: string;\n origin: string;\n } = {\n protocol: protocol,\n hostname: hostname && hostname[0] === '[' ? hostname.slice(1, -1) : hostname,\n hash: hash,\n search: search,\n pathname: pathname,\n path: `${pathname || ''}${search || ''}`,\n href: href,\n origin: origin,\n host: host,\n };\n if (port !== '') {\n options.port = Number(port);\n }\n if (username || password) {\n options.auth = `${decodeURIComponent(username)}:${decodeURIComponent(password)}`;\n }\n return options;\n}\n"],"names":[],"mappings":";;;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iBAAiB;AAC9B,EAAE,MAAM;AACR,EAAE,OAAO;AACT,EAAE,YAAY;;AAOd,KAAK;AACL,EAAE,IAAI,QAAQ;AACd,EAAE,IAAI,MAAM;AACZ,EAAE,IAAI,aAAa;AACnB,EAAE,IAAI,UAAW,GAAE,KAAK;AACxB,EAAE,IAAI,OAAO,OAAQ,KAAI,QAAQ,EAAE;AACnC,IAAI,IAAI;AACR,MAAM,MAAM,gBAAiB,GAAE,sBAAsB,CAAC,OAAO,CAAC;AAC9D,MAAM,aAAA,GAAgB,gBAAgB;AACtC,MAAM,WAAW,gBAAgB,CAAC,QAAA,IAAY,GAAG;AACjD,KAAM,CAAA,OAAO,CAAC,EAAE;AAChB,MAAM,UAAA,GAAa,IAAI;AACvB,MAAM,MAAM,CAAC,OAAO;AACpB,QAAQ,iGAAiG;AACzG,QAAQ,CAAC;AACT,OAAO;AACP;AACA,MAAM,gBAAgB;AACtB,QAAQ,IAAI,EAAE,OAAO;AACrB,OAAO;AACP,MAAM,WAAW,aAAa,CAAC,IAAA,IAAQ,GAAG;AAC1C;;AAEA,IAAI,MAAA,GAAS,CAAC,EAAA,aAAA,CAAA,QAAA,IAAA,OAAA,CAAA,EAAA,EAAA,aAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,YAAA,KAAA,SAAA,EAAA;AACA,MAAA,MAAA,CAAA,MAAA,CAAA,aAAA,EAAA,YAAA,CAAA;AACA;AACA,GAAA,MAAA,IAAA,OAAA,YAAA,GAAA,CAAA,GAAA,EAAA;AACA,IAAA,aAAA,GAAA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IAAA,EAAA,CAAA,EAAA,QAAA,IAAA,EAAA,CAAA,EAAA,MAAA,IAAA,EAAA,CAAA,CAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,MAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,GAAA;AACA,EAAA,IAAA,IAAA,KAAA,EAAA,EAAA;AACA,IAAA,OAAA,CAAA,IAAA,GAAA,MAAA,CAAA,IAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,IAAA,QAAA,EAAA;AACA,IAAA,OAAA,CAAA,IAAA,GAAA,CAAA,EAAA,kBAAA,CAAA,QAAA,CAAA,CAAA,CAAA,EAAA,kBAAA,CAAA,QAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,OAAA;AACA;;;;"}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import * as url from 'url';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Makes sure options is an url object
|
|
5
|
-
* return an object with default value and parsed options
|
|
6
|
-
* @param logger component logger
|
|
7
|
-
* @param options original options for the request
|
|
8
|
-
* @param [extraOptions] additional options for the request
|
|
9
|
-
*/
|
|
10
|
-
const getRequestInfo = (
|
|
11
|
-
logger,
|
|
12
|
-
options,
|
|
13
|
-
extraOptions,
|
|
14
|
-
|
|
15
|
-
) => {
|
|
16
|
-
let pathname;
|
|
17
|
-
let origin;
|
|
18
|
-
let optionsParsed;
|
|
19
|
-
let invalidUrl = false;
|
|
20
|
-
if (typeof options === 'string') {
|
|
21
|
-
try {
|
|
22
|
-
const convertedOptions = stringUrlToHttpOptions(options);
|
|
23
|
-
optionsParsed = convertedOptions;
|
|
24
|
-
pathname = convertedOptions.pathname || '/';
|
|
25
|
-
} catch (e) {
|
|
26
|
-
invalidUrl = true;
|
|
27
|
-
logger.verbose(
|
|
28
|
-
'Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:',
|
|
29
|
-
e,
|
|
30
|
-
);
|
|
31
|
-
// for backward compatibility with how url.parse() behaved.
|
|
32
|
-
optionsParsed = {
|
|
33
|
-
path: options,
|
|
34
|
-
};
|
|
35
|
-
pathname = optionsParsed.path || '/';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
origin = `${optionsParsed.protocol || 'http:'}//${optionsParsed.host}`;
|
|
39
|
-
if (extraOptions !== undefined) {
|
|
40
|
-
Object.assign(optionsParsed, extraOptions);
|
|
41
|
-
}
|
|
42
|
-
} else if (options instanceof url.URL) {
|
|
43
|
-
optionsParsed = {
|
|
44
|
-
protocol: options.protocol,
|
|
45
|
-
hostname:
|
|
46
|
-
typeof options.hostname === 'string' && options.hostname.startsWith('[')
|
|
47
|
-
? options.hostname.slice(1, -1)
|
|
48
|
-
: options.hostname,
|
|
49
|
-
path: `${options.pathname || ''}${options.search || ''}`,
|
|
50
|
-
};
|
|
51
|
-
if (options.port !== '') {
|
|
52
|
-
optionsParsed.port = Number(options.port);
|
|
53
|
-
}
|
|
54
|
-
if (options.username || options.password) {
|
|
55
|
-
optionsParsed.auth = `${options.username}:${options.password}`;
|
|
56
|
-
}
|
|
57
|
-
pathname = options.pathname;
|
|
58
|
-
origin = options.origin;
|
|
59
|
-
if (extraOptions !== undefined) {
|
|
60
|
-
Object.assign(optionsParsed, extraOptions);
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
optionsParsed = Object.assign({ protocol: options.host ? 'http:' : undefined }, options);
|
|
64
|
-
|
|
65
|
-
const hostname =
|
|
66
|
-
optionsParsed.host ||
|
|
67
|
-
(optionsParsed.port != null ? `${optionsParsed.hostname}${optionsParsed.port}` : optionsParsed.hostname);
|
|
68
|
-
origin = `${optionsParsed.protocol || 'http:'}//${hostname}`;
|
|
69
|
-
|
|
70
|
-
pathname = (options ).pathname;
|
|
71
|
-
if (!pathname && optionsParsed.path) {
|
|
72
|
-
try {
|
|
73
|
-
const parsedUrl = new URL(optionsParsed.path, origin);
|
|
74
|
-
pathname = parsedUrl.pathname || '/';
|
|
75
|
-
} catch (e) {
|
|
76
|
-
pathname = '/';
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// some packages return method in lowercase..
|
|
82
|
-
// ensure upperCase for consistency
|
|
83
|
-
const method = optionsParsed.method ? optionsParsed.method.toUpperCase() : 'GET';
|
|
84
|
-
|
|
85
|
-
return { origin, pathname, method, optionsParsed, invalidUrl };
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Mimics Node.js conversion of URL strings to RequestOptions expected by
|
|
90
|
-
* `http.request` and `https.request` APIs.
|
|
91
|
-
*
|
|
92
|
-
* See https://github.com/nodejs/node/blob/2505e217bba05fc581b572c685c5cf280a16c5a3/lib/internal/url.js#L1415-L1437
|
|
93
|
-
*
|
|
94
|
-
* @param stringUrl
|
|
95
|
-
* @throws TypeError if the URL is not valid.
|
|
96
|
-
*/
|
|
97
|
-
function stringUrlToHttpOptions(stringUrl) {
|
|
98
|
-
// This is heavily inspired by Node.js handling of the same situation, trying
|
|
99
|
-
// to follow it as closely as possible while keeping in mind that we only
|
|
100
|
-
// deal with string URLs, not URL objects.
|
|
101
|
-
const { hostname, pathname, port, username, password, search, protocol, hash, href, origin, host } = new URL(
|
|
102
|
-
stringUrl,
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
const options
|
|
106
|
-
|
|
107
|
-
= {
|
|
108
|
-
protocol: protocol,
|
|
109
|
-
hostname: hostname && hostname[0] === '[' ? hostname.slice(1, -1) : hostname,
|
|
110
|
-
hash: hash,
|
|
111
|
-
search: search,
|
|
112
|
-
pathname: pathname,
|
|
113
|
-
path: `${pathname || ''}${search || ''}`,
|
|
114
|
-
href: href,
|
|
115
|
-
origin: origin,
|
|
116
|
-
host: host,
|
|
117
|
-
};
|
|
118
|
-
if (port !== '') {
|
|
119
|
-
options.port = Number(port);
|
|
120
|
-
}
|
|
121
|
-
if (username || password) {
|
|
122
|
-
options.auth = `${decodeURIComponent(username)}:${decodeURIComponent(password)}`;
|
|
123
|
-
}
|
|
124
|
-
return options;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export { getRequestInfo };
|
|
128
|
-
//# sourceMappingURL=getRequestInfo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRequestInfo.js","sources":["../../../../../src/integrations/http/vendor/getRequestInfo.ts"],"sourcesContent":["/* eslint-disable complexity */\n\n/**\n * Vendored in from https://github.com/open-telemetry/opentelemetry-js/commit/87bd98edd24c98a5fbb9a56fed4b673b7f17a724\n */\n\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type { RequestOptions } from 'node:http';\nimport type { DiagLogger } from '@opentelemetry/api';\nimport * as url from 'url';\n\n/**\n * Makes sure options is an url object\n * return an object with default value and parsed options\n * @param logger component logger\n * @param options original options for the request\n * @param [extraOptions] additional options for the request\n */\nexport const getRequestInfo = (\n logger: DiagLogger,\n options: url.URL | RequestOptions | string,\n extraOptions?: RequestOptions,\n): {\n origin: string;\n pathname: string;\n method: string;\n invalidUrl: boolean;\n optionsParsed: RequestOptions;\n} => {\n let pathname: string;\n let origin: string;\n let optionsParsed: RequestOptions;\n let invalidUrl = false;\n if (typeof options === 'string') {\n try {\n const convertedOptions = stringUrlToHttpOptions(options);\n optionsParsed = convertedOptions;\n pathname = convertedOptions.pathname || '/';\n } catch (e) {\n invalidUrl = true;\n logger.verbose(\n 'Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:',\n e,\n );\n // for backward compatibility with how url.parse() behaved.\n optionsParsed = {\n path: options,\n };\n pathname = optionsParsed.path || '/';\n }\n\n origin = `${optionsParsed.protocol || 'http:'}//${optionsParsed.host}`;\n if (extraOptions !== undefined) {\n Object.assign(optionsParsed, extraOptions);\n }\n } else if (options instanceof url.URL) {\n optionsParsed = {\n protocol: options.protocol,\n hostname:\n typeof options.hostname === 'string' && options.hostname.startsWith('[')\n ? options.hostname.slice(1, -1)\n : options.hostname,\n path: `${options.pathname || ''}${options.search || ''}`,\n };\n if (options.port !== '') {\n optionsParsed.port = Number(options.port);\n }\n if (options.username || options.password) {\n optionsParsed.auth = `${options.username}:${options.password}`;\n }\n pathname = options.pathname;\n origin = options.origin;\n if (extraOptions !== undefined) {\n Object.assign(optionsParsed, extraOptions);\n }\n } else {\n optionsParsed = Object.assign({ protocol: options.host ? 'http:' : undefined }, options);\n\n const hostname =\n optionsParsed.host ||\n (optionsParsed.port != null ? `${optionsParsed.hostname}${optionsParsed.port}` : optionsParsed.hostname);\n origin = `${optionsParsed.protocol || 'http:'}//${hostname}`;\n\n pathname = (options as url.URL).pathname;\n if (!pathname && optionsParsed.path) {\n try {\n const parsedUrl = new URL(optionsParsed.path, origin);\n pathname = parsedUrl.pathname || '/';\n } catch (e) {\n pathname = '/';\n }\n }\n }\n\n // some packages return method in lowercase..\n // ensure upperCase for consistency\n const method = optionsParsed.method ? optionsParsed.method.toUpperCase() : 'GET';\n\n return { origin, pathname, method, optionsParsed, invalidUrl };\n};\n\n/**\n * Mimics Node.js conversion of URL strings to RequestOptions expected by\n * `http.request` and `https.request` APIs.\n *\n * See https://github.com/nodejs/node/blob/2505e217bba05fc581b572c685c5cf280a16c5a3/lib/internal/url.js#L1415-L1437\n *\n * @param stringUrl\n * @throws TypeError if the URL is not valid.\n */\nfunction stringUrlToHttpOptions(stringUrl: string): RequestOptions & { pathname: string } {\n // This is heavily inspired by Node.js handling of the same situation, trying\n // to follow it as closely as possible while keeping in mind that we only\n // deal with string URLs, not URL objects.\n const { hostname, pathname, port, username, password, search, protocol, hash, href, origin, host } = new URL(\n stringUrl,\n );\n\n const options: RequestOptions & {\n pathname: string;\n hash: string;\n search: string;\n href: string;\n origin: string;\n } = {\n protocol: protocol,\n hostname: hostname && hostname[0] === '[' ? hostname.slice(1, -1) : hostname,\n hash: hash,\n search: search,\n pathname: pathname,\n path: `${pathname || ''}${search || ''}`,\n href: href,\n origin: origin,\n host: host,\n };\n if (port !== '') {\n options.port = Number(port);\n }\n if (username || password) {\n options.auth = `${decodeURIComponent(username)}:${decodeURIComponent(password)}`;\n }\n return options;\n}\n"],"names":[],"mappings":";;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iBAAiB;AAC9B,EAAE,MAAM;AACR,EAAE,OAAO;AACT,EAAE,YAAY;;AAOd,KAAK;AACL,EAAE,IAAI,QAAQ;AACd,EAAE,IAAI,MAAM;AACZ,EAAE,IAAI,aAAa;AACnB,EAAE,IAAI,UAAW,GAAE,KAAK;AACxB,EAAE,IAAI,OAAO,OAAQ,KAAI,QAAQ,EAAE;AACnC,IAAI,IAAI;AACR,MAAM,MAAM,gBAAiB,GAAE,sBAAsB,CAAC,OAAO,CAAC;AAC9D,MAAM,aAAA,GAAgB,gBAAgB;AACtC,MAAM,WAAW,gBAAgB,CAAC,QAAA,IAAY,GAAG;AACjD,KAAM,CAAA,OAAO,CAAC,EAAE;AAChB,MAAM,UAAA,GAAa,IAAI;AACvB,MAAM,MAAM,CAAC,OAAO;AACpB,QAAQ,iGAAiG;AACzG,QAAQ,CAAC;AACT,OAAO;AACP;AACA,MAAM,gBAAgB;AACtB,QAAQ,IAAI,EAAE,OAAO;AACrB,OAAO;AACP,MAAM,WAAW,aAAa,CAAC,IAAA,IAAQ,GAAG;AAC1C;;AAEA,IAAI,MAAA,GAAS,CAAC,EAAA,aAAA,CAAA,QAAA,IAAA,OAAA,CAAA,EAAA,EAAA,aAAA,CAAA,IAAA,CAAA,CAAA;AACA,IAAA,IAAA,YAAA,KAAA,SAAA,EAAA;AACA,MAAA,MAAA,CAAA,MAAA,CAAA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,GAAA,QAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,MAAA;AACA,IAAA,QAAA,EAAA,QAAA;AACA,IAAA,IAAA,EAAA,CAAA,EAAA,QAAA,IAAA,EAAA,CAAA,EAAA,MAAA,IAAA,EAAA,CAAA,CAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,IAAA,MAAA,EAAA,MAAA;AACA,IAAA,IAAA,EAAA,IAAA;AACA,GAAA;AACA,EAAA,IAAA,IAAA,KAAA,EAAA,EAAA;AACA,IAAA,OAAA,CAAA,IAAA,GAAA,MAAA,CAAA,IAAA,CAAA;AACA;AACA,EAAA,IAAA,QAAA,IAAA,QAAA,EAAA;AACA,IAAA,OAAA,CAAA,IAAA,GAAA,CAAA,EAAA,kBAAA,CAAA,QAAA,CAAA,CAAA,CAAA,EAAA,kBAAA,CAAA,QAAA,CAAA,CAAA,CAAA;AACA;AACA,EAAA,OAAA,OAAA;AACA;;;;"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vendored in from https://github.com/open-telemetry/opentelemetry-js/commit/87bd98edd24c98a5fbb9a56fed4b673b7f17a724
|
|
3
|
-
*/
|
|
4
|
-
import type { RequestOptions } from 'node:http';
|
|
5
|
-
import type { DiagLogger } from '@opentelemetry/api';
|
|
6
|
-
import * as url from 'url';
|
|
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 +0,0 @@
|
|
|
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,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B;;;;;;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,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vendored in from https://github.com/open-telemetry/opentelemetry-js/commit/87bd98edd24c98a5fbb9a56fed4b673b7f17a724
|
|
3
|
-
*/
|
|
4
|
-
import { RequestOptions } from 'node:http';
|
|
5
|
-
import { DiagLogger } from '@opentelemetry/api';
|
|
6
|
-
import * as url from 'url';
|
|
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
|