@sentry/node 8.34.0 → 8.35.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +21 -21
- package/build/cjs/integrations/anr/index.js +1 -1
- package/build/cjs/integrations/anr/index.js.map +1 -1
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js +264 -0
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -0
- package/build/cjs/integrations/http/index.js +167 -0
- package/build/cjs/integrations/http/index.js.map +1 -0
- package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
- package/build/cjs/integrations/local-variables/local-variables-async.js.map +1 -1
- package/build/cjs/integrations/tracing/index.js +2 -2
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/sdk/index.js +8 -8
- package/build/cjs/sdk/index.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/integrations/anr/index.js +1 -1
- 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 +262 -0
- package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -0
- package/build/esm/integrations/http/index.js +160 -0
- package/build/esm/integrations/http/index.js.map +1 -0
- package/build/esm/integrations/local-variables/local-variables-async.js +1 -1
- package/build/esm/integrations/local-variables/local-variables-async.js.map +1 -1
- package/build/esm/integrations/local-variables/worker-script.js +2 -2
- package/build/esm/integrations/tracing/index.js +2 -2
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/sdk/index.js +1 -1
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +39 -0
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -0
- package/build/types/integrations/{http.d.ts → http/index.d.ts} +21 -10
- package/build/types/integrations/http/index.d.ts.map +1 -0
- package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +42 -0
- package/build/types-ts3.8/integrations/{http.d.ts → http/index.d.ts} +21 -10
- package/package.json +6 -6
- package/build/cjs/integrations/http.js +0 -248
- package/build/cjs/integrations/http.js.map +0 -1
- package/build/cjs/sdk/scope.js +0 -18
- package/build/cjs/sdk/scope.js.map +0 -1
- package/build/esm/integrations/http.js +0 -242
- package/build/esm/integrations/http.js.map +0 -1
- package/build/esm/sdk/scope.js +0 -16
- package/build/esm/sdk/scope.js.map +0 -1
- package/build/types/integrations/http.d.ts.map +0 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
|
|
3
|
+
const core = require('@opentelemetry/core');
|
|
4
|
+
const instrumentation = require('@opentelemetry/instrumentation');
|
|
5
|
+
const core$1 = require('@sentry/core');
|
|
6
|
+
const utils = require('@sentry/utils');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This custom HTTP instrumentation is used to isolate incoming requests and annotate them with additional information.
|
|
10
|
+
* It does not emit any spans.
|
|
11
|
+
*
|
|
12
|
+
* The reason this is isolated from the OpenTelemetry instrumentation is that users may overwrite this,
|
|
13
|
+
* which would lead to Sentry not working as expected.
|
|
14
|
+
*
|
|
15
|
+
* Important note: Contrary to other OTEL instrumentation, this one cannot be unwrapped.
|
|
16
|
+
* It only does minimal things though and does not emit any spans.
|
|
17
|
+
*
|
|
18
|
+
* This is heavily inspired & adapted from:
|
|
19
|
+
* https://github.com/open-telemetry/opentelemetry-js/blob/f8ab5592ddea5cba0a3b33bf8d74f27872c0367f/experimental/packages/opentelemetry-instrumentation-http/src/http.ts
|
|
20
|
+
*/
|
|
21
|
+
class SentryHttpInstrumentation extends instrumentation.InstrumentationBase {
|
|
22
|
+
constructor(config = {}) {
|
|
23
|
+
super('@sentry/instrumentation-http', core.VERSION, config);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** @inheritdoc */
|
|
27
|
+
init() {
|
|
28
|
+
return [this._getHttpsInstrumentation(), this._getHttpInstrumentation()];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Get the instrumentation for the http module. */
|
|
32
|
+
_getHttpInstrumentation() {
|
|
33
|
+
return new instrumentation.InstrumentationNodeModuleDefinition(
|
|
34
|
+
'http',
|
|
35
|
+
['*'],
|
|
36
|
+
(moduleExports) => {
|
|
37
|
+
// Patch incoming requests for request isolation
|
|
38
|
+
stealthWrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction());
|
|
39
|
+
|
|
40
|
+
// Patch outgoing requests for breadcrumbs
|
|
41
|
+
const patchedRequest = stealthWrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction());
|
|
42
|
+
stealthWrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest));
|
|
43
|
+
|
|
44
|
+
return moduleExports;
|
|
45
|
+
},
|
|
46
|
+
() => {
|
|
47
|
+
// no unwrap here
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Get the instrumentation for the https module. */
|
|
53
|
+
_getHttpsInstrumentation() {
|
|
54
|
+
return new instrumentation.InstrumentationNodeModuleDefinition(
|
|
55
|
+
'https',
|
|
56
|
+
['*'],
|
|
57
|
+
(moduleExports) => {
|
|
58
|
+
// Patch incoming requests for request isolation
|
|
59
|
+
stealthWrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction());
|
|
60
|
+
|
|
61
|
+
// Patch outgoing requests for breadcrumbs
|
|
62
|
+
const patchedRequest = stealthWrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction());
|
|
63
|
+
stealthWrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest));
|
|
64
|
+
|
|
65
|
+
return moduleExports;
|
|
66
|
+
},
|
|
67
|
+
() => {
|
|
68
|
+
// no unwrap here
|
|
69
|
+
},
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Patch the incoming request function for request isolation.
|
|
75
|
+
*/
|
|
76
|
+
_getPatchIncomingRequestFunction()
|
|
77
|
+
|
|
78
|
+
{
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
80
|
+
const instrumentation = this;
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
original,
|
|
84
|
+
) => {
|
|
85
|
+
return function incomingRequest( event, ...args) {
|
|
86
|
+
// Only traces request events
|
|
87
|
+
if (event !== 'request') {
|
|
88
|
+
return original.apply(this, [event, ...args]);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
instrumentation._diag.debug('http instrumentation for incoming request');
|
|
92
|
+
|
|
93
|
+
const request = args[0] ;
|
|
94
|
+
|
|
95
|
+
const isolationScope = core$1.getIsolationScope().clone();
|
|
96
|
+
|
|
97
|
+
// Update the isolation scope, isolate this request
|
|
98
|
+
isolationScope.setSDKProcessingMetadata({ request });
|
|
99
|
+
|
|
100
|
+
const client = core$1.getClient();
|
|
101
|
+
if (client && client.getOptions().autoSessionTracking) {
|
|
102
|
+
isolationScope.setRequestSession({ status: 'ok' });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// attempt to update the scope's `transactionName` based on the request URL
|
|
106
|
+
// Ideally, framework instrumentations coming after the HttpInstrumentation
|
|
107
|
+
// update the transactionName once we get a parameterized route.
|
|
108
|
+
const httpMethod = (request.method || 'GET').toUpperCase();
|
|
109
|
+
const httpTarget = utils.stripUrlQueryAndFragment(request.url || '/');
|
|
110
|
+
|
|
111
|
+
const bestEffortTransactionName = `${httpMethod} ${httpTarget}`;
|
|
112
|
+
|
|
113
|
+
isolationScope.setTransactionName(bestEffortTransactionName);
|
|
114
|
+
|
|
115
|
+
return core$1.withIsolationScope(isolationScope, () => {
|
|
116
|
+
return original.apply(this, [event, ...args]);
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Patch the outgoing request function for breadcrumbs.
|
|
124
|
+
*/
|
|
125
|
+
_getPatchOutgoingRequestFunction()
|
|
126
|
+
|
|
127
|
+
{
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
129
|
+
const instrumentation = this;
|
|
130
|
+
|
|
131
|
+
return (original) => {
|
|
132
|
+
return function outgoingRequest( ...args) {
|
|
133
|
+
instrumentation._diag.debug('http instrumentation for outgoing requests');
|
|
134
|
+
|
|
135
|
+
const request = original.apply(this, args) ;
|
|
136
|
+
|
|
137
|
+
request.prependListener('response', (response) => {
|
|
138
|
+
const breadcrumbs = instrumentation.getConfig().breadcrumbs;
|
|
139
|
+
const _breadcrumbs = typeof breadcrumbs === 'undefined' ? true : breadcrumbs;
|
|
140
|
+
if (_breadcrumbs) {
|
|
141
|
+
addRequestBreadcrumb(request, response);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
return request;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Path the outgoing get function for breadcrumbs. */
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
152
|
+
_getPatchOutgoingGetFunction(clientRequest) {
|
|
153
|
+
return (_original) => {
|
|
154
|
+
// Re-implement http.get. This needs to be done (instead of using
|
|
155
|
+
// getPatchOutgoingRequestFunction to patch it) because we need to
|
|
156
|
+
// set the trace context header before the returned http.ClientRequest is
|
|
157
|
+
// ended. The Node.js docs state that the only differences between
|
|
158
|
+
// request and get are that (1) get defaults to the HTTP GET method and
|
|
159
|
+
// (2) the returned request object is ended immediately. The former is
|
|
160
|
+
// already true (at least in supported Node versions up to v10), so we
|
|
161
|
+
// simply follow the latter. Ref:
|
|
162
|
+
// https://nodejs.org/dist/latest/docs/api/http.html#http_http_get_options_callback
|
|
163
|
+
// https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/instrumentations/instrumentation-http.ts#L198
|
|
164
|
+
return function outgoingGetRequest(...args) {
|
|
165
|
+
const req = clientRequest(...args);
|
|
166
|
+
req.end();
|
|
167
|
+
return req;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* This is a minimal version of `wrap` from shimmer:
|
|
175
|
+
* https://github.com/othiym23/shimmer/blob/master/index.js
|
|
176
|
+
*
|
|
177
|
+
* In contrast to the original implementation, this version does not allow to unwrap,
|
|
178
|
+
* and does not make it clear that the method is wrapped.
|
|
179
|
+
* This is necessary because we want to wrap the http module with our own code,
|
|
180
|
+
* while still allowing to use the HttpInstrumentation from OTEL.
|
|
181
|
+
*
|
|
182
|
+
* Without this, if we'd just use `wrap` from shimmer, the OTEL instrumentation would remove our wrapping,
|
|
183
|
+
* because it only allows any module to be wrapped a single time.
|
|
184
|
+
*/
|
|
185
|
+
function stealthWrap(
|
|
186
|
+
nodule,
|
|
187
|
+
name,
|
|
188
|
+
wrapper,
|
|
189
|
+
) {
|
|
190
|
+
const original = nodule[name];
|
|
191
|
+
const wrapped = wrapper(original);
|
|
192
|
+
|
|
193
|
+
defineProperty(nodule, name, wrapped);
|
|
194
|
+
return wrapped;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Sets a property on an object, preserving its enumerability.
|
|
198
|
+
function defineProperty(
|
|
199
|
+
obj,
|
|
200
|
+
name,
|
|
201
|
+
value,
|
|
202
|
+
) {
|
|
203
|
+
const enumerable = !!obj[name] && Object.prototype.propertyIsEnumerable.call(obj, name);
|
|
204
|
+
|
|
205
|
+
Object.defineProperty(obj, name, {
|
|
206
|
+
configurable: true,
|
|
207
|
+
enumerable: enumerable,
|
|
208
|
+
writable: true,
|
|
209
|
+
value: value,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Add a breadcrumb for outgoing requests. */
|
|
214
|
+
function addRequestBreadcrumb(request, response) {
|
|
215
|
+
const data = getBreadcrumbData(request);
|
|
216
|
+
|
|
217
|
+
const statusCode = response.statusCode;
|
|
218
|
+
const level = utils.getBreadcrumbLogLevelFromHttpStatusCode(statusCode);
|
|
219
|
+
|
|
220
|
+
core$1.addBreadcrumb(
|
|
221
|
+
{
|
|
222
|
+
category: 'http',
|
|
223
|
+
data: {
|
|
224
|
+
status_code: statusCode,
|
|
225
|
+
...data,
|
|
226
|
+
},
|
|
227
|
+
type: 'http',
|
|
228
|
+
level,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
event: 'response',
|
|
232
|
+
request,
|
|
233
|
+
response,
|
|
234
|
+
},
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function getBreadcrumbData(request) {
|
|
239
|
+
try {
|
|
240
|
+
// `request.host` does not contain the port, but the host header does
|
|
241
|
+
const host = request.getHeader('host') || request.host;
|
|
242
|
+
const url = new URL(request.path, `${request.protocol}//${host}`);
|
|
243
|
+
const parsedUrl = utils.parseUrl(url.toString());
|
|
244
|
+
|
|
245
|
+
const data = {
|
|
246
|
+
url: utils.getSanitizedUrlString(parsedUrl),
|
|
247
|
+
'http.method': request.method || 'GET',
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
if (parsedUrl.search) {
|
|
251
|
+
data['http.query'] = parsedUrl.search;
|
|
252
|
+
}
|
|
253
|
+
if (parsedUrl.hash) {
|
|
254
|
+
data['http.fragment'] = parsedUrl.hash;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return data;
|
|
258
|
+
} catch (e) {
|
|
259
|
+
return {};
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
exports.SentryHttpInstrumentation = SentryHttpInstrumentation;
|
|
264
|
+
//# sourceMappingURL=SentryHttpInstrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SentryHttpInstrumentation.js","sources":["../../../../src/integrations/http/SentryHttpInstrumentation.ts"],"sourcesContent":["import type * as http from 'node:http';\nimport type * as https from 'node:https';\nimport { VERSION } from '@opentelemetry/core';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { addBreadcrumb, getClient, getIsolationScope, withIsolationScope } from '@sentry/core';\nimport type { SanitizedRequestData } from '@sentry/types';\nimport {\n getBreadcrumbLogLevelFromHttpStatusCode,\n getSanitizedUrlString,\n parseUrl,\n stripUrlQueryAndFragment,\n} from '@sentry/utils';\nimport type { NodeClient } from '../../sdk/client';\n\ntype Http = typeof http;\ntype Https = typeof https;\n\ntype SentryHttpInstrumentationOptions = InstrumentationConfig & {\n breadcrumbs?: boolean;\n};\n\n/**\n * This custom HTTP instrumentation is used to isolate incoming requests and annotate them with additional information.\n * It does not emit any spans.\n *\n * The reason this is isolated from the OpenTelemetry instrumentation is that users may overwrite this,\n * which would lead to Sentry not working as expected.\n *\n * Important note: Contrary to other OTEL instrumentation, this one cannot be unwrapped.\n * It only does minimal things though and does not emit any spans.\n *\n * This is heavily inspired & adapted from:\n * https://github.com/open-telemetry/opentelemetry-js/blob/f8ab5592ddea5cba0a3b33bf8d74f27872c0367f/experimental/packages/opentelemetry-instrumentation-http/src/http.ts\n */\nexport class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpInstrumentationOptions> {\n public constructor(config: SentryHttpInstrumentationOptions = {}) {\n super('@sentry/instrumentation-http', VERSION, config);\n }\n\n /** @inheritdoc */\n public init(): [InstrumentationNodeModuleDefinition, InstrumentationNodeModuleDefinition] {\n return [this._getHttpsInstrumentation(), this._getHttpInstrumentation()];\n }\n\n /** Get the instrumentation for the http module. */\n private _getHttpInstrumentation(): InstrumentationNodeModuleDefinition {\n return new InstrumentationNodeModuleDefinition(\n 'http',\n ['*'],\n (moduleExports: Http): Http => {\n // Patch incoming requests for request isolation\n stealthWrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction());\n\n // Patch outgoing requests for breadcrumbs\n const patchedRequest = stealthWrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction());\n stealthWrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest));\n\n return moduleExports;\n },\n () => {\n // no unwrap here\n },\n );\n }\n\n /** Get the instrumentation for the https module. */\n private _getHttpsInstrumentation(): InstrumentationNodeModuleDefinition {\n return new InstrumentationNodeModuleDefinition(\n 'https',\n ['*'],\n (moduleExports: Https): Https => {\n // Patch incoming requests for request isolation\n stealthWrap(moduleExports.Server.prototype, 'emit', this._getPatchIncomingRequestFunction());\n\n // Patch outgoing requests for breadcrumbs\n const patchedRequest = stealthWrap(moduleExports, 'request', this._getPatchOutgoingRequestFunction());\n stealthWrap(moduleExports, 'get', this._getPatchOutgoingGetFunction(patchedRequest));\n\n return moduleExports;\n },\n () => {\n // no unwrap here\n },\n );\n }\n\n /**\n * Patch the incoming request function for request isolation.\n */\n private _getPatchIncomingRequestFunction(): (\n original: (event: string, ...args: unknown[]) => boolean,\n ) => (this: unknown, event: string, ...args: unknown[]) => boolean {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const instrumentation = this;\n\n return (\n original: (event: string, ...args: unknown[]) => boolean,\n ): ((this: unknown, event: string, ...args: unknown[]) => boolean) => {\n return function incomingRequest(this: unknown, event: string, ...args: unknown[]): boolean {\n // Only traces request events\n if (event !== 'request') {\n return original.apply(this, [event, ...args]);\n }\n\n instrumentation._diag.debug('http instrumentation for incoming request');\n\n const request = args[0] as http.IncomingMessage;\n\n const isolationScope = getIsolationScope().clone();\n\n // Update the isolation scope, isolate this request\n isolationScope.setSDKProcessingMetadata({ request });\n\n const client = getClient<NodeClient>();\n if (client && client.getOptions().autoSessionTracking) {\n isolationScope.setRequestSession({ status: 'ok' });\n }\n\n // attempt to update the scope's `transactionName` based on the request URL\n // Ideally, framework instrumentations coming after the HttpInstrumentation\n // update the transactionName once we get a parameterized route.\n const httpMethod = (request.method || 'GET').toUpperCase();\n const httpTarget = stripUrlQueryAndFragment(request.url || '/');\n\n const bestEffortTransactionName = `${httpMethod} ${httpTarget}`;\n\n isolationScope.setTransactionName(bestEffortTransactionName);\n\n return withIsolationScope(isolationScope, () => {\n return original.apply(this, [event, ...args]);\n });\n };\n };\n }\n\n /**\n * Patch the outgoing request function for breadcrumbs.\n */\n private _getPatchOutgoingRequestFunction(): (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n original: (...args: any[]) => http.ClientRequest,\n ) => (...args: unknown[]) => http.ClientRequest {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const instrumentation = this;\n\n return (original: (...args: unknown[]) => http.ClientRequest): ((...args: unknown[]) => http.ClientRequest) => {\n return function outgoingRequest(this: unknown, ...args: unknown[]): http.ClientRequest {\n instrumentation._diag.debug('http instrumentation for outgoing requests');\n\n const request = original.apply(this, args) as ReturnType<typeof http.request>;\n\n request.prependListener('response', (response: http.IncomingMessage) => {\n const breadcrumbs = instrumentation.getConfig().breadcrumbs;\n const _breadcrumbs = typeof breadcrumbs === 'undefined' ? true : breadcrumbs;\n if (_breadcrumbs) {\n addRequestBreadcrumb(request, response);\n }\n });\n\n return request;\n };\n };\n }\n\n /** Path the outgoing get function for breadcrumbs. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _getPatchOutgoingGetFunction(clientRequest: (...args: any[]) => http.ClientRequest) {\n return (_original: unknown): ((...args: unknown[]) => http.ClientRequest) => {\n // Re-implement http.get. This needs to be done (instead of using\n // getPatchOutgoingRequestFunction to patch it) because we need to\n // set the trace context header before the returned http.ClientRequest is\n // ended. The Node.js docs state that the only differences between\n // request and get are that (1) get defaults to the HTTP GET method and\n // (2) the returned request object is ended immediately. The former is\n // already true (at least in supported Node versions up to v10), so we\n // simply follow the latter. Ref:\n // https://nodejs.org/dist/latest/docs/api/http.html#http_http_get_options_callback\n // https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/instrumentations/instrumentation-http.ts#L198\n return function outgoingGetRequest(...args: unknown[]): http.ClientRequest {\n const req = clientRequest(...args);\n req.end();\n return req;\n };\n };\n }\n}\n\n/**\n * This is a minimal version of `wrap` from shimmer:\n * https://github.com/othiym23/shimmer/blob/master/index.js\n *\n * In contrast to the original implementation, this version does not allow to unwrap,\n * and does not make it clear that the method is wrapped.\n * This is necessary because we want to wrap the http module with our own code,\n * while still allowing to use the HttpInstrumentation from OTEL.\n *\n * Without this, if we'd just use `wrap` from shimmer, the OTEL instrumentation would remove our wrapping,\n * because it only allows any module to be wrapped a single time.\n */\nfunction stealthWrap<Nodule extends object, FieldName extends keyof Nodule>(\n nodule: Nodule,\n name: FieldName,\n wrapper: (original: Nodule[FieldName]) => Nodule[FieldName],\n): Nodule[FieldName] {\n const original = nodule[name];\n const wrapped = wrapper(original);\n\n defineProperty(nodule, name, wrapped);\n return wrapped;\n}\n\n// Sets a property on an object, preserving its enumerability.\nfunction defineProperty<Nodule extends object, FieldName extends keyof Nodule>(\n obj: Nodule,\n name: FieldName,\n value: Nodule[FieldName],\n): void {\n const enumerable = !!obj[name] && Object.prototype.propertyIsEnumerable.call(obj, name);\n\n Object.defineProperty(obj, name, {\n configurable: true,\n enumerable: enumerable,\n writable: true,\n value: value,\n });\n}\n\n/** Add a breadcrumb for outgoing requests. */\nfunction addRequestBreadcrumb(request: http.ClientRequest, response: http.IncomingMessage): void {\n const data = getBreadcrumbData(request);\n\n const statusCode = response.statusCode;\n const level = getBreadcrumbLogLevelFromHttpStatusCode(statusCode);\n\n addBreadcrumb(\n {\n category: 'http',\n data: {\n status_code: statusCode,\n ...data,\n },\n type: 'http',\n level,\n },\n {\n event: 'response',\n request,\n response,\n },\n );\n}\n\nfunction getBreadcrumbData(request: http.ClientRequest): Partial<SanitizedRequestData> {\n try {\n // `request.host` does not contain the port, but the host header does\n const host = request.getHeader('host') || request.host;\n const url = new URL(request.path, `${request.protocol}//${host}`);\n const parsedUrl = parseUrl(url.toString());\n\n const data: Partial<SanitizedRequestData> = {\n url: getSanitizedUrlString(parsedUrl),\n 'http.method': request.method || 'GET',\n };\n\n if (parsedUrl.search) {\n data['http.query'] = parsedUrl.search;\n }\n if (parsedUrl.hash) {\n data['http.fragment'] = parsedUrl.hash;\n }\n\n return data;\n } catch {\n return {};\n }\n}\n"],"names":["InstrumentationBase","VERSION","InstrumentationNodeModuleDefinition","getIsolationScope","getClient","stripUrlQueryAndFragment","withIsolationScope","getBreadcrumbLogLevelFromHttpStatusCode","addBreadcrumb","parseUrl","getSanitizedUrlString"],"mappings":";;;;;;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAA,SAAkCA,mCAAmB,CAAmC;AACrG,GAAS,WAAW,CAAC,MAAM,GAAqC,EAAE,EAAE;AACpE,IAAI,KAAK,CAAC,8BAA8B,EAAEC,YAAO,EAAE,MAAM,CAAC,CAAA;AAC1D,GAAE;AACF;AACA;AACA,GAAS,IAAI,GAA+E;AAC5F,IAAI,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAA;AAC5E,GAAE;AACF;AACA;AACA,GAAU,uBAAuB,GAAwC;AACzE,IAAI,OAAO,IAAIC,mDAAmC;AAClD,MAAM,MAAM;AACZ,MAAM,CAAC,GAAG,CAAC;AACX,MAAM,CAAC,aAAa,KAAiB;AACrC;AACA,QAAQ,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,gCAAgC,EAAE,CAAC,CAAA;AACpG;AACA;AACA,QAAQ,MAAM,cAAA,GAAiB,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,gCAAgC,EAAE,CAAC,CAAA;AAC7G,QAAQ,WAAW,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,4BAA4B,CAAC,cAAc,CAAC,CAAC,CAAA;AAC5F;AACA,QAAQ,OAAO,aAAa,CAAA;AAC5B,OAAO;AACP,MAAM,MAAM;AACZ;AACA,OAAO;AACP,KAAK,CAAA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AAA,MAAA,SAAA,GAAAC,cAAA,CAAA,GAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AACA;AACA,IAAA,MAAA,IAAA,GAAA;AACA,MAAA,GAAA,EAAAC,2BAAA,CAAA,SAAA,CAAA;AACA,MAAA,aAAA,EAAA,OAAA,CAAA,MAAA,IAAA,KAAA;AACA,KAAA,CAAA;AACA;AACA,IAAA,IAAA,SAAA,CAAA,MAAA,EAAA;AACA,MAAA,IAAA,CAAA,YAAA,CAAA,GAAA,SAAA,CAAA,MAAA,CAAA;AACA,KAAA;AACA,IAAA,IAAA,SAAA,CAAA,IAAA,EAAA;AACA,MAAA,IAAA,CAAA,eAAA,CAAA,GAAA,SAAA,CAAA,IAAA,CAAA;AACA,KAAA;AACA;AACA,IAAA,OAAA,IAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,EAAA,CAAA;AACA,GAAA;AACA;;;;"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
var {
|
|
2
|
+
_optionalChain
|
|
3
|
+
} = require('@sentry/utils');
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
|
+
|
|
7
|
+
const api = require('@opentelemetry/api');
|
|
8
|
+
const instrumentationHttp = require('@opentelemetry/instrumentation-http');
|
|
9
|
+
const core = require('@sentry/core');
|
|
10
|
+
const opentelemetry = require('@sentry/opentelemetry');
|
|
11
|
+
const instrument = require('../../otel/instrument.js');
|
|
12
|
+
const addOriginToSpan = require('../../utils/addOriginToSpan.js');
|
|
13
|
+
const getRequestUrl = require('../../utils/getRequestUrl.js');
|
|
14
|
+
const SentryHttpInstrumentation = require('./SentryHttpInstrumentation.js');
|
|
15
|
+
|
|
16
|
+
const INTEGRATION_NAME = 'Http';
|
|
17
|
+
|
|
18
|
+
const INSTRUMENTATION_NAME = '@opentelemetry_sentry-patched/instrumentation-http';
|
|
19
|
+
|
|
20
|
+
const instrumentSentryHttp = instrument.generateInstrumentOnce(
|
|
21
|
+
`${INTEGRATION_NAME}.sentry`,
|
|
22
|
+
options => {
|
|
23
|
+
return new SentryHttpInstrumentation.SentryHttpInstrumentation({ breadcrumbs: _optionalChain([options, 'optionalAccess', _ => _.breadcrumbs]) });
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const instrumentOtelHttp = instrument.generateInstrumentOnce(INTEGRATION_NAME, config => {
|
|
28
|
+
const instrumentation = new instrumentationHttp.HttpInstrumentation(config);
|
|
29
|
+
|
|
30
|
+
// We want to update the logger namespace so we can better identify what is happening here
|
|
31
|
+
try {
|
|
32
|
+
instrumentation['_diag'] = api.diag.createComponentLogger({
|
|
33
|
+
namespace: INSTRUMENTATION_NAME,
|
|
34
|
+
});
|
|
35
|
+
// @ts-expect-error We are writing a read-only property here...
|
|
36
|
+
instrumentation.instrumentationName = INSTRUMENTATION_NAME;
|
|
37
|
+
} catch (e) {
|
|
38
|
+
// ignore errors here...
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return instrumentation;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Instrument the HTTP and HTTPS modules.
|
|
46
|
+
*/
|
|
47
|
+
const instrumentHttp = (options = {}) => {
|
|
48
|
+
// This is the "regular" OTEL instrumentation that emits spans
|
|
49
|
+
if (options.spans !== false) {
|
|
50
|
+
const instrumentationConfig = getConfigWithDefaults(options);
|
|
51
|
+
instrumentOtelHttp(instrumentationConfig);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// This is the Sentry-specific instrumentation that isolates requests & creates breadcrumbs
|
|
55
|
+
// Note that this _has_ to be wrapped after the OTEL instrumentation,
|
|
56
|
+
// otherwise the isolation will not work correctly
|
|
57
|
+
instrumentSentryHttp(options);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const _httpIntegration = ((options = {}) => {
|
|
61
|
+
return {
|
|
62
|
+
name: INTEGRATION_NAME,
|
|
63
|
+
setupOnce() {
|
|
64
|
+
instrumentHttp(options);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}) ;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The http integration instruments Node's internal http and https modules.
|
|
71
|
+
* It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.
|
|
72
|
+
*/
|
|
73
|
+
const httpIntegration = core.defineIntegration(_httpIntegration);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Determines if @param req is a ClientRequest, meaning the request was created within the express app
|
|
77
|
+
* and it's an outgoing request.
|
|
78
|
+
* Checking for properties instead of using `instanceOf` to avoid importing the request classes.
|
|
79
|
+
*/
|
|
80
|
+
function _isClientRequest(req) {
|
|
81
|
+
return 'outputData' in req && 'outputSize' in req && !('client' in req) && !('statusCode' in req);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Detects if an incoming request is a prefetch request.
|
|
86
|
+
*/
|
|
87
|
+
function isKnownPrefetchRequest(req) {
|
|
88
|
+
// Currently only handles Next.js prefetch requests but may check other frameworks in the future.
|
|
89
|
+
return req.headers['next-router-prefetch'] === '1';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function getConfigWithDefaults(options = {}) {
|
|
93
|
+
const instrumentationConfig = {
|
|
94
|
+
..._optionalChain([options, 'access', _2 => _2.instrumentation, 'optionalAccess', _3 => _3._experimentalConfig]),
|
|
95
|
+
|
|
96
|
+
disableIncomingRequestInstrumentation: options.disableIncomingRequestSpans,
|
|
97
|
+
|
|
98
|
+
ignoreOutgoingRequestHook: request => {
|
|
99
|
+
const url = getRequestUrl.getRequestUrl(request);
|
|
100
|
+
|
|
101
|
+
if (!url) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;
|
|
106
|
+
if (_ignoreOutgoingRequests && _ignoreOutgoingRequests(url, request)) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return false;
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
ignoreIncomingRequestHook: request => {
|
|
114
|
+
// request.url is the only property that holds any information about the url
|
|
115
|
+
// it only consists of the URL path and query string (if any)
|
|
116
|
+
const urlPath = request.url;
|
|
117
|
+
|
|
118
|
+
const method = _optionalChain([request, 'access', _4 => _4.method, 'optionalAccess', _5 => _5.toUpperCase, 'call', _6 => _6()]);
|
|
119
|
+
// We do not capture OPTIONS/HEAD requests as transactions
|
|
120
|
+
if (method === 'OPTIONS' || method === 'HEAD') {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const _ignoreIncomingRequests = options.ignoreIncomingRequests;
|
|
125
|
+
if (urlPath && _ignoreIncomingRequests && _ignoreIncomingRequests(urlPath, request)) {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return false;
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
requireParentforOutgoingSpans: false,
|
|
133
|
+
requireParentforIncomingSpans: false,
|
|
134
|
+
requestHook: (span, req) => {
|
|
135
|
+
addOriginToSpan.addOriginToSpan(span, 'auto.http.otel.http');
|
|
136
|
+
if (!_isClientRequest(req) && isKnownPrefetchRequest(req)) {
|
|
137
|
+
span.setAttribute('sentry.http.prefetch', true);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
_optionalChain([options, 'access', _7 => _7.instrumentation, 'optionalAccess', _8 => _8.requestHook, 'optionalCall', _9 => _9(span, req)]);
|
|
141
|
+
},
|
|
142
|
+
responseHook: (span, res) => {
|
|
143
|
+
const client = opentelemetry.getClient();
|
|
144
|
+
if (client && client.getOptions().autoSessionTracking) {
|
|
145
|
+
setImmediate(() => {
|
|
146
|
+
client['_captureRequestSession']();
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
_optionalChain([options, 'access', _10 => _10.instrumentation, 'optionalAccess', _11 => _11.responseHook, 'optionalCall', _12 => _12(span, res)]);
|
|
151
|
+
},
|
|
152
|
+
applyCustomAttributesOnSpan: (
|
|
153
|
+
span,
|
|
154
|
+
request,
|
|
155
|
+
response,
|
|
156
|
+
) => {
|
|
157
|
+
_optionalChain([options, 'access', _13 => _13.instrumentation, 'optionalAccess', _14 => _14.applyCustomAttributesOnSpan, 'optionalCall', _15 => _15(span, request, response)]);
|
|
158
|
+
},
|
|
159
|
+
} ;
|
|
160
|
+
|
|
161
|
+
return instrumentationConfig;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
exports.httpIntegration = httpIntegration;
|
|
165
|
+
exports.instrumentOtelHttp = instrumentOtelHttp;
|
|
166
|
+
exports.instrumentSentryHttp = instrumentSentryHttp;
|
|
167
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/integrations/http/index.ts"],"sourcesContent":["import type { ClientRequest, IncomingMessage, RequestOptions, ServerResponse } from 'node:http';\nimport { diag } from '@opentelemetry/api';\nimport type { HttpInstrumentationConfig } from '@opentelemetry/instrumentation-http';\nimport { HttpInstrumentation } from '@opentelemetry/instrumentation-http';\n\nimport { defineIntegration } from '@sentry/core';\nimport { getClient } from '@sentry/opentelemetry';\nimport type { IntegrationFn, Span } from '@sentry/types';\n\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport type { NodeClient } from '../../sdk/client';\nimport type { HTTPModuleRequestIncomingMessage } from '../../transports/http-module';\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\nimport { getRequestUrl } from '../../utils/getRequestUrl';\nimport { SentryHttpInstrumentation } from './SentryHttpInstrumentation';\n\nconst INTEGRATION_NAME = 'Http';\n\nconst INSTRUMENTATION_NAME = '@opentelemetry_sentry-patched/instrumentation-http';\n\ninterface HttpOptions {\n /**\n * Whether breadcrumbs should be recorded for requests.\n * Defaults to true\n */\n breadcrumbs?: boolean;\n\n /**\n * If set to false, do not emit any spans.\n * This will ensure that the default HttpInstrumentation from OpenTelemetry is not setup,\n * only the Sentry-specific instrumentation for request isolation is applied.\n */\n spans?: boolean;\n\n /**\n * Do not capture spans or breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.\n * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.\n *\n * The `url` param contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.\n * For example: `'https://someService.com/users/details?id=123'`\n *\n * The `request` param contains the original {@type RequestOptions} object used to make the outgoing request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreOutgoingRequests?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Do not capture spans or breadcrumbs for incoming HTTP requests to URLs where the given callback returns `true`.\n * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.\n *\n * The `urlPath` param consists of the URL path and query string (if any) of the incoming request.\n * For example: `'/users/details?id=123'`\n *\n * The `request` param contains the original {@type IncomingMessage} object of the incoming request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreIncomingRequests?: (urlPath: string, request: IncomingMessage) => boolean;\n\n /**\n * If true, do not generate spans for incoming requests at all.\n * This is used by Remix to avoid generating spans for incoming requests, as it generates its own spans.\n */\n disableIncomingRequestSpans?: boolean;\n\n /**\n * Additional instrumentation options that are passed to the underlying HttpInstrumentation.\n */\n instrumentation?: {\n requestHook?: (span: Span, req: ClientRequest | HTTPModuleRequestIncomingMessage) => void;\n responseHook?: (span: Span, response: HTTPModuleRequestIncomingMessage | ServerResponse) => void;\n applyCustomAttributesOnSpan?: (\n span: Span,\n request: ClientRequest | HTTPModuleRequestIncomingMessage,\n response: HTTPModuleRequestIncomingMessage | ServerResponse,\n ) => void;\n\n /**\n * You can pass any configuration through to the underlying instrumention.\n * Note that there are no semver guarantees for this!\n */\n _experimentalConfig?: ConstructorParameters<typeof HttpInstrumentation>[0];\n };\n}\n\nexport const instrumentSentryHttp = generateInstrumentOnce<{ breadcrumbs?: boolean }>(\n `${INTEGRATION_NAME}.sentry`,\n options => {\n return new SentryHttpInstrumentation({ breadcrumbs: options?.breadcrumbs });\n },\n);\n\nexport const instrumentOtelHttp = generateInstrumentOnce<HttpInstrumentationConfig>(INTEGRATION_NAME, config => {\n const instrumentation = new HttpInstrumentation(config);\n\n // We want to update the logger namespace so we can better identify what is happening here\n try {\n instrumentation['_diag'] = diag.createComponentLogger({\n namespace: INSTRUMENTATION_NAME,\n });\n // @ts-expect-error We are writing a read-only property here...\n instrumentation.instrumentationName = INSTRUMENTATION_NAME;\n } catch {\n // ignore errors here...\n }\n\n return instrumentation;\n});\n\n/**\n * Instrument the HTTP and HTTPS modules.\n */\nconst instrumentHttp = (options: HttpOptions = {}): void => {\n // This is the \"regular\" OTEL instrumentation that emits spans\n if (options.spans !== false) {\n const instrumentationConfig = getConfigWithDefaults(options);\n instrumentOtelHttp(instrumentationConfig);\n }\n\n // This is the Sentry-specific instrumentation that isolates requests & creates breadcrumbs\n // Note that this _has_ to be wrapped after the OTEL instrumentation,\n // otherwise the isolation will not work correctly\n instrumentSentryHttp(options);\n};\n\nconst _httpIntegration = ((options: HttpOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentHttp(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * The http integration instruments Node's internal http and https modules.\n * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.\n */\nexport const httpIntegration = defineIntegration(_httpIntegration);\n\n/**\n * Determines if @param req is a ClientRequest, meaning the request was created within the express app\n * and it's an outgoing request.\n * Checking for properties instead of using `instanceOf` to avoid importing the request classes.\n */\nfunction _isClientRequest(req: ClientRequest | HTTPModuleRequestIncomingMessage): req is ClientRequest {\n return 'outputData' in req && 'outputSize' in req && !('client' in req) && !('statusCode' in req);\n}\n\n/**\n * Detects if an incoming request is a prefetch request.\n */\nfunction isKnownPrefetchRequest(req: HTTPModuleRequestIncomingMessage): boolean {\n // Currently only handles Next.js prefetch requests but may check other frameworks in the future.\n return req.headers['next-router-prefetch'] === '1';\n}\n\nfunction getConfigWithDefaults(options: Partial<HttpOptions> = {}): HttpInstrumentationConfig {\n const instrumentationConfig = {\n ...options.instrumentation?._experimentalConfig,\n\n disableIncomingRequestInstrumentation: options.disableIncomingRequestSpans,\n\n ignoreOutgoingRequestHook: request => {\n const url = getRequestUrl(request);\n\n if (!url) {\n return false;\n }\n\n const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;\n if (_ignoreOutgoingRequests && _ignoreOutgoingRequests(url, request)) {\n return true;\n }\n\n return false;\n },\n\n ignoreIncomingRequestHook: request => {\n // request.url is the only property that holds any information about the url\n // it only consists of the URL path and query string (if any)\n const urlPath = request.url;\n\n const method = request.method?.toUpperCase();\n // We do not capture OPTIONS/HEAD requests as transactions\n if (method === 'OPTIONS' || method === 'HEAD') {\n return true;\n }\n\n const _ignoreIncomingRequests = options.ignoreIncomingRequests;\n if (urlPath && _ignoreIncomingRequests && _ignoreIncomingRequests(urlPath, request)) {\n return true;\n }\n\n return false;\n },\n\n requireParentforOutgoingSpans: false,\n requireParentforIncomingSpans: false,\n requestHook: (span, req) => {\n addOriginToSpan(span, 'auto.http.otel.http');\n if (!_isClientRequest(req) && isKnownPrefetchRequest(req)) {\n span.setAttribute('sentry.http.prefetch', true);\n }\n\n options.instrumentation?.requestHook?.(span, req);\n },\n responseHook: (span, res) => {\n const client = getClient<NodeClient>();\n if (client && client.getOptions().autoSessionTracking) {\n setImmediate(() => {\n client['_captureRequestSession']();\n });\n }\n\n options.instrumentation?.responseHook?.(span, res);\n },\n applyCustomAttributesOnSpan: (\n span: Span,\n request: ClientRequest | HTTPModuleRequestIncomingMessage,\n response: HTTPModuleRequestIncomingMessage | ServerResponse,\n ) => {\n options.instrumentation?.applyCustomAttributesOnSpan?.(span, request, response);\n },\n } satisfies HttpInstrumentationConfig;\n\n return instrumentationConfig;\n}\n"],"names":["generateInstrumentOnce","SentryHttpInstrumentation","HttpInstrumentation","diag","defineIntegration","getRequestUrl","addOriginToSpan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AAA,CAAA,CAAA,EAAA,OAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;IACA,CAAA;EACA,EAAA;;EAEA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,qBAAA;AACA;;;;"}
|
|
@@ -10,7 +10,7 @@ const utils = require('@sentry/utils');
|
|
|
10
10
|
const common = require('./common.js');
|
|
11
11
|
|
|
12
12
|
// This string is a placeholder that gets overwritten with the worker code.
|
|
13
|
-
const base64WorkerScript = '
|
|
13
|
+
const base64WorkerScript = 'LyohIEBzZW50cnkvbm9kZSA4LjM1LjAtYWxwaGEuMCAoMzE0ZjUxZCkgfCBodHRwczovL2dpdGh1Yi5jb20vZ2V0c2VudHJ5L3NlbnRyeS1qYXZhc2NyaXB0ICovCmltcG9ydHtTZXNzaW9uIGFzIGV9ZnJvbSJub2RlOmluc3BlY3Rvci9wcm9taXNlcyI7aW1wb3J0e3dvcmtlckRhdGEgYXMgdH1mcm9tIm5vZGU6d29ya2VyX3RocmVhZHMiO2NvbnN0IG49IjguMzUuMC1hbHBoYS4wIixvPWdsb2JhbFRoaXM7Y29uc3QgYT0idW5kZWZpbmVkIj09dHlwZW9mIF9fU0VOVFJZX0RFQlVHX198fF9fU0VOVFJZX0RFQlVHX18saT1bImRlYnVnIiwiaW5mbyIsIndhcm4iLCJlcnJvciIsImxvZyIsImFzc2VydCIsInRyYWNlIl0scz17fTtmdW5jdGlvbiBjKGUpe2lmKCEoImNvbnNvbGUiaW4gbykpcmV0dXJuIGUoKTtjb25zdCB0PW8uY29uc29sZSxuPXt9LGE9T2JqZWN0LmtleXMocyk7YS5mb3JFYWNoKChlPT57Y29uc3Qgbz1zW2VdO25bZV09dFtlXSx0W2VdPW99KSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goKGU9Pnt0W2VdPW5bZV19KSl9fSFmdW5jdGlvbihlLHQsYSl7Y29uc3QgaT1hfHxvLHM9aS5fX1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