@echoteam/signoz-react 1.0.0 → 1.0.1
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/LICENSE +20 -20
- package/README.md +286 -285
- package/dist/index.esm.js +570 -1188
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +558 -1176
- package/dist/index.js.map +1 -1
- package/package.json +86 -90
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var perf_hooks$2 = require('perf_hooks');
|
|
4
|
-
var path$
|
|
4
|
+
var path$4 = require('path');
|
|
5
5
|
var require$$1$3 = require('util');
|
|
6
6
|
var require$$1$4 = require('module');
|
|
7
7
|
var require$$1$2 = require('tty');
|
|
8
8
|
var os$2 = require('os');
|
|
9
9
|
var require$$0 = require('fs');
|
|
10
|
-
var
|
|
10
|
+
var url$2 = require('url');
|
|
11
11
|
var require$$3 = require('worker_threads');
|
|
12
12
|
var http$2 = require('http');
|
|
13
13
|
var https$2 = require('https');
|
|
@@ -33,8 +33,8 @@ function _interopNamespaceDefault(e) {
|
|
|
33
33
|
return Object.freeze(n);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path$
|
|
37
|
-
var
|
|
36
|
+
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path$4);
|
|
37
|
+
var url__namespace = /*#__PURE__*/_interopNamespaceDefault(url$2);
|
|
38
38
|
var http__namespace = /*#__PURE__*/_interopNamespaceDefault(http$2);
|
|
39
39
|
var https__namespace = /*#__PURE__*/_interopNamespaceDefault(https$2);
|
|
40
40
|
var zlib__namespace = /*#__PURE__*/_interopNamespaceDefault(zlib$2);
|
|
@@ -3091,7 +3091,7 @@ function getEnvWithoutDefaults() {
|
|
|
3091
3091
|
* See the License for the specific language governing permissions and
|
|
3092
3092
|
* limitations under the License.
|
|
3093
3093
|
*/
|
|
3094
|
-
var otperformance$
|
|
3094
|
+
var otperformance$4 = perf_hooks$2.performance;
|
|
3095
3095
|
|
|
3096
3096
|
/*
|
|
3097
3097
|
* Copyright The OpenTelemetry Authors
|
|
@@ -3164,10 +3164,10 @@ function unrefTimer(timer) {
|
|
|
3164
3164
|
* See the License for the specific language governing permissions and
|
|
3165
3165
|
* limitations under the License.
|
|
3166
3166
|
*/
|
|
3167
|
-
var NANOSECOND_DIGITS$
|
|
3167
|
+
var NANOSECOND_DIGITS$4 = 9;
|
|
3168
3168
|
var NANOSECOND_DIGITS_IN_MILLIS$3 = 6;
|
|
3169
3169
|
var MILLISECONDS_TO_NANOSECONDS$3 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS$3);
|
|
3170
|
-
var SECOND_TO_NANOSECONDS$
|
|
3170
|
+
var SECOND_TO_NANOSECONDS$4 = Math.pow(10, NANOSECOND_DIGITS$4);
|
|
3171
3171
|
/**
|
|
3172
3172
|
* Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).
|
|
3173
3173
|
* @param epochMillis
|
|
@@ -3181,9 +3181,9 @@ function millisToHrTime$3(epochMillis) {
|
|
|
3181
3181
|
return [seconds, nanos];
|
|
3182
3182
|
}
|
|
3183
3183
|
function getTimeOrigin$3() {
|
|
3184
|
-
var timeOrigin = otperformance$
|
|
3184
|
+
var timeOrigin = otperformance$4.timeOrigin;
|
|
3185
3185
|
if (typeof timeOrigin !== 'number') {
|
|
3186
|
-
var perf = otperformance$
|
|
3186
|
+
var perf = otperformance$4;
|
|
3187
3187
|
timeOrigin = perf.timing && perf.timing.fetchStart;
|
|
3188
3188
|
}
|
|
3189
3189
|
return timeOrigin;
|
|
@@ -3194,7 +3194,7 @@ function getTimeOrigin$3() {
|
|
|
3194
3194
|
*/
|
|
3195
3195
|
function hrTime$3(performanceNow) {
|
|
3196
3196
|
var timeOrigin = millisToHrTime$3(getTimeOrigin$3());
|
|
3197
|
-
var now = millisToHrTime$3(typeof performanceNow === 'number' ? performanceNow : otperformance$
|
|
3197
|
+
var now = millisToHrTime$3(typeof performanceNow === 'number' ? performanceNow : otperformance$4.now());
|
|
3198
3198
|
return addHrTimes$3(timeOrigin, now);
|
|
3199
3199
|
}
|
|
3200
3200
|
/**
|
|
@@ -3209,7 +3209,7 @@ function hrTimeDuration(startTime, endTime) {
|
|
|
3209
3209
|
if (nanos < 0) {
|
|
3210
3210
|
seconds -= 1;
|
|
3211
3211
|
// negate
|
|
3212
|
-
nanos += SECOND_TO_NANOSECONDS$
|
|
3212
|
+
nanos += SECOND_TO_NANOSECONDS$4;
|
|
3213
3213
|
}
|
|
3214
3214
|
return [seconds, nanos];
|
|
3215
3215
|
}
|
|
@@ -3238,8 +3238,8 @@ function isTimeInput(value) {
|
|
|
3238
3238
|
function addHrTimes$3(time1, time2) {
|
|
3239
3239
|
var out = [time1[0] + time2[0], time1[1] + time2[1]];
|
|
3240
3240
|
// Nanoseconds
|
|
3241
|
-
if (out[1] >= SECOND_TO_NANOSECONDS$
|
|
3242
|
-
out[1] -= SECOND_TO_NANOSECONDS$
|
|
3241
|
+
if (out[1] >= SECOND_TO_NANOSECONDS$4) {
|
|
3242
|
+
out[1] -= SECOND_TO_NANOSECONDS$4;
|
|
3243
3243
|
out[0] += 1;
|
|
3244
3244
|
}
|
|
3245
3245
|
return out;
|
|
@@ -4164,7 +4164,7 @@ var Span = /** @class */ (function () {
|
|
|
4164
4164
|
this.kind = kind;
|
|
4165
4165
|
this.links = links;
|
|
4166
4166
|
var now = Date.now();
|
|
4167
|
-
this._performanceStartTime = otperformance$
|
|
4167
|
+
this._performanceStartTime = otperformance$4.now();
|
|
4168
4168
|
this._performanceOffset =
|
|
4169
4169
|
now - (this._performanceStartTime + getTimeOrigin$3());
|
|
4170
4170
|
this._startTimeProvided = startTime != null;
|
|
@@ -4305,7 +4305,7 @@ var Span = /** @class */ (function () {
|
|
|
4305
4305
|
this._spanProcessor.onEnd(this);
|
|
4306
4306
|
};
|
|
4307
4307
|
Span.prototype._getTime = function (inp) {
|
|
4308
|
-
if (typeof inp === 'number' && inp <= otperformance$
|
|
4308
|
+
if (typeof inp === 'number' && inp <= otperformance$4.now()) {
|
|
4309
4309
|
// must be a performance timestamp
|
|
4310
4310
|
// apply correction and convert to hrtime
|
|
4311
4311
|
return hrTime$3(inp + this._performanceOffset);
|
|
@@ -4324,7 +4324,7 @@ var Span = /** @class */ (function () {
|
|
|
4324
4324
|
// we can't use duration to calculate event/end times
|
|
4325
4325
|
return millisToHrTime$3(Date.now());
|
|
4326
4326
|
}
|
|
4327
|
-
var msDuration = otperformance$
|
|
4327
|
+
var msDuration = otperformance$4.now() - this._performanceStartTime;
|
|
4328
4328
|
return addHrTimes$3(this.startTime, millisToHrTime$3(msDuration));
|
|
4329
4329
|
};
|
|
4330
4330
|
Span.prototype.isRecording = function () {
|
|
@@ -5885,20 +5885,20 @@ var PerformanceTimingNames$2;
|
|
|
5885
5885
|
* See the License for the specific language governing permissions and
|
|
5886
5886
|
* limitations under the License.
|
|
5887
5887
|
*/
|
|
5888
|
-
var TMP_HTTP_RESPONSE_CONTENT_LENGTH$
|
|
5889
|
-
var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$
|
|
5888
|
+
var TMP_HTTP_RESPONSE_CONTENT_LENGTH$1 = 'http.response_content_length';
|
|
5889
|
+
var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1 = 'http.response_content_length_uncompressed';
|
|
5890
5890
|
/**
|
|
5891
5891
|
* The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.
|
|
5892
5892
|
*
|
|
5893
5893
|
* @deprecated Use ATTR_HTTP_RESPONSE_CONTENT_LENGTH in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
5894
5894
|
*/
|
|
5895
|
-
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$
|
|
5895
|
+
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$1 = TMP_HTTP_RESPONSE_CONTENT_LENGTH$1;
|
|
5896
5896
|
/**
|
|
5897
5897
|
* The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.
|
|
5898
5898
|
*
|
|
5899
5899
|
* @deprecated Use ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
5900
5900
|
*/
|
|
5901
|
-
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$
|
|
5901
|
+
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1 = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1;
|
|
5902
5902
|
|
|
5903
5903
|
/*
|
|
5904
5904
|
* Copyright The OpenTelemetry Authors
|
|
@@ -5974,12 +5974,12 @@ function addSpanNetworkEvents$2(span, resource, ignoreNetworkEvents) {
|
|
|
5974
5974
|
}
|
|
5975
5975
|
var encodedLength = resource[PerformanceTimingNames$2.ENCODED_BODY_SIZE];
|
|
5976
5976
|
if (encodedLength !== undefined) {
|
|
5977
|
-
span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$
|
|
5977
|
+
span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$1, encodedLength);
|
|
5978
5978
|
}
|
|
5979
5979
|
var decodedLength = resource[PerformanceTimingNames$2.DECODED_BODY_SIZE];
|
|
5980
5980
|
// Spec: Not set if transport encoding not used (in which case encoded and decoded sizes match)
|
|
5981
5981
|
if (decodedLength !== undefined && encodedLength !== decodedLength) {
|
|
5982
|
-
span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$
|
|
5982
|
+
span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1, decodedLength);
|
|
5983
5983
|
}
|
|
5984
5984
|
}
|
|
5985
5985
|
/**
|
|
@@ -6490,74 +6490,14 @@ function hexToBinary(hexStr) {
|
|
|
6490
6490
|
* See the License for the specific language governing permissions and
|
|
6491
6491
|
* limitations under the License.
|
|
6492
6492
|
*/
|
|
6493
|
-
var
|
|
6494
|
-
|
|
6495
|
-
/*
|
|
6496
|
-
* Copyright The OpenTelemetry Authors
|
|
6497
|
-
*
|
|
6498
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6499
|
-
* you may not use this file except in compliance with the License.
|
|
6500
|
-
* You may obtain a copy of the License at
|
|
6501
|
-
*
|
|
6502
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
6503
|
-
*
|
|
6504
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6505
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6506
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6507
|
-
* See the License for the specific language governing permissions and
|
|
6508
|
-
* limitations under the License.
|
|
6509
|
-
*/
|
|
6510
|
-
var NANOSECOND_DIGITS$2 = 9;
|
|
6511
|
-
var NANOSECOND_DIGITS_IN_MILLIS$2 = 6;
|
|
6512
|
-
var MILLISECONDS_TO_NANOSECONDS$2 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS$2);
|
|
6513
|
-
var SECOND_TO_NANOSECONDS$2 = Math.pow(10, NANOSECOND_DIGITS$2);
|
|
6514
|
-
/**
|
|
6515
|
-
* Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).
|
|
6516
|
-
* @param epochMillis
|
|
6517
|
-
*/
|
|
6518
|
-
function millisToHrTime$2(epochMillis) {
|
|
6519
|
-
var epochSeconds = epochMillis / 1000;
|
|
6520
|
-
// Decimals only.
|
|
6521
|
-
var seconds = Math.trunc(epochSeconds);
|
|
6522
|
-
// Round sub-nanosecond accuracy to nanosecond.
|
|
6523
|
-
var nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS$2);
|
|
6524
|
-
return [seconds, nanos];
|
|
6525
|
-
}
|
|
6526
|
-
function getTimeOrigin$2() {
|
|
6527
|
-
var timeOrigin = otperformance$2.timeOrigin;
|
|
6528
|
-
if (typeof timeOrigin !== 'number') {
|
|
6529
|
-
var perf = otperformance$2;
|
|
6530
|
-
timeOrigin = perf.timing && perf.timing.fetchStart;
|
|
6531
|
-
}
|
|
6532
|
-
return timeOrigin;
|
|
6533
|
-
}
|
|
6534
|
-
/**
|
|
6535
|
-
* Returns an hrtime calculated via performance component.
|
|
6536
|
-
* @param performanceNow
|
|
6537
|
-
*/
|
|
6538
|
-
function hrTime$2(performanceNow) {
|
|
6539
|
-
var timeOrigin = millisToHrTime$2(getTimeOrigin$2());
|
|
6540
|
-
var now = millisToHrTime$2(otperformance$2.now());
|
|
6541
|
-
return addHrTimes$2(timeOrigin, now);
|
|
6542
|
-
}
|
|
6493
|
+
var NANOSECOND_DIGITS$3 = 9;
|
|
6494
|
+
var SECOND_TO_NANOSECONDS$3 = Math.pow(10, NANOSECOND_DIGITS$3);
|
|
6543
6495
|
/**
|
|
6544
6496
|
* Convert hrTime to nanoseconds.
|
|
6545
6497
|
* @param time
|
|
6546
6498
|
*/
|
|
6547
6499
|
function hrTimeToNanoseconds$2(time) {
|
|
6548
|
-
return time[0] * SECOND_TO_NANOSECONDS$
|
|
6549
|
-
}
|
|
6550
|
-
/**
|
|
6551
|
-
* Given 2 HrTime formatted times, return their sum as an HrTime.
|
|
6552
|
-
*/
|
|
6553
|
-
function addHrTimes$2(time1, time2) {
|
|
6554
|
-
var out = [time1[0] + time2[0], time1[1] + time2[1]];
|
|
6555
|
-
// Nanoseconds
|
|
6556
|
-
if (out[1] >= SECOND_TO_NANOSECONDS$2) {
|
|
6557
|
-
out[1] -= SECOND_TO_NANOSECONDS$2;
|
|
6558
|
-
out[0] += 1;
|
|
6559
|
-
}
|
|
6560
|
-
return out;
|
|
6500
|
+
return time[0] * SECOND_TO_NANOSECONDS$3 + time[1];
|
|
6561
6501
|
}
|
|
6562
6502
|
|
|
6563
6503
|
/*
|
|
@@ -6581,23 +6521,6 @@ var ExportResultCode;
|
|
|
6581
6521
|
ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED";
|
|
6582
6522
|
})(ExportResultCode || (ExportResultCode = {}));
|
|
6583
6523
|
|
|
6584
|
-
/*
|
|
6585
|
-
* Copyright The OpenTelemetry Authors
|
|
6586
|
-
*
|
|
6587
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6588
|
-
* you may not use this file except in compliance with the License.
|
|
6589
|
-
* You may obtain a copy of the License at
|
|
6590
|
-
*
|
|
6591
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
6592
|
-
*
|
|
6593
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
6594
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
6595
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
6596
|
-
* See the License for the specific language governing permissions and
|
|
6597
|
-
* limitations under the License.
|
|
6598
|
-
*/
|
|
6599
|
-
var TRACE_PARENT_HEADER = 'traceparent';
|
|
6600
|
-
|
|
6601
6524
|
/*
|
|
6602
6525
|
* Copyright The OpenTelemetry Authors
|
|
6603
6526
|
*
|
|
@@ -7035,7 +6958,7 @@ var __assign$5 = (undefined && undefined.__assign) || function () {
|
|
|
7035
6958
|
*/
|
|
7036
6959
|
function sendWithHttp(collector, data, contentType, onSuccess, onError) {
|
|
7037
6960
|
var exporterTimeout = collector.timeoutMillis;
|
|
7038
|
-
var parsedUrl = new
|
|
6961
|
+
var parsedUrl = new url__namespace.URL(collector.url);
|
|
7039
6962
|
var nodeVersion = Number(process.versions.node.split('.')[0]);
|
|
7040
6963
|
var retryTimer;
|
|
7041
6964
|
var req;
|
|
@@ -7161,7 +7084,7 @@ function createHttpAgent(config) {
|
|
|
7161
7084
|
if (config.keepAlive === false || !config.url)
|
|
7162
7085
|
return undefined;
|
|
7163
7086
|
try {
|
|
7164
|
-
var parsedUrl = new
|
|
7087
|
+
var parsedUrl = new url__namespace.URL(config.url);
|
|
7165
7088
|
var Agent = parsedUrl.protocol === 'http:' ? http__namespace.Agent : https__namespace.Agent;
|
|
7166
7089
|
return new Agent(__assign$5({ keepAlive: true }, config.httpAgentOptions));
|
|
7167
7090
|
}
|
|
@@ -12249,7 +12172,7 @@ if (typeof process === 'undefined' || process.type === 'renderer' || process.bro
|
|
|
12249
12172
|
|
|
12250
12173
|
var srcExports = src.exports;
|
|
12251
12174
|
|
|
12252
|
-
var sep = path$
|
|
12175
|
+
var sep = path$4.sep;
|
|
12253
12176
|
|
|
12254
12177
|
var moduleDetailsFromPath$1 = function (file) {
|
|
12255
12178
|
var segments = file.split(sep);
|
|
@@ -12428,7 +12351,7 @@ var hasRequiredNodeModulesPaths;
|
|
|
12428
12351
|
function requireNodeModulesPaths () {
|
|
12429
12352
|
if (hasRequiredNodeModulesPaths) return nodeModulesPaths;
|
|
12430
12353
|
hasRequiredNodeModulesPaths = 1;
|
|
12431
|
-
var path = path$
|
|
12354
|
+
var path = path$4;
|
|
12432
12355
|
var parse = path.parse || requirePathParse(); // eslint-disable-line global-require
|
|
12433
12356
|
|
|
12434
12357
|
var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
|
|
@@ -12479,15 +12402,124 @@ var hasRequiredNormalizeOptions;
|
|
|
12479
12402
|
function requireNormalizeOptions () {
|
|
12480
12403
|
if (hasRequiredNormalizeOptions) return normalizeOptions;
|
|
12481
12404
|
hasRequiredNormalizeOptions = 1;
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
12489
|
-
|
|
12490
|
-
|
|
12405
|
+
// Info: this file has been generated by Yarn with the approval of the
|
|
12406
|
+
// `resolve` maintainers. Bugs caused by a code located here should be
|
|
12407
|
+
// opened against the Yarn repository.
|
|
12408
|
+
|
|
12409
|
+
const path = path$4;
|
|
12410
|
+
|
|
12411
|
+
normalizeOptions = function (_, opts) {
|
|
12412
|
+
opts = opts || {};
|
|
12413
|
+
|
|
12414
|
+
if (opts.forceNodeResolution || !process.versions.pnp)
|
|
12415
|
+
return opts;
|
|
12416
|
+
|
|
12417
|
+
// It would be nice if we could throw, but that would break the transparent
|
|
12418
|
+
// compatibility with packages that use `resolve` today (such as Gulp). Since
|
|
12419
|
+
// it's the whole point of this patch, we don't.
|
|
12420
|
+
//
|
|
12421
|
+
// if (opts.packageIterator || opts.paths)
|
|
12422
|
+
// throw new Error(`The "packageIterator" and "paths" options cannot be used in PnP environments. Set "forceNodeResolution: true" if absolutely needed, or branch on process.versions.pnp otherwise.`);
|
|
12423
|
+
|
|
12424
|
+
const {findPnpApi} = require$$1$4;
|
|
12425
|
+
|
|
12426
|
+
const runPnpResolution = (request, basedir) => {
|
|
12427
|
+
// Extract the name of the package being requested (1=package name, 2=internal path)
|
|
12428
|
+
const parts = request.match(/^((?:@[^/]+\/)?[^/]+)(\/.*)?/);
|
|
12429
|
+
if (!parts)
|
|
12430
|
+
throw new Error(`Assertion failed: Expected the "resolve" package to call the "paths" callback with package names only (got "${request}")`);
|
|
12431
|
+
|
|
12432
|
+
// Make sure that basedir ends with a slash
|
|
12433
|
+
if (basedir.charAt(basedir.length - 1) !== `/`)
|
|
12434
|
+
basedir = path.join(basedir, `/`);
|
|
12435
|
+
|
|
12436
|
+
const api = findPnpApi(basedir);
|
|
12437
|
+
if (api === null)
|
|
12438
|
+
return undefined;
|
|
12439
|
+
|
|
12440
|
+
// This is guaranteed to return the path to the "package.json" file from the given package
|
|
12441
|
+
let manifestPath;
|
|
12442
|
+
try {
|
|
12443
|
+
manifestPath = api.resolveToUnqualified(`${parts[1]}/package.json`, basedir, {considerBuiltins: false});
|
|
12444
|
+
} catch (err) {
|
|
12445
|
+
return null;
|
|
12446
|
+
}
|
|
12447
|
+
|
|
12448
|
+
if (manifestPath === null)
|
|
12449
|
+
throw new Error(`Assertion failed: The resolution thinks that "${parts[1]}" is a Node builtin`);
|
|
12450
|
+
|
|
12451
|
+
// Strip the package.json to get the package folder
|
|
12452
|
+
const packagePath = path.dirname(manifestPath);
|
|
12453
|
+
|
|
12454
|
+
// Attach the internal path to the resolved package directory
|
|
12455
|
+
const unqualifiedPath = typeof parts[2] !== `undefined`
|
|
12456
|
+
? path.join(packagePath, parts[2])
|
|
12457
|
+
: packagePath;
|
|
12458
|
+
|
|
12459
|
+
return {packagePath, unqualifiedPath};
|
|
12460
|
+
};
|
|
12461
|
+
|
|
12462
|
+
const runPnpResolutionOnArray = (request, paths) => {
|
|
12463
|
+
for (let i = 0; i < paths.length; i++) {
|
|
12464
|
+
const resolution = runPnpResolution(request, paths[i]);
|
|
12465
|
+
if (resolution || i === paths.length - 1) {
|
|
12466
|
+
return resolution;
|
|
12467
|
+
}
|
|
12468
|
+
}
|
|
12469
|
+
|
|
12470
|
+
return null;
|
|
12471
|
+
};
|
|
12472
|
+
|
|
12473
|
+
const originalPaths = Array.isArray(opts.paths) ? opts.paths : [];
|
|
12474
|
+
|
|
12475
|
+
const packageIterator = (request, basedir, getCandidates, opts) => {
|
|
12476
|
+
const pathsToTest = [basedir].concat(originalPaths);
|
|
12477
|
+
const resolution = runPnpResolutionOnArray(request, pathsToTest);
|
|
12478
|
+
if (resolution == null)
|
|
12479
|
+
return getCandidates();
|
|
12480
|
+
|
|
12481
|
+
return [resolution.unqualifiedPath];
|
|
12482
|
+
};
|
|
12483
|
+
|
|
12484
|
+
const paths = (request, basedir, getNodeModulePaths, opts) => {
|
|
12485
|
+
const pathsToTest = [basedir].concat(originalPaths);
|
|
12486
|
+
const resolution = runPnpResolutionOnArray(request, pathsToTest);
|
|
12487
|
+
if (resolution == null)
|
|
12488
|
+
return getNodeModulePaths().concat(originalPaths);
|
|
12489
|
+
|
|
12490
|
+
// Stip the local named folder
|
|
12491
|
+
let nodeModules = path.dirname(resolution.packagePath);
|
|
12492
|
+
|
|
12493
|
+
// Strip the scope named folder if needed
|
|
12494
|
+
if (request.match(/^@[^/]+\//))
|
|
12495
|
+
nodeModules = path.dirname(nodeModules);
|
|
12496
|
+
|
|
12497
|
+
return [nodeModules];
|
|
12498
|
+
};
|
|
12499
|
+
|
|
12500
|
+
// We need to keep track whether we're in `packageIterator` or not so that
|
|
12501
|
+
// the code is compatible with both `resolve` 1.9+ and `resolve` 1.15+
|
|
12502
|
+
let isInsideIterator = false;
|
|
12503
|
+
|
|
12504
|
+
if (!opts.__skipPackageIterator) {
|
|
12505
|
+
opts.packageIterator = function (request, basedir, getCandidates, opts) {
|
|
12506
|
+
isInsideIterator = true;
|
|
12507
|
+
try {
|
|
12508
|
+
return packageIterator(request, basedir, getCandidates, opts);
|
|
12509
|
+
} finally {
|
|
12510
|
+
isInsideIterator = false;
|
|
12511
|
+
}
|
|
12512
|
+
};
|
|
12513
|
+
}
|
|
12514
|
+
|
|
12515
|
+
opts.paths = function (request, basedir, getNodeModulePaths, opts) {
|
|
12516
|
+
if (isInsideIterator)
|
|
12517
|
+
return getNodeModulePaths().concat(originalPaths);
|
|
12518
|
+
|
|
12519
|
+
return paths(request, basedir, getNodeModulePaths);
|
|
12520
|
+
};
|
|
12521
|
+
|
|
12522
|
+
return opts;
|
|
12491
12523
|
};
|
|
12492
12524
|
return normalizeOptions;
|
|
12493
12525
|
}
|
|
@@ -12648,7 +12680,7 @@ var _linklist$1 = "< 8";
|
|
|
12648
12680
|
var module$2 = true;
|
|
12649
12681
|
var net$1 = true;
|
|
12650
12682
|
var os$1 = true;
|
|
12651
|
-
var path$
|
|
12683
|
+
var path$3 = true;
|
|
12652
12684
|
var perf_hooks$1 = ">= 8.5";
|
|
12653
12685
|
var process$2 = ">= 1";
|
|
12654
12686
|
var punycode$1 = ">= 0.5";
|
|
@@ -12848,7 +12880,7 @@ var require$$1$1 = {
|
|
|
12848
12880
|
">= 14.18 && < 15",
|
|
12849
12881
|
">= 16"
|
|
12850
12882
|
],
|
|
12851
|
-
path: path$
|
|
12883
|
+
path: path$3,
|
|
12852
12884
|
"node:path": [
|
|
12853
12885
|
">= 14.18 && < 15",
|
|
12854
12886
|
">= 16"
|
|
@@ -13143,7 +13175,7 @@ function requireAsync () {
|
|
|
13143
13175
|
hasRequiredAsync = 1;
|
|
13144
13176
|
var fs = require$$0;
|
|
13145
13177
|
var getHomedir = requireHomedir();
|
|
13146
|
-
var path = path$
|
|
13178
|
+
var path = path$4;
|
|
13147
13179
|
var caller = requireCaller();
|
|
13148
13180
|
var nodeModulesPaths = requireNodeModulesPaths();
|
|
13149
13181
|
var normalizeOptions = requireNormalizeOptions();
|
|
@@ -13508,7 +13540,7 @@ var _linklist = "< 8";
|
|
|
13508
13540
|
var module$1 = true;
|
|
13509
13541
|
var net = true;
|
|
13510
13542
|
var os = true;
|
|
13511
|
-
var path$
|
|
13543
|
+
var path$2 = true;
|
|
13512
13544
|
var perf_hooks = ">= 8.5";
|
|
13513
13545
|
var process$1 = ">= 1";
|
|
13514
13546
|
var punycode = ">= 0.5";
|
|
@@ -13708,7 +13740,7 @@ var require$$1 = {
|
|
|
13708
13740
|
">= 14.18 && < 15",
|
|
13709
13741
|
">= 16"
|
|
13710
13742
|
],
|
|
13711
|
-
path: path$
|
|
13743
|
+
path: path$2,
|
|
13712
13744
|
"node:path": [
|
|
13713
13745
|
">= 14.18 && < 15",
|
|
13714
13746
|
">= 16"
|
|
@@ -13957,7 +13989,7 @@ function requireSync () {
|
|
|
13957
13989
|
hasRequiredSync = 1;
|
|
13958
13990
|
var isCore = requireIsCoreModule();
|
|
13959
13991
|
var fs = require$$0;
|
|
13960
|
-
var path = path$
|
|
13992
|
+
var path = path$4;
|
|
13961
13993
|
var getHomedir = requireHomedir();
|
|
13962
13994
|
var caller = requireCaller();
|
|
13963
13995
|
var nodeModulesPaths = requireNodeModulesPaths();
|
|
@@ -14187,7 +14219,7 @@ var bugs = {
|
|
|
14187
14219
|
var require$$5 = {
|
|
14188
14220
|
bugs: bugs};
|
|
14189
14221
|
|
|
14190
|
-
const path$
|
|
14222
|
+
const path$1 = path$4;
|
|
14191
14223
|
const Module = require$$1$4;
|
|
14192
14224
|
const debug$8 = srcExports('require-in-the-middle');
|
|
14193
14225
|
const moduleDetailsFromPath = moduleDetailsFromPath$1;
|
|
@@ -14195,8 +14227,8 @@ const moduleDetailsFromPath = moduleDetailsFromPath$1;
|
|
|
14195
14227
|
// Using the default export is discouraged, but kept for backward compatibility.
|
|
14196
14228
|
// Use this instead:
|
|
14197
14229
|
// const { Hook } = require('require-in-the-middle')
|
|
14198
|
-
requireInTheMiddle.exports = Hook$
|
|
14199
|
-
var Hook_1$
|
|
14230
|
+
requireInTheMiddle.exports = Hook$1;
|
|
14231
|
+
var Hook_1$1 = requireInTheMiddle.exports.Hook = Hook$1;
|
|
14200
14232
|
|
|
14201
14233
|
let builtinModules; // Set<string>
|
|
14202
14234
|
|
|
@@ -14327,8 +14359,8 @@ class ExportsCache {
|
|
|
14327
14359
|
}
|
|
14328
14360
|
}
|
|
14329
14361
|
|
|
14330
|
-
function Hook$
|
|
14331
|
-
if ((this instanceof Hook$
|
|
14362
|
+
function Hook$1 (modules, options, onrequire) {
|
|
14363
|
+
if ((this instanceof Hook$1) === false) return new Hook$1(modules, options, onrequire)
|
|
14332
14364
|
if (typeof modules === 'function') {
|
|
14333
14365
|
onrequire = modules;
|
|
14334
14366
|
modules = null;
|
|
@@ -14460,7 +14492,7 @@ function Hook$4 (modules, options, onrequire) {
|
|
|
14460
14492
|
moduleName = filename;
|
|
14461
14493
|
} else if (hasWhitelist === true && modules.includes(filename)) {
|
|
14462
14494
|
// whitelist includes the absolute path to the file including extension
|
|
14463
|
-
const parsedPath = path$
|
|
14495
|
+
const parsedPath = path$1.parse(filename);
|
|
14464
14496
|
moduleName = parsedPath.name;
|
|
14465
14497
|
basedir = parsedPath.dir;
|
|
14466
14498
|
} else {
|
|
@@ -14518,7 +14550,7 @@ function Hook$4 (modules, options, onrequire) {
|
|
|
14518
14550
|
// this is a module-internal file
|
|
14519
14551
|
if (internals === true) {
|
|
14520
14552
|
// use the module-relative path to the file, prefixed by original module name
|
|
14521
|
-
moduleName = moduleName + path$
|
|
14553
|
+
moduleName = moduleName + path$1.sep + path$1.relative(basedir, filename);
|
|
14522
14554
|
debug$8('preparing to process require of internal file: %s', moduleName);
|
|
14523
14555
|
} else {
|
|
14524
14556
|
debug$8('ignoring require of non-main module file: %s', res);
|
|
@@ -14541,7 +14573,7 @@ function Hook$4 (modules, options, onrequire) {
|
|
|
14541
14573
|
}
|
|
14542
14574
|
}
|
|
14543
14575
|
|
|
14544
|
-
Hook$
|
|
14576
|
+
Hook$1.prototype.unhook = function () {
|
|
14545
14577
|
this._unhooked = true;
|
|
14546
14578
|
|
|
14547
14579
|
if (this._require === Module.prototype.require) {
|
|
@@ -14562,10 +14594,44 @@ Hook$4.prototype.unhook = function () {
|
|
|
14562
14594
|
};
|
|
14563
14595
|
|
|
14564
14596
|
function resolveModuleName (stat) {
|
|
14565
|
-
const normalizedPath = path$
|
|
14566
|
-
return path$
|
|
14597
|
+
const normalizedPath = path$1.sep !== '/' ? stat.path.split(path$1.sep).join('/') : stat.path;
|
|
14598
|
+
return path$1.posix.join(stat.name, normalizedPath).replace(normalize, '')
|
|
14567
14599
|
}
|
|
14568
14600
|
|
|
14601
|
+
/*
|
|
14602
|
+
* Copyright The OpenTelemetry Authors
|
|
14603
|
+
*
|
|
14604
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14605
|
+
* you may not use this file except in compliance with the License.
|
|
14606
|
+
* You may obtain a copy of the License at
|
|
14607
|
+
*
|
|
14608
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
14609
|
+
*
|
|
14610
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14611
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14612
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14613
|
+
* See the License for the specific language governing permissions and
|
|
14614
|
+
* limitations under the License.
|
|
14615
|
+
*/
|
|
14616
|
+
var otperformance$3 = perf_hooks$2.performance;
|
|
14617
|
+
|
|
14618
|
+
/*
|
|
14619
|
+
* Copyright The OpenTelemetry Authors
|
|
14620
|
+
*
|
|
14621
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14622
|
+
* you may not use this file except in compliance with the License.
|
|
14623
|
+
* You may obtain a copy of the License at
|
|
14624
|
+
*
|
|
14625
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
14626
|
+
*
|
|
14627
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14628
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14629
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14630
|
+
* See the License for the specific language governing permissions and
|
|
14631
|
+
* limitations under the License.
|
|
14632
|
+
*/
|
|
14633
|
+
var TRACE_PARENT_HEADER = 'traceparent';
|
|
14634
|
+
|
|
14569
14635
|
/*
|
|
14570
14636
|
* Copyright The OpenTelemetry Authors
|
|
14571
14637
|
*
|
|
@@ -15377,7 +15443,7 @@ let SemVer$T = class SemVer {
|
|
|
15377
15443
|
var semver$7 = SemVer$T;
|
|
15378
15444
|
|
|
15379
15445
|
const SemVer$S = semver$7;
|
|
15380
|
-
const parse$
|
|
15446
|
+
const parse$t = (version, options, throwErrors = false) => {
|
|
15381
15447
|
if (version instanceof SemVer$S) {
|
|
15382
15448
|
return version
|
|
15383
15449
|
}
|
|
@@ -15391,18 +15457,18 @@ const parse$w = (version, options, throwErrors = false) => {
|
|
|
15391
15457
|
}
|
|
15392
15458
|
};
|
|
15393
15459
|
|
|
15394
|
-
var parse_1$3 = parse$
|
|
15460
|
+
var parse_1$3 = parse$t;
|
|
15395
15461
|
|
|
15396
|
-
const parse$
|
|
15462
|
+
const parse$s = parse_1$3;
|
|
15397
15463
|
const valid$b = (version, options) => {
|
|
15398
|
-
const v = parse$
|
|
15464
|
+
const v = parse$s(version, options);
|
|
15399
15465
|
return v ? v.version : null
|
|
15400
15466
|
};
|
|
15401
15467
|
var valid_1$3 = valid$b;
|
|
15402
15468
|
|
|
15403
|
-
const parse$
|
|
15469
|
+
const parse$r = parse_1$3;
|
|
15404
15470
|
const clean$7 = (version, options) => {
|
|
15405
|
-
const s = parse$
|
|
15471
|
+
const s = parse$r(version.trim().replace(/^[=v]+/, ''), options);
|
|
15406
15472
|
return s ? s.version : null
|
|
15407
15473
|
};
|
|
15408
15474
|
var clean_1$3 = clean$7;
|
|
@@ -15427,11 +15493,11 @@ const inc$7 = (version, release, options, identifier, identifierBase) => {
|
|
|
15427
15493
|
};
|
|
15428
15494
|
var inc_1$3 = inc$7;
|
|
15429
15495
|
|
|
15430
|
-
const parse$
|
|
15496
|
+
const parse$q = parse_1$3;
|
|
15431
15497
|
|
|
15432
15498
|
const diff$7 = (version1, version2) => {
|
|
15433
|
-
const v1 = parse$
|
|
15434
|
-
const v2 = parse$
|
|
15499
|
+
const v1 = parse$q(version1, null, true);
|
|
15500
|
+
const v2 = parse$q(version2, null, true);
|
|
15435
15501
|
const comparison = v1.compare(v2);
|
|
15436
15502
|
|
|
15437
15503
|
if (comparison === 0) {
|
|
@@ -15498,9 +15564,9 @@ const SemVer$O = semver$7;
|
|
|
15498
15564
|
const patch$7 = (a, loose) => new SemVer$O(a, loose).patch;
|
|
15499
15565
|
var patch_1$3 = patch$7;
|
|
15500
15566
|
|
|
15501
|
-
const parse$
|
|
15567
|
+
const parse$p = parse_1$3;
|
|
15502
15568
|
const prerelease$7 = (version, options) => {
|
|
15503
|
-
const parsed = parse$
|
|
15569
|
+
const parsed = parse$p(version, options);
|
|
15504
15570
|
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
|
15505
15571
|
};
|
|
15506
15572
|
var prerelease_1$3 = prerelease$7;
|
|
@@ -15613,7 +15679,7 @@ const cmp$7 = (a, op, b, loose) => {
|
|
|
15613
15679
|
var cmp_1$3 = cmp$7;
|
|
15614
15680
|
|
|
15615
15681
|
const SemVer$L = semver$7;
|
|
15616
|
-
const parse$
|
|
15682
|
+
const parse$o = parse_1$3;
|
|
15617
15683
|
const { safeRe: re$9, t: t$6 } = reExports$3;
|
|
15618
15684
|
|
|
15619
15685
|
const coerce$7 = (version, options) => {
|
|
@@ -15669,16 +15735,16 @@ const coerce$7 = (version, options) => {
|
|
|
15669
15735
|
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
|
|
15670
15736
|
const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
|
|
15671
15737
|
|
|
15672
|
-
return parse$
|
|
15738
|
+
return parse$o(`${major}.${minor}.${patch}${prerelease}${build}`, options)
|
|
15673
15739
|
};
|
|
15674
15740
|
var coerce_1$3 = coerce$7;
|
|
15675
15741
|
|
|
15676
15742
|
var lrucache$3;
|
|
15677
|
-
var hasRequiredLrucache$
|
|
15743
|
+
var hasRequiredLrucache$2;
|
|
15678
15744
|
|
|
15679
|
-
function requireLrucache$
|
|
15680
|
-
if (hasRequiredLrucache$
|
|
15681
|
-
hasRequiredLrucache$
|
|
15745
|
+
function requireLrucache$2 () {
|
|
15746
|
+
if (hasRequiredLrucache$2) return lrucache$3;
|
|
15747
|
+
hasRequiredLrucache$2 = 1;
|
|
15682
15748
|
|
|
15683
15749
|
class LRUCache {
|
|
15684
15750
|
constructor () {
|
|
@@ -15944,7 +16010,7 @@ function requireRange$3 () {
|
|
|
15944
16010
|
|
|
15945
16011
|
range$3 = Range;
|
|
15946
16012
|
|
|
15947
|
-
const LRU = requireLrucache$
|
|
16013
|
+
const LRU = requireLrucache$2();
|
|
15948
16014
|
const cache = new LRU();
|
|
15949
16015
|
|
|
15950
16016
|
const parseOptions = parseOptions_1$3;
|
|
@@ -16983,7 +17049,7 @@ const internalRe$3 = reExports$3;
|
|
|
16983
17049
|
const constants$6 = constants$7;
|
|
16984
17050
|
const SemVer$G = semver$7;
|
|
16985
17051
|
const identifiers$6 = identifiers$7;
|
|
16986
|
-
const parse$
|
|
17052
|
+
const parse$n = parse_1$3;
|
|
16987
17053
|
const valid$9 = valid_1$3;
|
|
16988
17054
|
const clean$6 = clean_1$3;
|
|
16989
17055
|
const inc$6 = inc_1$3;
|
|
@@ -17021,7 +17087,7 @@ const intersects$6 = intersects_1$3;
|
|
|
17021
17087
|
const simplifyRange$3 = simplify$3;
|
|
17022
17088
|
const subset$6 = subset_1$3;
|
|
17023
17089
|
var semver$6 = {
|
|
17024
|
-
parse: parse$
|
|
17090
|
+
parse: parse$n,
|
|
17025
17091
|
valid: valid$9,
|
|
17026
17092
|
clean: clean$6,
|
|
17027
17093
|
inc: inc$6,
|
|
@@ -17435,7 +17501,7 @@ var RequireInTheMiddleSingleton$3 = /** @class */ (function () {
|
|
|
17435
17501
|
}
|
|
17436
17502
|
RequireInTheMiddleSingleton.prototype._initialize = function () {
|
|
17437
17503
|
var _this = this;
|
|
17438
|
-
new Hook_1$
|
|
17504
|
+
new Hook_1$1(
|
|
17439
17505
|
// Intercept all `require` calls; we will filter the matching ones below
|
|
17440
17506
|
null, { internals: true }, function (exports, name, basedir) {
|
|
17441
17507
|
var e_1, _a;
|
|
@@ -17504,23 +17570,23 @@ function normalizePathSeparators$3(moduleNameOrPath) {
|
|
|
17504
17570
|
: moduleNameOrPath;
|
|
17505
17571
|
}
|
|
17506
17572
|
|
|
17507
|
-
var importInTheMiddle
|
|
17573
|
+
var importInTheMiddle = {exports: {}};
|
|
17508
17574
|
|
|
17509
|
-
var register$
|
|
17575
|
+
var register$1 = {};
|
|
17510
17576
|
|
|
17511
17577
|
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
|
|
17512
17578
|
//
|
|
17513
17579
|
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
|
|
17514
17580
|
|
|
17515
|
-
const importHooks$
|
|
17516
|
-
const setters
|
|
17517
|
-
const getters
|
|
17518
|
-
const specifiers$
|
|
17519
|
-
const toHook$
|
|
17581
|
+
const importHooks$1 = []; // TODO should this be a Set?
|
|
17582
|
+
const setters = new WeakMap();
|
|
17583
|
+
const getters = new WeakMap();
|
|
17584
|
+
const specifiers$1 = new Map();
|
|
17585
|
+
const toHook$1 = [];
|
|
17520
17586
|
|
|
17521
|
-
const proxyHandler
|
|
17587
|
+
const proxyHandler = {
|
|
17522
17588
|
set (target, name, value) {
|
|
17523
|
-
return setters
|
|
17589
|
+
return setters.get(target)[name](value)
|
|
17524
17590
|
},
|
|
17525
17591
|
|
|
17526
17592
|
get (target, name) {
|
|
@@ -17528,7 +17594,7 @@ const proxyHandler$3 = {
|
|
|
17528
17594
|
return 'Module'
|
|
17529
17595
|
}
|
|
17530
17596
|
|
|
17531
|
-
const getter = getters
|
|
17597
|
+
const getter = getters.get(target)[name];
|
|
17532
17598
|
|
|
17533
17599
|
if (typeof getter === 'function') {
|
|
17534
17600
|
return getter()
|
|
@@ -17540,72 +17606,72 @@ const proxyHandler$3 = {
|
|
|
17540
17606
|
throw new Error('Getters/setters are not supported for exports property descriptors.')
|
|
17541
17607
|
}
|
|
17542
17608
|
|
|
17543
|
-
return setters
|
|
17609
|
+
return setters.get(target)[property](descriptor.value)
|
|
17544
17610
|
}
|
|
17545
17611
|
};
|
|
17546
17612
|
|
|
17547
|
-
function register
|
|
17548
|
-
specifiers$
|
|
17549
|
-
setters
|
|
17550
|
-
getters
|
|
17551
|
-
const proxy = new Proxy(namespace, proxyHandler
|
|
17552
|
-
importHooks$
|
|
17553
|
-
toHook$
|
|
17613
|
+
function register (name, namespace, set, get, specifier) {
|
|
17614
|
+
specifiers$1.set(name, specifier);
|
|
17615
|
+
setters.set(namespace, set);
|
|
17616
|
+
getters.set(namespace, get);
|
|
17617
|
+
const proxy = new Proxy(namespace, proxyHandler);
|
|
17618
|
+
importHooks$1.forEach(hook => hook(name, proxy));
|
|
17619
|
+
toHook$1.push([name, proxy]);
|
|
17554
17620
|
}
|
|
17555
17621
|
|
|
17556
|
-
let experimentalPatchInternals
|
|
17622
|
+
let experimentalPatchInternals = false;
|
|
17557
17623
|
|
|
17558
|
-
function getExperimentalPatchInternals$
|
|
17559
|
-
return experimentalPatchInternals
|
|
17624
|
+
function getExperimentalPatchInternals$1 () {
|
|
17625
|
+
return experimentalPatchInternals
|
|
17560
17626
|
}
|
|
17561
17627
|
|
|
17562
|
-
function setExperimentalPatchInternals
|
|
17563
|
-
experimentalPatchInternals
|
|
17628
|
+
function setExperimentalPatchInternals (value) {
|
|
17629
|
+
experimentalPatchInternals = value;
|
|
17564
17630
|
}
|
|
17565
17631
|
|
|
17566
|
-
register$
|
|
17567
|
-
register$
|
|
17568
|
-
register$
|
|
17569
|
-
register$
|
|
17570
|
-
register$
|
|
17571
|
-
register$
|
|
17632
|
+
register$1.register = register;
|
|
17633
|
+
register$1.importHooks = importHooks$1;
|
|
17634
|
+
register$1.specifiers = specifiers$1;
|
|
17635
|
+
register$1.toHook = toHook$1;
|
|
17636
|
+
register$1.getExperimentalPatchInternals = getExperimentalPatchInternals$1;
|
|
17637
|
+
register$1.setExperimentalPatchInternals = setExperimentalPatchInternals;
|
|
17572
17638
|
|
|
17573
17639
|
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
|
|
17574
17640
|
//
|
|
17575
17641
|
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
|
|
17576
17642
|
|
|
17577
|
-
const path
|
|
17578
|
-
const parse$
|
|
17579
|
-
const { fileURLToPath
|
|
17580
|
-
const { MessageChannel
|
|
17643
|
+
const path = path$4;
|
|
17644
|
+
const parse$m = moduleDetailsFromPath$1;
|
|
17645
|
+
const { fileURLToPath } = url$2;
|
|
17646
|
+
const { MessageChannel } = require$$3;
|
|
17581
17647
|
|
|
17582
17648
|
const {
|
|
17583
|
-
importHooks
|
|
17584
|
-
specifiers
|
|
17585
|
-
toHook
|
|
17586
|
-
getExperimentalPatchInternals
|
|
17587
|
-
} = register$
|
|
17649
|
+
importHooks,
|
|
17650
|
+
specifiers,
|
|
17651
|
+
toHook,
|
|
17652
|
+
getExperimentalPatchInternals
|
|
17653
|
+
} = register$1;
|
|
17588
17654
|
|
|
17589
|
-
function addHook
|
|
17590
|
-
importHooks
|
|
17591
|
-
toHook
|
|
17655
|
+
function addHook (hook) {
|
|
17656
|
+
importHooks.push(hook);
|
|
17657
|
+
toHook.forEach(([name, namespace]) => hook(name, namespace));
|
|
17592
17658
|
}
|
|
17593
17659
|
|
|
17594
|
-
function removeHook
|
|
17595
|
-
const index = importHooks
|
|
17660
|
+
function removeHook (hook) {
|
|
17661
|
+
const index = importHooks.indexOf(hook);
|
|
17596
17662
|
if (index > -1) {
|
|
17597
|
-
importHooks
|
|
17663
|
+
importHooks.splice(index, 1);
|
|
17598
17664
|
}
|
|
17599
17665
|
}
|
|
17600
17666
|
|
|
17601
|
-
function callHookFn
|
|
17667
|
+
function callHookFn (hookFn, namespace, name, baseDir) {
|
|
17602
17668
|
const newDefault = hookFn(namespace, name, baseDir);
|
|
17603
17669
|
if (newDefault && newDefault !== namespace) {
|
|
17604
17670
|
namespace.default = newDefault;
|
|
17605
17671
|
}
|
|
17606
17672
|
}
|
|
17607
17673
|
|
|
17608
|
-
let sendModulesToLoader
|
|
17674
|
+
let sendModulesToLoader;
|
|
17609
17675
|
|
|
17610
17676
|
/**
|
|
17611
17677
|
* EXPERIMENTAL
|
|
@@ -17635,12 +17701,12 @@ let sendModulesToLoader$3;
|
|
|
17635
17701
|
* await waitForAllMessagesAcknowledged()
|
|
17636
17702
|
* ```
|
|
17637
17703
|
*/
|
|
17638
|
-
function createAddHookMessageChannel
|
|
17639
|
-
const { port1, port2 } = new MessageChannel
|
|
17704
|
+
function createAddHookMessageChannel () {
|
|
17705
|
+
const { port1, port2 } = new MessageChannel();
|
|
17640
17706
|
let pendingAckCount = 0;
|
|
17641
17707
|
let resolveFn;
|
|
17642
17708
|
|
|
17643
|
-
sendModulesToLoader
|
|
17709
|
+
sendModulesToLoader = (modules) => {
|
|
17644
17710
|
pendingAckCount++;
|
|
17645
17711
|
port1.postMessage(modules);
|
|
17646
17712
|
};
|
|
@@ -17674,8 +17740,8 @@ function createAddHookMessageChannel$3 () {
|
|
|
17674
17740
|
return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged }
|
|
17675
17741
|
}
|
|
17676
17742
|
|
|
17677
|
-
function Hook
|
|
17678
|
-
if ((this instanceof Hook
|
|
17743
|
+
function Hook (modules, options, hookFn) {
|
|
17744
|
+
if ((this instanceof Hook) === false) return new Hook(modules, options, hookFn)
|
|
17679
17745
|
if (typeof modules === 'function') {
|
|
17680
17746
|
hookFn = modules;
|
|
17681
17747
|
modules = null;
|
|
@@ -17686,8 +17752,8 @@ function Hook$3 (modules, options, hookFn) {
|
|
|
17686
17752
|
}
|
|
17687
17753
|
const internals = options ? options.internals === true : false;
|
|
17688
17754
|
|
|
17689
|
-
if (sendModulesToLoader
|
|
17690
|
-
sendModulesToLoader
|
|
17755
|
+
if (sendModulesToLoader && Array.isArray(modules)) {
|
|
17756
|
+
sendModulesToLoader(modules);
|
|
17691
17757
|
}
|
|
17692
17758
|
|
|
17693
17759
|
this._iitmHook = (name, namespace) => {
|
|
@@ -17700,10 +17766,10 @@ function Hook$3 (modules, options, hookFn) {
|
|
|
17700
17766
|
} else {
|
|
17701
17767
|
if (name.startsWith('file://')) {
|
|
17702
17768
|
try {
|
|
17703
|
-
name = fileURLToPath
|
|
17769
|
+
name = fileURLToPath(name);
|
|
17704
17770
|
} catch (e) {}
|
|
17705
17771
|
}
|
|
17706
|
-
const details = parse$
|
|
17772
|
+
const details = parse$m(name);
|
|
17707
17773
|
if (details) {
|
|
17708
17774
|
name = details.name;
|
|
17709
17775
|
baseDir = details.basedir;
|
|
@@ -17715,31 +17781,31 @@ function Hook$3 (modules, options, hookFn) {
|
|
|
17715
17781
|
if (moduleName === name) {
|
|
17716
17782
|
if (baseDir) {
|
|
17717
17783
|
if (internals) {
|
|
17718
|
-
name = name + path
|
|
17784
|
+
name = name + path.sep + path.relative(baseDir, fileURLToPath(filename));
|
|
17719
17785
|
} else {
|
|
17720
|
-
if (!getExperimentalPatchInternals
|
|
17786
|
+
if (!getExperimentalPatchInternals() && !baseDir.endsWith(specifiers.get(filename))) continue
|
|
17721
17787
|
}
|
|
17722
17788
|
}
|
|
17723
|
-
callHookFn
|
|
17789
|
+
callHookFn(hookFn, namespace, name, baseDir);
|
|
17724
17790
|
}
|
|
17725
17791
|
}
|
|
17726
17792
|
} else {
|
|
17727
|
-
callHookFn
|
|
17793
|
+
callHookFn(hookFn, namespace, name, baseDir);
|
|
17728
17794
|
}
|
|
17729
17795
|
};
|
|
17730
17796
|
|
|
17731
|
-
addHook
|
|
17797
|
+
addHook(this._iitmHook);
|
|
17732
17798
|
}
|
|
17733
17799
|
|
|
17734
|
-
Hook
|
|
17735
|
-
removeHook
|
|
17800
|
+
Hook.prototype.unhook = function () {
|
|
17801
|
+
removeHook(this._iitmHook);
|
|
17736
17802
|
};
|
|
17737
17803
|
|
|
17738
|
-
importInTheMiddle
|
|
17739
|
-
var Hook_1
|
|
17740
|
-
importInTheMiddle
|
|
17741
|
-
importInTheMiddle
|
|
17742
|
-
importInTheMiddle
|
|
17804
|
+
importInTheMiddle.exports = Hook;
|
|
17805
|
+
var Hook_1 = importInTheMiddle.exports.Hook = Hook;
|
|
17806
|
+
importInTheMiddle.exports.addHook = addHook;
|
|
17807
|
+
importInTheMiddle.exports.removeHook = removeHook;
|
|
17808
|
+
importInTheMiddle.exports.createAddHookMessageChannel = createAddHookMessageChannel;
|
|
17743
17809
|
|
|
17744
17810
|
/*
|
|
17745
17811
|
* Copyright The OpenTelemetry Authors
|
|
@@ -18097,10 +18163,10 @@ var InstrumentationBase$3 = /** @class */ (function (_super) {
|
|
|
18097
18163
|
// For an absolute paths, we must create a separate instance of the
|
|
18098
18164
|
// require-in-the-middle `Hook`.
|
|
18099
18165
|
var hook = path__namespace.isAbsolute(module_2.name)
|
|
18100
|
-
? new Hook_1$
|
|
18166
|
+
? new Hook_1$1([module_2.name], { internals: true }, onRequire)
|
|
18101
18167
|
: this_1._requireInTheMiddleSingleton.register(module_2.name, onRequire);
|
|
18102
18168
|
this_1._hooks.push(hook);
|
|
18103
|
-
var esmHook = new Hook_1
|
|
18169
|
+
var esmHook = new Hook_1([module_2.name], { internals: false }, hookFn);
|
|
18104
18170
|
this_1._hooks.push(esmHook);
|
|
18105
18171
|
};
|
|
18106
18172
|
var this_1 = this;
|
|
@@ -18235,8 +18301,8 @@ var PACKAGE_NAME$1 = '@opentelemetry/instrumentation-document-load';
|
|
|
18235
18301
|
* See the License for the specific language governing permissions and
|
|
18236
18302
|
* limitations under the License.
|
|
18237
18303
|
*/
|
|
18238
|
-
const TMP_HTTP_URL$
|
|
18239
|
-
const TMP_HTTP_USER_AGENT$
|
|
18304
|
+
const TMP_HTTP_URL$1 = 'http.url';
|
|
18305
|
+
const TMP_HTTP_USER_AGENT$1 = 'http.user_agent';
|
|
18240
18306
|
/**
|
|
18241
18307
|
* Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
|
|
18242
18308
|
*
|
|
@@ -18244,13 +18310,13 @@ const TMP_HTTP_USER_AGENT$2 = 'http.user_agent';
|
|
|
18244
18310
|
*
|
|
18245
18311
|
* @deprecated Use ATTR_HTTP_URL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
18246
18312
|
*/
|
|
18247
|
-
const SEMATTRS_HTTP_URL$
|
|
18313
|
+
const SEMATTRS_HTTP_URL$1 = TMP_HTTP_URL$1;
|
|
18248
18314
|
/**
|
|
18249
18315
|
* Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.
|
|
18250
18316
|
*
|
|
18251
18317
|
* @deprecated Use ATTR_HTTP_USER_AGENT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
|
|
18252
18318
|
*/
|
|
18253
|
-
const SEMATTRS_HTTP_USER_AGENT$
|
|
18319
|
+
const SEMATTRS_HTTP_USER_AGENT$1 = TMP_HTTP_USER_AGENT$1;
|
|
18254
18320
|
|
|
18255
18321
|
/*
|
|
18256
18322
|
* Copyright The OpenTelemetry Authors
|
|
@@ -18291,7 +18357,7 @@ var EventNames$1;
|
|
|
18291
18357
|
var getPerformanceNavigationEntries = function () {
|
|
18292
18358
|
var _a, _b;
|
|
18293
18359
|
var entries = {};
|
|
18294
|
-
var performanceNavigationTiming = (_b = (_a = otperformance$
|
|
18360
|
+
var performanceNavigationTiming = (_b = (_a = otperformance$3).getEntriesByType) === null || _b === void 0 ? void 0 : _b.call(_a, 'navigation')[0];
|
|
18295
18361
|
if (performanceNavigationTiming) {
|
|
18296
18362
|
var keys = Object.values(PerformanceTimingNames$2);
|
|
18297
18363
|
keys.forEach(function (key) {
|
|
@@ -18305,7 +18371,7 @@ var getPerformanceNavigationEntries = function () {
|
|
|
18305
18371
|
}
|
|
18306
18372
|
else {
|
|
18307
18373
|
// // fallback to previous version
|
|
18308
|
-
var perf = otperformance$
|
|
18374
|
+
var perf = otperformance$3;
|
|
18309
18375
|
var performanceTiming_1 = perf.timing;
|
|
18310
18376
|
if (performanceTiming_1) {
|
|
18311
18377
|
var keys = Object.values(PerformanceTimingNames$2);
|
|
@@ -18327,7 +18393,7 @@ var performancePaintNames = {
|
|
|
18327
18393
|
};
|
|
18328
18394
|
var addSpanPerformancePaintEvents = function (span) {
|
|
18329
18395
|
var _a, _b;
|
|
18330
|
-
var performancePaintTiming = (_b = (_a = otperformance$
|
|
18396
|
+
var performancePaintTiming = (_b = (_a = otperformance$3).getEntriesByType) === null || _b === void 0 ? void 0 : _b.call(_a, 'paint');
|
|
18331
18397
|
if (performancePaintTiming) {
|
|
18332
18398
|
performancePaintTiming.forEach(function (_a) {
|
|
18333
18399
|
var name = _a.name, startTime = _a.startTime;
|
|
@@ -18404,7 +18470,7 @@ var DocumentLoadInstrumentation = /** @class */ (function (_super) {
|
|
|
18404
18470
|
DocumentLoadInstrumentation.prototype._addResourcesSpans = function (rootSpan) {
|
|
18405
18471
|
var _this = this;
|
|
18406
18472
|
var _a, _b;
|
|
18407
|
-
var resources = (_b = (_a = otperformance$
|
|
18473
|
+
var resources = (_b = (_a = otperformance$3).getEntriesByType) === null || _b === void 0 ? void 0 : _b.call(_a, 'resource');
|
|
18408
18474
|
if (resources) {
|
|
18409
18475
|
resources.forEach(function (resource) {
|
|
18410
18476
|
_this._initResourceSpan(resource, rootSpan);
|
|
@@ -18428,7 +18494,7 @@ var DocumentLoadInstrumentation = /** @class */ (function (_super) {
|
|
|
18428
18494
|
context.with(trace.setSpan(context.active(), rootSpan), function () {
|
|
18429
18495
|
var fetchSpan = _this._startSpan(AttributeNames$3.DOCUMENT_FETCH, PerformanceTimingNames$2.FETCH_START, entries);
|
|
18430
18496
|
if (fetchSpan) {
|
|
18431
|
-
fetchSpan.setAttribute(SEMATTRS_HTTP_URL$
|
|
18497
|
+
fetchSpan.setAttribute(SEMATTRS_HTTP_URL$1, location.href);
|
|
18432
18498
|
context.with(trace.setSpan(context.active(), fetchSpan), function () {
|
|
18433
18499
|
var _a;
|
|
18434
18500
|
if (!_this._getConfig().ignoreNetworkEvents) {
|
|
@@ -18439,8 +18505,8 @@ var DocumentLoadInstrumentation = /** @class */ (function (_super) {
|
|
|
18439
18505
|
});
|
|
18440
18506
|
}
|
|
18441
18507
|
});
|
|
18442
|
-
rootSpan.setAttribute(SEMATTRS_HTTP_URL$
|
|
18443
|
-
rootSpan.setAttribute(SEMATTRS_HTTP_USER_AGENT$
|
|
18508
|
+
rootSpan.setAttribute(SEMATTRS_HTTP_URL$1, location.href);
|
|
18509
|
+
rootSpan.setAttribute(SEMATTRS_HTTP_USER_AGENT$1, navigator.userAgent);
|
|
18444
18510
|
_this._addResourcesSpans(rootSpan);
|
|
18445
18511
|
if (!_this._getConfig().ignoreNetworkEvents) {
|
|
18446
18512
|
addSpanNetworkEvent$2(rootSpan, PerformanceTimingNames$2.FETCH_START, entries);
|
|
@@ -18487,7 +18553,7 @@ var DocumentLoadInstrumentation = /** @class */ (function (_super) {
|
|
|
18487
18553
|
var _a;
|
|
18488
18554
|
var span = this._startSpan(AttributeNames$3.RESOURCE_FETCH, PerformanceTimingNames$2.FETCH_START, resource, parentSpan);
|
|
18489
18555
|
if (span) {
|
|
18490
|
-
span.setAttribute(SEMATTRS_HTTP_URL$
|
|
18556
|
+
span.setAttribute(SEMATTRS_HTTP_URL$1, resource.name);
|
|
18491
18557
|
if (!this._getConfig().ignoreNetworkEvents) {
|
|
18492
18558
|
addSpanNetworkEvents$2(span, resource);
|
|
18493
18559
|
}
|
|
@@ -19384,7 +19450,7 @@ let SemVer$F = class SemVer {
|
|
|
19384
19450
|
var semver$5 = SemVer$F;
|
|
19385
19451
|
|
|
19386
19452
|
const SemVer$E = semver$5;
|
|
19387
|
-
const parse$
|
|
19453
|
+
const parse$l = (version, options, throwErrors = false) => {
|
|
19388
19454
|
if (version instanceof SemVer$E) {
|
|
19389
19455
|
return version
|
|
19390
19456
|
}
|
|
@@ -19398,18 +19464,18 @@ const parse$o = (version, options, throwErrors = false) => {
|
|
|
19398
19464
|
}
|
|
19399
19465
|
};
|
|
19400
19466
|
|
|
19401
|
-
var parse_1$2 = parse$
|
|
19467
|
+
var parse_1$2 = parse$l;
|
|
19402
19468
|
|
|
19403
|
-
const parse$
|
|
19469
|
+
const parse$k = parse_1$2;
|
|
19404
19470
|
const valid$8 = (version, options) => {
|
|
19405
|
-
const v = parse$
|
|
19471
|
+
const v = parse$k(version, options);
|
|
19406
19472
|
return v ? v.version : null
|
|
19407
19473
|
};
|
|
19408
19474
|
var valid_1$2 = valid$8;
|
|
19409
19475
|
|
|
19410
|
-
const parse$
|
|
19476
|
+
const parse$j = parse_1$2;
|
|
19411
19477
|
const clean$5 = (version, options) => {
|
|
19412
|
-
const s = parse$
|
|
19478
|
+
const s = parse$j(version.trim().replace(/^[=v]+/, ''), options);
|
|
19413
19479
|
return s ? s.version : null
|
|
19414
19480
|
};
|
|
19415
19481
|
var clean_1$2 = clean$5;
|
|
@@ -19434,11 +19500,11 @@ const inc$5 = (version, release, options, identifier, identifierBase) => {
|
|
|
19434
19500
|
};
|
|
19435
19501
|
var inc_1$2 = inc$5;
|
|
19436
19502
|
|
|
19437
|
-
const parse$
|
|
19503
|
+
const parse$i = parse_1$2;
|
|
19438
19504
|
|
|
19439
19505
|
const diff$5 = (version1, version2) => {
|
|
19440
|
-
const v1 = parse$
|
|
19441
|
-
const v2 = parse$
|
|
19506
|
+
const v1 = parse$i(version1, null, true);
|
|
19507
|
+
const v2 = parse$i(version2, null, true);
|
|
19442
19508
|
const comparison = v1.compare(v2);
|
|
19443
19509
|
|
|
19444
19510
|
if (comparison === 0) {
|
|
@@ -19505,9 +19571,9 @@ const SemVer$A = semver$5;
|
|
|
19505
19571
|
const patch$5 = (a, loose) => new SemVer$A(a, loose).patch;
|
|
19506
19572
|
var patch_1$2 = patch$5;
|
|
19507
19573
|
|
|
19508
|
-
const parse$
|
|
19574
|
+
const parse$h = parse_1$2;
|
|
19509
19575
|
const prerelease$5 = (version, options) => {
|
|
19510
|
-
const parsed = parse$
|
|
19576
|
+
const parsed = parse$h(version, options);
|
|
19511
19577
|
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
|
19512
19578
|
};
|
|
19513
19579
|
var prerelease_1$2 = prerelease$5;
|
|
@@ -19620,7 +19686,7 @@ const cmp$5 = (a, op, b, loose) => {
|
|
|
19620
19686
|
var cmp_1$2 = cmp$5;
|
|
19621
19687
|
|
|
19622
19688
|
const SemVer$x = semver$5;
|
|
19623
|
-
const parse$
|
|
19689
|
+
const parse$g = parse_1$2;
|
|
19624
19690
|
const { safeRe: re$6, t: t$4 } = reExports$2;
|
|
19625
19691
|
|
|
19626
19692
|
const coerce$5 = (version, options) => {
|
|
@@ -19676,16 +19742,16 @@ const coerce$5 = (version, options) => {
|
|
|
19676
19742
|
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
|
|
19677
19743
|
const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
|
|
19678
19744
|
|
|
19679
|
-
return parse$
|
|
19745
|
+
return parse$g(`${major}.${minor}.${patch}${prerelease}${build}`, options)
|
|
19680
19746
|
};
|
|
19681
19747
|
var coerce_1$2 = coerce$5;
|
|
19682
19748
|
|
|
19683
19749
|
var lrucache$2;
|
|
19684
|
-
var hasRequiredLrucache;
|
|
19750
|
+
var hasRequiredLrucache$1;
|
|
19685
19751
|
|
|
19686
|
-
function requireLrucache () {
|
|
19687
|
-
if (hasRequiredLrucache) return lrucache$2;
|
|
19688
|
-
hasRequiredLrucache = 1;
|
|
19752
|
+
function requireLrucache$1 () {
|
|
19753
|
+
if (hasRequiredLrucache$1) return lrucache$2;
|
|
19754
|
+
hasRequiredLrucache$1 = 1;
|
|
19689
19755
|
|
|
19690
19756
|
class LRUCache {
|
|
19691
19757
|
constructor () {
|
|
@@ -19951,7 +20017,7 @@ function requireRange$2 () {
|
|
|
19951
20017
|
|
|
19952
20018
|
range$2 = Range;
|
|
19953
20019
|
|
|
19954
|
-
const LRU = requireLrucache();
|
|
20020
|
+
const LRU = requireLrucache$1();
|
|
19955
20021
|
const cache = new LRU();
|
|
19956
20022
|
|
|
19957
20023
|
const parseOptions = parseOptions_1$2;
|
|
@@ -20990,7 +21056,7 @@ const internalRe$2 = reExports$2;
|
|
|
20990
21056
|
const constants$4 = constants$5;
|
|
20991
21057
|
const SemVer$s = semver$5;
|
|
20992
21058
|
const identifiers$4 = identifiers$5;
|
|
20993
|
-
const parse$
|
|
21059
|
+
const parse$f = parse_1$2;
|
|
20994
21060
|
const valid$6 = valid_1$2;
|
|
20995
21061
|
const clean$4 = clean_1$2;
|
|
20996
21062
|
const inc$4 = inc_1$2;
|
|
@@ -21028,7 +21094,7 @@ const intersects$4 = intersects_1$2;
|
|
|
21028
21094
|
const simplifyRange$2 = simplify$2;
|
|
21029
21095
|
const subset$4 = subset_1$2;
|
|
21030
21096
|
var semver$4 = {
|
|
21031
|
-
parse: parse$
|
|
21097
|
+
parse: parse$f,
|
|
21032
21098
|
valid: valid$6,
|
|
21033
21099
|
clean: clean$4,
|
|
21034
21100
|
inc: inc$4,
|
|
@@ -21442,7 +21508,7 @@ var RequireInTheMiddleSingleton$2 = /** @class */ (function () {
|
|
|
21442
21508
|
}
|
|
21443
21509
|
RequireInTheMiddleSingleton.prototype._initialize = function () {
|
|
21444
21510
|
var _this = this;
|
|
21445
|
-
new Hook_1$
|
|
21511
|
+
new Hook_1$1(
|
|
21446
21512
|
// Intercept all `require` calls; we will filter the matching ones below
|
|
21447
21513
|
null, { internals: true }, function (exports, name, basedir) {
|
|
21448
21514
|
var e_1, _a;
|
|
@@ -21511,243 +21577,6 @@ function normalizePathSeparators$2(moduleNameOrPath) {
|
|
|
21511
21577
|
: moduleNameOrPath;
|
|
21512
21578
|
}
|
|
21513
21579
|
|
|
21514
|
-
var importInTheMiddle$2 = {exports: {}};
|
|
21515
|
-
|
|
21516
|
-
var register$5 = {};
|
|
21517
|
-
|
|
21518
|
-
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
|
|
21519
|
-
//
|
|
21520
|
-
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
|
|
21521
|
-
|
|
21522
|
-
const importHooks$5 = []; // TODO should this be a Set?
|
|
21523
|
-
const setters$2 = new WeakMap();
|
|
21524
|
-
const getters$2 = new WeakMap();
|
|
21525
|
-
const specifiers$5 = new Map();
|
|
21526
|
-
const toHook$5 = [];
|
|
21527
|
-
|
|
21528
|
-
const proxyHandler$2 = {
|
|
21529
|
-
set (target, name, value) {
|
|
21530
|
-
return setters$2.get(target)[name](value)
|
|
21531
|
-
},
|
|
21532
|
-
|
|
21533
|
-
get (target, name) {
|
|
21534
|
-
if (name === Symbol.toStringTag) {
|
|
21535
|
-
return 'Module'
|
|
21536
|
-
}
|
|
21537
|
-
|
|
21538
|
-
const getter = getters$2.get(target)[name];
|
|
21539
|
-
|
|
21540
|
-
if (typeof getter === 'function') {
|
|
21541
|
-
return getter()
|
|
21542
|
-
}
|
|
21543
|
-
},
|
|
21544
|
-
|
|
21545
|
-
defineProperty (target, property, descriptor) {
|
|
21546
|
-
if ((!('value' in descriptor))) {
|
|
21547
|
-
throw new Error('Getters/setters are not supported for exports property descriptors.')
|
|
21548
|
-
}
|
|
21549
|
-
|
|
21550
|
-
return setters$2.get(target)[property](descriptor.value)
|
|
21551
|
-
}
|
|
21552
|
-
};
|
|
21553
|
-
|
|
21554
|
-
function register$4 (name, namespace, set, get, specifier) {
|
|
21555
|
-
specifiers$5.set(name, specifier);
|
|
21556
|
-
setters$2.set(namespace, set);
|
|
21557
|
-
getters$2.set(namespace, get);
|
|
21558
|
-
const proxy = new Proxy(namespace, proxyHandler$2);
|
|
21559
|
-
importHooks$5.forEach(hook => hook(name, proxy));
|
|
21560
|
-
toHook$5.push([name, proxy]);
|
|
21561
|
-
}
|
|
21562
|
-
|
|
21563
|
-
let experimentalPatchInternals$2 = false;
|
|
21564
|
-
|
|
21565
|
-
function getExperimentalPatchInternals$5 () {
|
|
21566
|
-
return experimentalPatchInternals$2
|
|
21567
|
-
}
|
|
21568
|
-
|
|
21569
|
-
function setExperimentalPatchInternals$2 (value) {
|
|
21570
|
-
experimentalPatchInternals$2 = value;
|
|
21571
|
-
}
|
|
21572
|
-
|
|
21573
|
-
register$5.register = register$4;
|
|
21574
|
-
register$5.importHooks = importHooks$5;
|
|
21575
|
-
register$5.specifiers = specifiers$5;
|
|
21576
|
-
register$5.toHook = toHook$5;
|
|
21577
|
-
register$5.getExperimentalPatchInternals = getExperimentalPatchInternals$5;
|
|
21578
|
-
register$5.setExperimentalPatchInternals = setExperimentalPatchInternals$2;
|
|
21579
|
-
|
|
21580
|
-
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
|
|
21581
|
-
//
|
|
21582
|
-
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
|
|
21583
|
-
|
|
21584
|
-
const path$2 = path$7;
|
|
21585
|
-
const parse$h = moduleDetailsFromPath$1;
|
|
21586
|
-
const { fileURLToPath: fileURLToPath$2 } = require$$2;
|
|
21587
|
-
const { MessageChannel: MessageChannel$2 } = require$$3;
|
|
21588
|
-
|
|
21589
|
-
const {
|
|
21590
|
-
importHooks: importHooks$4,
|
|
21591
|
-
specifiers: specifiers$4,
|
|
21592
|
-
toHook: toHook$4,
|
|
21593
|
-
getExperimentalPatchInternals: getExperimentalPatchInternals$4
|
|
21594
|
-
} = register$5;
|
|
21595
|
-
|
|
21596
|
-
function addHook$2 (hook) {
|
|
21597
|
-
importHooks$4.push(hook);
|
|
21598
|
-
toHook$4.forEach(([name, namespace]) => hook(name, namespace));
|
|
21599
|
-
}
|
|
21600
|
-
|
|
21601
|
-
function removeHook$2 (hook) {
|
|
21602
|
-
const index = importHooks$4.indexOf(hook);
|
|
21603
|
-
if (index > -1) {
|
|
21604
|
-
importHooks$4.splice(index, 1);
|
|
21605
|
-
}
|
|
21606
|
-
}
|
|
21607
|
-
|
|
21608
|
-
function callHookFn$2 (hookFn, namespace, name, baseDir) {
|
|
21609
|
-
const newDefault = hookFn(namespace, name, baseDir);
|
|
21610
|
-
if (newDefault && newDefault !== namespace) {
|
|
21611
|
-
namespace.default = newDefault;
|
|
21612
|
-
}
|
|
21613
|
-
}
|
|
21614
|
-
|
|
21615
|
-
let sendModulesToLoader$2;
|
|
21616
|
-
|
|
21617
|
-
/**
|
|
21618
|
-
* EXPERIMENTAL
|
|
21619
|
-
* This feature is experimental and may change in minor versions.
|
|
21620
|
-
* **NOTE** This feature is incompatible with the {internals: true} Hook option.
|
|
21621
|
-
*
|
|
21622
|
-
* Creates a message channel with a port that can be used to add hooks to the
|
|
21623
|
-
* list of exclusively included modules.
|
|
21624
|
-
*
|
|
21625
|
-
* This can be used to only wrap modules that are Hook'ed, however modules need
|
|
21626
|
-
* to be hooked before they are imported.
|
|
21627
|
-
*
|
|
21628
|
-
* ```ts
|
|
21629
|
-
* import { register } from 'module'
|
|
21630
|
-
* import { Hook, createAddHookMessageChannel } from 'import-in-the-middle'
|
|
21631
|
-
*
|
|
21632
|
-
* const { registerOptions, waitForAllMessagesAcknowledged } = createAddHookMessageChannel()
|
|
21633
|
-
*
|
|
21634
|
-
* register('import-in-the-middle/hook.mjs', import.meta.url, registerOptions)
|
|
21635
|
-
*
|
|
21636
|
-
* Hook(['fs'], (exported, name, baseDir) => {
|
|
21637
|
-
* // Instrument the fs module
|
|
21638
|
-
* })
|
|
21639
|
-
*
|
|
21640
|
-
* // Ensure that the loader has acknowledged all the modules
|
|
21641
|
-
* // before we allow execution to continue
|
|
21642
|
-
* await waitForAllMessagesAcknowledged()
|
|
21643
|
-
* ```
|
|
21644
|
-
*/
|
|
21645
|
-
function createAddHookMessageChannel$2 () {
|
|
21646
|
-
const { port1, port2 } = new MessageChannel$2();
|
|
21647
|
-
let pendingAckCount = 0;
|
|
21648
|
-
let resolveFn;
|
|
21649
|
-
|
|
21650
|
-
sendModulesToLoader$2 = (modules) => {
|
|
21651
|
-
pendingAckCount++;
|
|
21652
|
-
port1.postMessage(modules);
|
|
21653
|
-
};
|
|
21654
|
-
|
|
21655
|
-
port1.on('message', () => {
|
|
21656
|
-
pendingAckCount--;
|
|
21657
|
-
|
|
21658
|
-
if (resolveFn && pendingAckCount <= 0) {
|
|
21659
|
-
resolveFn();
|
|
21660
|
-
}
|
|
21661
|
-
}).unref();
|
|
21662
|
-
|
|
21663
|
-
function waitForAllMessagesAcknowledged () {
|
|
21664
|
-
// This timer is to prevent the process from exiting with code 13:
|
|
21665
|
-
// 13: Unsettled Top-Level Await.
|
|
21666
|
-
const timer = setInterval(() => { }, 1000);
|
|
21667
|
-
const promise = new Promise((resolve) => {
|
|
21668
|
-
resolveFn = resolve;
|
|
21669
|
-
}).then(() => { clearInterval(timer); });
|
|
21670
|
-
|
|
21671
|
-
if (pendingAckCount === 0) {
|
|
21672
|
-
resolveFn();
|
|
21673
|
-
}
|
|
21674
|
-
|
|
21675
|
-
return promise
|
|
21676
|
-
}
|
|
21677
|
-
|
|
21678
|
-
const addHookMessagePort = port2;
|
|
21679
|
-
const registerOptions = { data: { addHookMessagePort, include: [] }, transferList: [addHookMessagePort] };
|
|
21680
|
-
|
|
21681
|
-
return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged }
|
|
21682
|
-
}
|
|
21683
|
-
|
|
21684
|
-
function Hook$2 (modules, options, hookFn) {
|
|
21685
|
-
if ((this instanceof Hook$2) === false) return new Hook$2(modules, options, hookFn)
|
|
21686
|
-
if (typeof modules === 'function') {
|
|
21687
|
-
hookFn = modules;
|
|
21688
|
-
modules = null;
|
|
21689
|
-
options = null;
|
|
21690
|
-
} else if (typeof options === 'function') {
|
|
21691
|
-
hookFn = options;
|
|
21692
|
-
options = null;
|
|
21693
|
-
}
|
|
21694
|
-
const internals = options ? options.internals === true : false;
|
|
21695
|
-
|
|
21696
|
-
if (sendModulesToLoader$2 && Array.isArray(modules)) {
|
|
21697
|
-
sendModulesToLoader$2(modules);
|
|
21698
|
-
}
|
|
21699
|
-
|
|
21700
|
-
this._iitmHook = (name, namespace) => {
|
|
21701
|
-
const filename = name;
|
|
21702
|
-
const isBuiltin = name.startsWith('node:');
|
|
21703
|
-
let baseDir;
|
|
21704
|
-
|
|
21705
|
-
if (isBuiltin) {
|
|
21706
|
-
name = name.replace(/^node:/, '');
|
|
21707
|
-
} else {
|
|
21708
|
-
if (name.startsWith('file://')) {
|
|
21709
|
-
try {
|
|
21710
|
-
name = fileURLToPath$2(name);
|
|
21711
|
-
} catch (e) {}
|
|
21712
|
-
}
|
|
21713
|
-
const details = parse$h(name);
|
|
21714
|
-
if (details) {
|
|
21715
|
-
name = details.name;
|
|
21716
|
-
baseDir = details.basedir;
|
|
21717
|
-
}
|
|
21718
|
-
}
|
|
21719
|
-
|
|
21720
|
-
if (modules) {
|
|
21721
|
-
for (const moduleName of modules) {
|
|
21722
|
-
if (moduleName === name) {
|
|
21723
|
-
if (baseDir) {
|
|
21724
|
-
if (internals) {
|
|
21725
|
-
name = name + path$2.sep + path$2.relative(baseDir, fileURLToPath$2(filename));
|
|
21726
|
-
} else {
|
|
21727
|
-
if (!getExperimentalPatchInternals$4() && !baseDir.endsWith(specifiers$4.get(filename))) continue
|
|
21728
|
-
}
|
|
21729
|
-
}
|
|
21730
|
-
callHookFn$2(hookFn, namespace, name, baseDir);
|
|
21731
|
-
}
|
|
21732
|
-
}
|
|
21733
|
-
} else {
|
|
21734
|
-
callHookFn$2(hookFn, namespace, name, baseDir);
|
|
21735
|
-
}
|
|
21736
|
-
};
|
|
21737
|
-
|
|
21738
|
-
addHook$2(this._iitmHook);
|
|
21739
|
-
}
|
|
21740
|
-
|
|
21741
|
-
Hook$2.prototype.unhook = function () {
|
|
21742
|
-
removeHook$2(this._iitmHook);
|
|
21743
|
-
};
|
|
21744
|
-
|
|
21745
|
-
importInTheMiddle$2.exports = Hook$2;
|
|
21746
|
-
var Hook_1$2 = importInTheMiddle$2.exports.Hook = Hook$2;
|
|
21747
|
-
importInTheMiddle$2.exports.addHook = addHook$2;
|
|
21748
|
-
importInTheMiddle$2.exports.removeHook = removeHook$2;
|
|
21749
|
-
importInTheMiddle$2.exports.createAddHookMessageChannel = createAddHookMessageChannel$2;
|
|
21750
|
-
|
|
21751
21580
|
/*
|
|
21752
21581
|
* Copyright The OpenTelemetry Authors
|
|
21753
21582
|
*
|
|
@@ -22104,10 +21933,10 @@ var InstrumentationBase$2 = /** @class */ (function (_super) {
|
|
|
22104
21933
|
// For an absolute paths, we must create a separate instance of the
|
|
22105
21934
|
// require-in-the-middle `Hook`.
|
|
22106
21935
|
var hook = path__namespace.isAbsolute(module_2.name)
|
|
22107
|
-
? new Hook_1$
|
|
21936
|
+
? new Hook_1$1([module_2.name], { internals: true }, onRequire)
|
|
22108
21937
|
: this_1._requireInTheMiddleSingleton.register(module_2.name, onRequire);
|
|
22109
21938
|
this_1._hooks.push(hook);
|
|
22110
|
-
var esmHook = new Hook_1
|
|
21939
|
+
var esmHook = new Hook_1([module_2.name], { internals: false }, hookFn);
|
|
22111
21940
|
this_1._hooks.push(esmHook);
|
|
22112
21941
|
};
|
|
22113
21942
|
var this_1 = this;
|
|
@@ -22220,7 +22049,7 @@ var _globalThis$2 = typeof globalThis === 'object' ? globalThis : global;
|
|
|
22220
22049
|
* See the License for the specific language governing permissions and
|
|
22221
22050
|
* limitations under the License.
|
|
22222
22051
|
*/
|
|
22223
|
-
var otperformance$
|
|
22052
|
+
var otperformance$2 = perf_hooks$2.performance;
|
|
22224
22053
|
|
|
22225
22054
|
/*
|
|
22226
22055
|
* Copyright The OpenTelemetry Authors
|
|
@@ -22237,50 +22066,50 @@ var otperformance$1 = perf_hooks$2.performance;
|
|
|
22237
22066
|
* See the License for the specific language governing permissions and
|
|
22238
22067
|
* limitations under the License.
|
|
22239
22068
|
*/
|
|
22240
|
-
var TMP_HTTP_METHOD
|
|
22241
|
-
var TMP_HTTP_URL
|
|
22242
|
-
var TMP_HTTP_HOST
|
|
22243
|
-
var TMP_HTTP_SCHEME
|
|
22244
|
-
var TMP_HTTP_STATUS_CODE
|
|
22245
|
-
var TMP_HTTP_USER_AGENT
|
|
22246
|
-
var TMP_HTTP_RESPONSE_CONTENT_LENGTH
|
|
22247
|
-
var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED
|
|
22069
|
+
var TMP_HTTP_METHOD = 'http.method';
|
|
22070
|
+
var TMP_HTTP_URL = 'http.url';
|
|
22071
|
+
var TMP_HTTP_HOST = 'http.host';
|
|
22072
|
+
var TMP_HTTP_SCHEME = 'http.scheme';
|
|
22073
|
+
var TMP_HTTP_STATUS_CODE = 'http.status_code';
|
|
22074
|
+
var TMP_HTTP_USER_AGENT = 'http.user_agent';
|
|
22075
|
+
var TMP_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length';
|
|
22076
|
+
var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed';
|
|
22248
22077
|
/**
|
|
22249
22078
|
* HTTP request method.
|
|
22250
22079
|
*/
|
|
22251
|
-
var SEMATTRS_HTTP_METHOD
|
|
22080
|
+
var SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD;
|
|
22252
22081
|
/**
|
|
22253
22082
|
* Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
|
|
22254
22083
|
*
|
|
22255
22084
|
* Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`.
|
|
22256
22085
|
*/
|
|
22257
|
-
var SEMATTRS_HTTP_URL
|
|
22086
|
+
var SEMATTRS_HTTP_URL = TMP_HTTP_URL;
|
|
22258
22087
|
/**
|
|
22259
22088
|
* The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note.
|
|
22260
22089
|
*
|
|
22261
22090
|
* Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set.
|
|
22262
22091
|
*/
|
|
22263
|
-
var SEMATTRS_HTTP_HOST
|
|
22092
|
+
var SEMATTRS_HTTP_HOST = TMP_HTTP_HOST;
|
|
22264
22093
|
/**
|
|
22265
22094
|
* The URI scheme identifying the used protocol.
|
|
22266
22095
|
*/
|
|
22267
|
-
var SEMATTRS_HTTP_SCHEME
|
|
22096
|
+
var SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME;
|
|
22268
22097
|
/**
|
|
22269
22098
|
* [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
|
|
22270
22099
|
*/
|
|
22271
|
-
var SEMATTRS_HTTP_STATUS_CODE
|
|
22100
|
+
var SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE;
|
|
22272
22101
|
/**
|
|
22273
22102
|
* Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.
|
|
22274
22103
|
*/
|
|
22275
|
-
var SEMATTRS_HTTP_USER_AGENT
|
|
22104
|
+
var SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT;
|
|
22276
22105
|
/**
|
|
22277
22106
|
* The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.
|
|
22278
22107
|
*/
|
|
22279
|
-
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH
|
|
22108
|
+
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH;
|
|
22280
22109
|
/**
|
|
22281
22110
|
* The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.
|
|
22282
22111
|
*/
|
|
22283
|
-
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED
|
|
22112
|
+
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED;
|
|
22284
22113
|
|
|
22285
22114
|
/*
|
|
22286
22115
|
* Copyright The OpenTelemetry Authors
|
|
@@ -22297,26 +22126,26 @@ var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1 = TMP_HTTP_RESPONSE_CON
|
|
|
22297
22126
|
* See the License for the specific language governing permissions and
|
|
22298
22127
|
* limitations under the License.
|
|
22299
22128
|
*/
|
|
22300
|
-
var NANOSECOND_DIGITS$
|
|
22301
|
-
var NANOSECOND_DIGITS_IN_MILLIS$
|
|
22302
|
-
var MILLISECONDS_TO_NANOSECONDS$
|
|
22303
|
-
var SECOND_TO_NANOSECONDS$
|
|
22129
|
+
var NANOSECOND_DIGITS$2 = 9;
|
|
22130
|
+
var NANOSECOND_DIGITS_IN_MILLIS$2 = 6;
|
|
22131
|
+
var MILLISECONDS_TO_NANOSECONDS$2 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS$2);
|
|
22132
|
+
var SECOND_TO_NANOSECONDS$2 = Math.pow(10, NANOSECOND_DIGITS$2);
|
|
22304
22133
|
/**
|
|
22305
22134
|
* Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).
|
|
22306
22135
|
* @param epochMillis
|
|
22307
22136
|
*/
|
|
22308
|
-
function millisToHrTime$
|
|
22137
|
+
function millisToHrTime$2(epochMillis) {
|
|
22309
22138
|
var epochSeconds = epochMillis / 1000;
|
|
22310
22139
|
// Decimals only.
|
|
22311
22140
|
var seconds = Math.trunc(epochSeconds);
|
|
22312
22141
|
// Round sub-nanosecond accuracy to nanosecond.
|
|
22313
|
-
var nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS$
|
|
22142
|
+
var nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS$2);
|
|
22314
22143
|
return [seconds, nanos];
|
|
22315
22144
|
}
|
|
22316
|
-
function getTimeOrigin$
|
|
22317
|
-
var timeOrigin = otperformance$
|
|
22145
|
+
function getTimeOrigin$2() {
|
|
22146
|
+
var timeOrigin = otperformance$2.timeOrigin;
|
|
22318
22147
|
if (typeof timeOrigin !== 'number') {
|
|
22319
|
-
var perf = otperformance$
|
|
22148
|
+
var perf = otperformance$2;
|
|
22320
22149
|
timeOrigin = perf.timing && perf.timing.fetchStart;
|
|
22321
22150
|
}
|
|
22322
22151
|
return timeOrigin;
|
|
@@ -22325,10 +22154,10 @@ function getTimeOrigin$1() {
|
|
|
22325
22154
|
* Returns an hrtime calculated via performance component.
|
|
22326
22155
|
* @param performanceNow
|
|
22327
22156
|
*/
|
|
22328
|
-
function hrTime$
|
|
22329
|
-
var timeOrigin = millisToHrTime$
|
|
22330
|
-
var now = millisToHrTime$
|
|
22331
|
-
return addHrTimes$
|
|
22157
|
+
function hrTime$2(performanceNow) {
|
|
22158
|
+
var timeOrigin = millisToHrTime$2(getTimeOrigin$2());
|
|
22159
|
+
var now = millisToHrTime$2(typeof performanceNow === 'number' ? performanceNow : otperformance$2.now());
|
|
22160
|
+
return addHrTimes$2(timeOrigin, now);
|
|
22332
22161
|
}
|
|
22333
22162
|
/**
|
|
22334
22163
|
*
|
|
@@ -22342,16 +22171,16 @@ function timeInputToHrTime$1(time) {
|
|
|
22342
22171
|
}
|
|
22343
22172
|
else if (typeof time === 'number') {
|
|
22344
22173
|
// Must be a performance.now() if it's smaller than process start time.
|
|
22345
|
-
if (time < getTimeOrigin$
|
|
22346
|
-
return hrTime$
|
|
22174
|
+
if (time < getTimeOrigin$2()) {
|
|
22175
|
+
return hrTime$2(time);
|
|
22347
22176
|
}
|
|
22348
22177
|
else {
|
|
22349
22178
|
// epoch milliseconds or performance.timeOrigin
|
|
22350
|
-
return millisToHrTime$
|
|
22179
|
+
return millisToHrTime$2(time);
|
|
22351
22180
|
}
|
|
22352
22181
|
}
|
|
22353
22182
|
else if (time instanceof Date) {
|
|
22354
|
-
return millisToHrTime$
|
|
22183
|
+
return millisToHrTime$2(time.getTime());
|
|
22355
22184
|
}
|
|
22356
22185
|
else {
|
|
22357
22186
|
throw TypeError('Invalid input type');
|
|
@@ -22362,7 +22191,7 @@ function timeInputToHrTime$1(time) {
|
|
|
22362
22191
|
* @param time
|
|
22363
22192
|
*/
|
|
22364
22193
|
function hrTimeToNanoseconds$1(time) {
|
|
22365
|
-
return time[0] * SECOND_TO_NANOSECONDS$
|
|
22194
|
+
return time[0] * SECOND_TO_NANOSECONDS$2 + time[1];
|
|
22366
22195
|
}
|
|
22367
22196
|
/**
|
|
22368
22197
|
* check if time is HrTime
|
|
@@ -22377,11 +22206,11 @@ function isTimeInputHrTime$1(value) {
|
|
|
22377
22206
|
/**
|
|
22378
22207
|
* Given 2 HrTime formatted times, return their sum as an HrTime.
|
|
22379
22208
|
*/
|
|
22380
|
-
function addHrTimes$
|
|
22209
|
+
function addHrTimes$2(time1, time2) {
|
|
22381
22210
|
var out = [time1[0] + time2[0], time1[1] + time2[1]];
|
|
22382
22211
|
// Nanoseconds
|
|
22383
|
-
if (out[1] >= SECOND_TO_NANOSECONDS$
|
|
22384
|
-
out[1] -= SECOND_TO_NANOSECONDS$
|
|
22212
|
+
if (out[1] >= SECOND_TO_NANOSECONDS$2) {
|
|
22213
|
+
out[1] -= SECOND_TO_NANOSECONDS$2;
|
|
22385
22214
|
out[0] += 1;
|
|
22386
22215
|
}
|
|
22387
22216
|
return out;
|
|
@@ -22568,12 +22397,12 @@ function addSpanNetworkEvents$1(span, resource) {
|
|
|
22568
22397
|
addSpanNetworkEvent$1(span, PerformanceTimingNames$1.RESPONSE_END, resource);
|
|
22569
22398
|
var encodedLength = resource[PerformanceTimingNames$1.ENCODED_BODY_SIZE];
|
|
22570
22399
|
if (encodedLength !== undefined) {
|
|
22571
|
-
span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH
|
|
22400
|
+
span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH, encodedLength);
|
|
22572
22401
|
}
|
|
22573
22402
|
var decodedLength = resource[PerformanceTimingNames$1.DECODED_BODY_SIZE];
|
|
22574
22403
|
// Spec: Not set if transport encoding not used (in which case encoded and decoded sizes match)
|
|
22575
22404
|
if (decodedLength !== undefined && encodedLength !== decodedLength) {
|
|
22576
|
-
span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED
|
|
22405
|
+
span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, decodedLength);
|
|
22577
22406
|
}
|
|
22578
22407
|
}
|
|
22579
22408
|
/**
|
|
@@ -22852,14 +22681,14 @@ var FetchInstrumentation = /** @class */ (function (_super) {
|
|
|
22852
22681
|
*/
|
|
22853
22682
|
FetchInstrumentation.prototype._addFinalSpanAttributes = function (span, response) {
|
|
22854
22683
|
var parsedUrl = parseUrl$1(response.url);
|
|
22855
|
-
span.setAttribute(SEMATTRS_HTTP_STATUS_CODE
|
|
22684
|
+
span.setAttribute(SEMATTRS_HTTP_STATUS_CODE, response.status);
|
|
22856
22685
|
if (response.statusText != null) {
|
|
22857
22686
|
span.setAttribute(AttributeNames$2.HTTP_STATUS_TEXT, response.statusText);
|
|
22858
22687
|
}
|
|
22859
|
-
span.setAttribute(SEMATTRS_HTTP_HOST
|
|
22860
|
-
span.setAttribute(SEMATTRS_HTTP_SCHEME
|
|
22688
|
+
span.setAttribute(SEMATTRS_HTTP_HOST, parsedUrl.host);
|
|
22689
|
+
span.setAttribute(SEMATTRS_HTTP_SCHEME, parsedUrl.protocol.replace(':', ''));
|
|
22861
22690
|
if (typeof navigator !== 'undefined') {
|
|
22862
|
-
span.setAttribute(SEMATTRS_HTTP_USER_AGENT
|
|
22691
|
+
span.setAttribute(SEMATTRS_HTTP_USER_AGENT, navigator.userAgent);
|
|
22863
22692
|
}
|
|
22864
22693
|
};
|
|
22865
22694
|
/**
|
|
@@ -22927,8 +22756,8 @@ var FetchInstrumentation = /** @class */ (function (_super) {
|
|
|
22927
22756
|
kind: SpanKind.CLIENT,
|
|
22928
22757
|
attributes: (_a = {},
|
|
22929
22758
|
_a[AttributeNames$2.COMPONENT] = this.moduleName,
|
|
22930
|
-
_a[SEMATTRS_HTTP_METHOD
|
|
22931
|
-
_a[SEMATTRS_HTTP_URL
|
|
22759
|
+
_a[SEMATTRS_HTTP_METHOD] = method,
|
|
22760
|
+
_a[SEMATTRS_HTTP_URL] = url,
|
|
22932
22761
|
_a),
|
|
22933
22762
|
});
|
|
22934
22763
|
};
|
|
@@ -22980,8 +22809,8 @@ var FetchInstrumentation = /** @class */ (function (_super) {
|
|
|
22980
22809
|
*/
|
|
22981
22810
|
FetchInstrumentation.prototype._endSpan = function (span, spanData, response) {
|
|
22982
22811
|
var _this = this;
|
|
22983
|
-
var endTime = millisToHrTime$
|
|
22984
|
-
var performanceEndTime = hrTime$
|
|
22812
|
+
var endTime = millisToHrTime$2(Date.now());
|
|
22813
|
+
var performanceEndTime = hrTime$2();
|
|
22985
22814
|
this._addFinalSpanAttributes(span, response);
|
|
22986
22815
|
setTimeout(function () {
|
|
22987
22816
|
var _a;
|
|
@@ -23104,7 +22933,7 @@ var FetchInstrumentation = /** @class */ (function (_super) {
|
|
|
23104
22933
|
* @param spanUrl
|
|
23105
22934
|
*/
|
|
23106
22935
|
FetchInstrumentation.prototype._prepareSpanData = function (spanUrl) {
|
|
23107
|
-
var startTime = hrTime$
|
|
22936
|
+
var startTime = hrTime$2();
|
|
23108
22937
|
var entries = [];
|
|
23109
22938
|
if (typeof PerformanceObserver !== 'function') {
|
|
23110
22939
|
return { entries: entries, startTime: startTime, spanUrl: spanUrl };
|
|
@@ -23962,7 +23791,7 @@ let SemVer$r = class SemVer {
|
|
|
23962
23791
|
var semver$3 = SemVer$r;
|
|
23963
23792
|
|
|
23964
23793
|
const SemVer$q = semver$3;
|
|
23965
|
-
const parse$
|
|
23794
|
+
const parse$e = (version, options, throwErrors = false) => {
|
|
23966
23795
|
if (version instanceof SemVer$q) {
|
|
23967
23796
|
return version
|
|
23968
23797
|
}
|
|
@@ -23976,18 +23805,18 @@ const parse$g = (version, options, throwErrors = false) => {
|
|
|
23976
23805
|
}
|
|
23977
23806
|
};
|
|
23978
23807
|
|
|
23979
|
-
var parse_1$1 = parse$
|
|
23808
|
+
var parse_1$1 = parse$e;
|
|
23980
23809
|
|
|
23981
|
-
const parse$
|
|
23810
|
+
const parse$d = parse_1$1;
|
|
23982
23811
|
const valid$5 = (version, options) => {
|
|
23983
|
-
const v = parse$
|
|
23812
|
+
const v = parse$d(version, options);
|
|
23984
23813
|
return v ? v.version : null
|
|
23985
23814
|
};
|
|
23986
23815
|
var valid_1$1 = valid$5;
|
|
23987
23816
|
|
|
23988
|
-
const parse$
|
|
23817
|
+
const parse$c = parse_1$1;
|
|
23989
23818
|
const clean$3 = (version, options) => {
|
|
23990
|
-
const s = parse$
|
|
23819
|
+
const s = parse$c(version.trim().replace(/^[=v]+/, ''), options);
|
|
23991
23820
|
return s ? s.version : null
|
|
23992
23821
|
};
|
|
23993
23822
|
var clean_1$1 = clean$3;
|
|
@@ -24012,11 +23841,11 @@ const inc$3 = (version, release, options, identifier, identifierBase) => {
|
|
|
24012
23841
|
};
|
|
24013
23842
|
var inc_1$1 = inc$3;
|
|
24014
23843
|
|
|
24015
|
-
const parse$
|
|
23844
|
+
const parse$b = parse_1$1;
|
|
24016
23845
|
|
|
24017
23846
|
const diff$3 = (version1, version2) => {
|
|
24018
|
-
const v1 = parse$
|
|
24019
|
-
const v2 = parse$
|
|
23847
|
+
const v1 = parse$b(version1, null, true);
|
|
23848
|
+
const v2 = parse$b(version2, null, true);
|
|
24020
23849
|
const comparison = v1.compare(v2);
|
|
24021
23850
|
|
|
24022
23851
|
if (comparison === 0) {
|
|
@@ -24083,9 +23912,9 @@ const SemVer$m = semver$3;
|
|
|
24083
23912
|
const patch$3 = (a, loose) => new SemVer$m(a, loose).patch;
|
|
24084
23913
|
var patch_1$1 = patch$3;
|
|
24085
23914
|
|
|
24086
|
-
const parse$
|
|
23915
|
+
const parse$a = parse_1$1;
|
|
24087
23916
|
const prerelease$3 = (version, options) => {
|
|
24088
|
-
const parsed = parse$
|
|
23917
|
+
const parsed = parse$a(version, options);
|
|
24089
23918
|
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
|
24090
23919
|
};
|
|
24091
23920
|
var prerelease_1$1 = prerelease$3;
|
|
@@ -24198,7 +24027,7 @@ const cmp$3 = (a, op, b, loose) => {
|
|
|
24198
24027
|
var cmp_1$1 = cmp$3;
|
|
24199
24028
|
|
|
24200
24029
|
const SemVer$j = semver$3;
|
|
24201
|
-
const parse$
|
|
24030
|
+
const parse$9 = parse_1$1;
|
|
24202
24031
|
const { safeRe: re$3, t: t$2 } = reExports$1;
|
|
24203
24032
|
|
|
24204
24033
|
const coerce$3 = (version, options) => {
|
|
@@ -24254,50 +24083,59 @@ const coerce$3 = (version, options) => {
|
|
|
24254
24083
|
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
|
|
24255
24084
|
const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
|
|
24256
24085
|
|
|
24257
|
-
return parse$
|
|
24086
|
+
return parse$9(`${major}.${minor}.${patch}${prerelease}${build}`, options)
|
|
24258
24087
|
};
|
|
24259
24088
|
var coerce_1$1 = coerce$3;
|
|
24260
24089
|
|
|
24261
|
-
|
|
24262
|
-
|
|
24263
|
-
this.max = 1000;
|
|
24264
|
-
this.map = new Map();
|
|
24265
|
-
}
|
|
24090
|
+
var lrucache$1;
|
|
24091
|
+
var hasRequiredLrucache;
|
|
24266
24092
|
|
|
24267
|
-
|
|
24268
|
-
|
|
24269
|
-
|
|
24270
|
-
return undefined
|
|
24271
|
-
} else {
|
|
24272
|
-
// Remove the key from the map and add it to the end
|
|
24273
|
-
this.map.delete(key);
|
|
24274
|
-
this.map.set(key, value);
|
|
24275
|
-
return value
|
|
24276
|
-
}
|
|
24277
|
-
}
|
|
24093
|
+
function requireLrucache () {
|
|
24094
|
+
if (hasRequiredLrucache) return lrucache$1;
|
|
24095
|
+
hasRequiredLrucache = 1;
|
|
24278
24096
|
|
|
24279
|
-
|
|
24280
|
-
|
|
24281
|
-
|
|
24097
|
+
class LRUCache {
|
|
24098
|
+
constructor () {
|
|
24099
|
+
this.max = 1000;
|
|
24100
|
+
this.map = new Map();
|
|
24101
|
+
}
|
|
24282
24102
|
|
|
24283
|
-
|
|
24284
|
-
|
|
24103
|
+
get (key) {
|
|
24104
|
+
const value = this.map.get(key);
|
|
24105
|
+
if (value === undefined) {
|
|
24106
|
+
return undefined
|
|
24107
|
+
} else {
|
|
24108
|
+
// Remove the key from the map and add it to the end
|
|
24109
|
+
this.map.delete(key);
|
|
24110
|
+
this.map.set(key, value);
|
|
24111
|
+
return value
|
|
24112
|
+
}
|
|
24113
|
+
}
|
|
24285
24114
|
|
|
24286
|
-
|
|
24287
|
-
|
|
24288
|
-
|
|
24289
|
-
const firstKey = this.map.keys().next().value;
|
|
24290
|
-
this.delete(firstKey);
|
|
24291
|
-
}
|
|
24115
|
+
delete (key) {
|
|
24116
|
+
return this.map.delete(key)
|
|
24117
|
+
}
|
|
24292
24118
|
|
|
24293
|
-
|
|
24294
|
-
|
|
24119
|
+
set (key, value) {
|
|
24120
|
+
const deleted = this.delete(key);
|
|
24295
24121
|
|
|
24296
|
-
|
|
24297
|
-
|
|
24298
|
-
|
|
24122
|
+
if (!deleted && value !== undefined) {
|
|
24123
|
+
// If cache is full, delete the least recently used item
|
|
24124
|
+
if (this.map.size >= this.max) {
|
|
24125
|
+
const firstKey = this.map.keys().next().value;
|
|
24126
|
+
this.delete(firstKey);
|
|
24127
|
+
}
|
|
24128
|
+
|
|
24129
|
+
this.map.set(key, value);
|
|
24130
|
+
}
|
|
24131
|
+
|
|
24132
|
+
return this
|
|
24133
|
+
}
|
|
24134
|
+
}
|
|
24299
24135
|
|
|
24300
|
-
|
|
24136
|
+
lrucache$1 = LRUCache;
|
|
24137
|
+
return lrucache$1;
|
|
24138
|
+
}
|
|
24301
24139
|
|
|
24302
24140
|
var range$1;
|
|
24303
24141
|
var hasRequiredRange$1;
|
|
@@ -24520,7 +24358,7 @@ function requireRange$1 () {
|
|
|
24520
24358
|
|
|
24521
24359
|
range$1 = Range;
|
|
24522
24360
|
|
|
24523
|
-
const LRU =
|
|
24361
|
+
const LRU = requireLrucache();
|
|
24524
24362
|
const cache = new LRU();
|
|
24525
24363
|
|
|
24526
24364
|
const parseOptions = parseOptions_1$1;
|
|
@@ -25559,7 +25397,7 @@ const internalRe$1 = reExports$1;
|
|
|
25559
25397
|
const constants$2 = constants$3;
|
|
25560
25398
|
const SemVer$e = semver$3;
|
|
25561
25399
|
const identifiers$2 = identifiers$3;
|
|
25562
|
-
const parse$
|
|
25400
|
+
const parse$8 = parse_1$1;
|
|
25563
25401
|
const valid$3 = valid_1$1;
|
|
25564
25402
|
const clean$2 = clean_1$1;
|
|
25565
25403
|
const inc$2 = inc_1$1;
|
|
@@ -25597,7 +25435,7 @@ const intersects$2 = intersects_1$1;
|
|
|
25597
25435
|
const simplifyRange$1 = simplify$1;
|
|
25598
25436
|
const subset$2 = subset_1$1;
|
|
25599
25437
|
var semver$2 = {
|
|
25600
|
-
parse: parse$
|
|
25438
|
+
parse: parse$8,
|
|
25601
25439
|
valid: valid$3,
|
|
25602
25440
|
clean: clean$2,
|
|
25603
25441
|
inc: inc$2,
|
|
@@ -26011,7 +25849,7 @@ var RequireInTheMiddleSingleton$1 = /** @class */ (function () {
|
|
|
26011
25849
|
}
|
|
26012
25850
|
RequireInTheMiddleSingleton.prototype._initialize = function () {
|
|
26013
25851
|
var _this = this;
|
|
26014
|
-
new Hook_1$
|
|
25852
|
+
new Hook_1$1(
|
|
26015
25853
|
// Intercept all `require` calls; we will filter the matching ones below
|
|
26016
25854
|
null, { internals: true }, function (exports, name, basedir) {
|
|
26017
25855
|
var e_1, _a;
|
|
@@ -26080,243 +25918,6 @@ function normalizePathSeparators$1(moduleNameOrPath) {
|
|
|
26080
25918
|
: moduleNameOrPath;
|
|
26081
25919
|
}
|
|
26082
25920
|
|
|
26083
|
-
var importInTheMiddle$1 = {exports: {}};
|
|
26084
|
-
|
|
26085
|
-
var register$3 = {};
|
|
26086
|
-
|
|
26087
|
-
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
|
|
26088
|
-
//
|
|
26089
|
-
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
|
|
26090
|
-
|
|
26091
|
-
const importHooks$3 = []; // TODO should this be a Set?
|
|
26092
|
-
const setters$1 = new WeakMap();
|
|
26093
|
-
const getters$1 = new WeakMap();
|
|
26094
|
-
const specifiers$3 = new Map();
|
|
26095
|
-
const toHook$3 = [];
|
|
26096
|
-
|
|
26097
|
-
const proxyHandler$1 = {
|
|
26098
|
-
set (target, name, value) {
|
|
26099
|
-
return setters$1.get(target)[name](value)
|
|
26100
|
-
},
|
|
26101
|
-
|
|
26102
|
-
get (target, name) {
|
|
26103
|
-
if (name === Symbol.toStringTag) {
|
|
26104
|
-
return 'Module'
|
|
26105
|
-
}
|
|
26106
|
-
|
|
26107
|
-
const getter = getters$1.get(target)[name];
|
|
26108
|
-
|
|
26109
|
-
if (typeof getter === 'function') {
|
|
26110
|
-
return getter()
|
|
26111
|
-
}
|
|
26112
|
-
},
|
|
26113
|
-
|
|
26114
|
-
defineProperty (target, property, descriptor) {
|
|
26115
|
-
if ((!('value' in descriptor))) {
|
|
26116
|
-
throw new Error('Getters/setters are not supported for exports property descriptors.')
|
|
26117
|
-
}
|
|
26118
|
-
|
|
26119
|
-
return setters$1.get(target)[property](descriptor.value)
|
|
26120
|
-
}
|
|
26121
|
-
};
|
|
26122
|
-
|
|
26123
|
-
function register$2 (name, namespace, set, get, specifier) {
|
|
26124
|
-
specifiers$3.set(name, specifier);
|
|
26125
|
-
setters$1.set(namespace, set);
|
|
26126
|
-
getters$1.set(namespace, get);
|
|
26127
|
-
const proxy = new Proxy(namespace, proxyHandler$1);
|
|
26128
|
-
importHooks$3.forEach(hook => hook(name, proxy));
|
|
26129
|
-
toHook$3.push([name, proxy]);
|
|
26130
|
-
}
|
|
26131
|
-
|
|
26132
|
-
let experimentalPatchInternals$1 = false;
|
|
26133
|
-
|
|
26134
|
-
function getExperimentalPatchInternals$3 () {
|
|
26135
|
-
return experimentalPatchInternals$1
|
|
26136
|
-
}
|
|
26137
|
-
|
|
26138
|
-
function setExperimentalPatchInternals$1 (value) {
|
|
26139
|
-
experimentalPatchInternals$1 = value;
|
|
26140
|
-
}
|
|
26141
|
-
|
|
26142
|
-
register$3.register = register$2;
|
|
26143
|
-
register$3.importHooks = importHooks$3;
|
|
26144
|
-
register$3.specifiers = specifiers$3;
|
|
26145
|
-
register$3.toHook = toHook$3;
|
|
26146
|
-
register$3.getExperimentalPatchInternals = getExperimentalPatchInternals$3;
|
|
26147
|
-
register$3.setExperimentalPatchInternals = setExperimentalPatchInternals$1;
|
|
26148
|
-
|
|
26149
|
-
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
|
|
26150
|
-
//
|
|
26151
|
-
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
|
|
26152
|
-
|
|
26153
|
-
const path$1 = path$7;
|
|
26154
|
-
const parse$9 = moduleDetailsFromPath$1;
|
|
26155
|
-
const { fileURLToPath: fileURLToPath$1 } = require$$2;
|
|
26156
|
-
const { MessageChannel: MessageChannel$1 } = require$$3;
|
|
26157
|
-
|
|
26158
|
-
const {
|
|
26159
|
-
importHooks: importHooks$2,
|
|
26160
|
-
specifiers: specifiers$2,
|
|
26161
|
-
toHook: toHook$2,
|
|
26162
|
-
getExperimentalPatchInternals: getExperimentalPatchInternals$2
|
|
26163
|
-
} = register$3;
|
|
26164
|
-
|
|
26165
|
-
function addHook$1 (hook) {
|
|
26166
|
-
importHooks$2.push(hook);
|
|
26167
|
-
toHook$2.forEach(([name, namespace]) => hook(name, namespace));
|
|
26168
|
-
}
|
|
26169
|
-
|
|
26170
|
-
function removeHook$1 (hook) {
|
|
26171
|
-
const index = importHooks$2.indexOf(hook);
|
|
26172
|
-
if (index > -1) {
|
|
26173
|
-
importHooks$2.splice(index, 1);
|
|
26174
|
-
}
|
|
26175
|
-
}
|
|
26176
|
-
|
|
26177
|
-
function callHookFn$1 (hookFn, namespace, name, baseDir) {
|
|
26178
|
-
const newDefault = hookFn(namespace, name, baseDir);
|
|
26179
|
-
if (newDefault && newDefault !== namespace) {
|
|
26180
|
-
namespace.default = newDefault;
|
|
26181
|
-
}
|
|
26182
|
-
}
|
|
26183
|
-
|
|
26184
|
-
let sendModulesToLoader$1;
|
|
26185
|
-
|
|
26186
|
-
/**
|
|
26187
|
-
* EXPERIMENTAL
|
|
26188
|
-
* This feature is experimental and may change in minor versions.
|
|
26189
|
-
* **NOTE** This feature is incompatible with the {internals: true} Hook option.
|
|
26190
|
-
*
|
|
26191
|
-
* Creates a message channel with a port that can be used to add hooks to the
|
|
26192
|
-
* list of exclusively included modules.
|
|
26193
|
-
*
|
|
26194
|
-
* This can be used to only wrap modules that are Hook'ed, however modules need
|
|
26195
|
-
* to be hooked before they are imported.
|
|
26196
|
-
*
|
|
26197
|
-
* ```ts
|
|
26198
|
-
* import { register } from 'module'
|
|
26199
|
-
* import { Hook, createAddHookMessageChannel } from 'import-in-the-middle'
|
|
26200
|
-
*
|
|
26201
|
-
* const { registerOptions, waitForAllMessagesAcknowledged } = createAddHookMessageChannel()
|
|
26202
|
-
*
|
|
26203
|
-
* register('import-in-the-middle/hook.mjs', import.meta.url, registerOptions)
|
|
26204
|
-
*
|
|
26205
|
-
* Hook(['fs'], (exported, name, baseDir) => {
|
|
26206
|
-
* // Instrument the fs module
|
|
26207
|
-
* })
|
|
26208
|
-
*
|
|
26209
|
-
* // Ensure that the loader has acknowledged all the modules
|
|
26210
|
-
* // before we allow execution to continue
|
|
26211
|
-
* await waitForAllMessagesAcknowledged()
|
|
26212
|
-
* ```
|
|
26213
|
-
*/
|
|
26214
|
-
function createAddHookMessageChannel$1 () {
|
|
26215
|
-
const { port1, port2 } = new MessageChannel$1();
|
|
26216
|
-
let pendingAckCount = 0;
|
|
26217
|
-
let resolveFn;
|
|
26218
|
-
|
|
26219
|
-
sendModulesToLoader$1 = (modules) => {
|
|
26220
|
-
pendingAckCount++;
|
|
26221
|
-
port1.postMessage(modules);
|
|
26222
|
-
};
|
|
26223
|
-
|
|
26224
|
-
port1.on('message', () => {
|
|
26225
|
-
pendingAckCount--;
|
|
26226
|
-
|
|
26227
|
-
if (resolveFn && pendingAckCount <= 0) {
|
|
26228
|
-
resolveFn();
|
|
26229
|
-
}
|
|
26230
|
-
}).unref();
|
|
26231
|
-
|
|
26232
|
-
function waitForAllMessagesAcknowledged () {
|
|
26233
|
-
// This timer is to prevent the process from exiting with code 13:
|
|
26234
|
-
// 13: Unsettled Top-Level Await.
|
|
26235
|
-
const timer = setInterval(() => { }, 1000);
|
|
26236
|
-
const promise = new Promise((resolve) => {
|
|
26237
|
-
resolveFn = resolve;
|
|
26238
|
-
}).then(() => { clearInterval(timer); });
|
|
26239
|
-
|
|
26240
|
-
if (pendingAckCount === 0) {
|
|
26241
|
-
resolveFn();
|
|
26242
|
-
}
|
|
26243
|
-
|
|
26244
|
-
return promise
|
|
26245
|
-
}
|
|
26246
|
-
|
|
26247
|
-
const addHookMessagePort = port2;
|
|
26248
|
-
const registerOptions = { data: { addHookMessagePort, include: [] }, transferList: [addHookMessagePort] };
|
|
26249
|
-
|
|
26250
|
-
return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged }
|
|
26251
|
-
}
|
|
26252
|
-
|
|
26253
|
-
function Hook$1 (modules, options, hookFn) {
|
|
26254
|
-
if ((this instanceof Hook$1) === false) return new Hook$1(modules, options, hookFn)
|
|
26255
|
-
if (typeof modules === 'function') {
|
|
26256
|
-
hookFn = modules;
|
|
26257
|
-
modules = null;
|
|
26258
|
-
options = null;
|
|
26259
|
-
} else if (typeof options === 'function') {
|
|
26260
|
-
hookFn = options;
|
|
26261
|
-
options = null;
|
|
26262
|
-
}
|
|
26263
|
-
const internals = options ? options.internals === true : false;
|
|
26264
|
-
|
|
26265
|
-
if (sendModulesToLoader$1 && Array.isArray(modules)) {
|
|
26266
|
-
sendModulesToLoader$1(modules);
|
|
26267
|
-
}
|
|
26268
|
-
|
|
26269
|
-
this._iitmHook = (name, namespace) => {
|
|
26270
|
-
const filename = name;
|
|
26271
|
-
const isBuiltin = name.startsWith('node:');
|
|
26272
|
-
let baseDir;
|
|
26273
|
-
|
|
26274
|
-
if (isBuiltin) {
|
|
26275
|
-
name = name.replace(/^node:/, '');
|
|
26276
|
-
} else {
|
|
26277
|
-
if (name.startsWith('file://')) {
|
|
26278
|
-
try {
|
|
26279
|
-
name = fileURLToPath$1(name);
|
|
26280
|
-
} catch (e) {}
|
|
26281
|
-
}
|
|
26282
|
-
const details = parse$9(name);
|
|
26283
|
-
if (details) {
|
|
26284
|
-
name = details.name;
|
|
26285
|
-
baseDir = details.basedir;
|
|
26286
|
-
}
|
|
26287
|
-
}
|
|
26288
|
-
|
|
26289
|
-
if (modules) {
|
|
26290
|
-
for (const moduleName of modules) {
|
|
26291
|
-
if (moduleName === name) {
|
|
26292
|
-
if (baseDir) {
|
|
26293
|
-
if (internals) {
|
|
26294
|
-
name = name + path$1.sep + path$1.relative(baseDir, fileURLToPath$1(filename));
|
|
26295
|
-
} else {
|
|
26296
|
-
if (!getExperimentalPatchInternals$2() && !baseDir.endsWith(specifiers$2.get(filename))) continue
|
|
26297
|
-
}
|
|
26298
|
-
}
|
|
26299
|
-
callHookFn$1(hookFn, namespace, name, baseDir);
|
|
26300
|
-
}
|
|
26301
|
-
}
|
|
26302
|
-
} else {
|
|
26303
|
-
callHookFn$1(hookFn, namespace, name, baseDir);
|
|
26304
|
-
}
|
|
26305
|
-
};
|
|
26306
|
-
|
|
26307
|
-
addHook$1(this._iitmHook);
|
|
26308
|
-
}
|
|
26309
|
-
|
|
26310
|
-
Hook$1.prototype.unhook = function () {
|
|
26311
|
-
removeHook$1(this._iitmHook);
|
|
26312
|
-
};
|
|
26313
|
-
|
|
26314
|
-
importInTheMiddle$1.exports = Hook$1;
|
|
26315
|
-
var Hook_1$1 = importInTheMiddle$1.exports.Hook = Hook$1;
|
|
26316
|
-
importInTheMiddle$1.exports.addHook = addHook$1;
|
|
26317
|
-
importInTheMiddle$1.exports.removeHook = removeHook$1;
|
|
26318
|
-
importInTheMiddle$1.exports.createAddHookMessageChannel = createAddHookMessageChannel$1;
|
|
26319
|
-
|
|
26320
25921
|
/*
|
|
26321
25922
|
* Copyright The OpenTelemetry Authors
|
|
26322
25923
|
*
|
|
@@ -26653,10 +26254,10 @@ var InstrumentationBase$1 = /** @class */ (function (_super) {
|
|
|
26653
26254
|
// For an absolute paths, we must create a separate instance of the
|
|
26654
26255
|
// require-in-the-middle `Hook`.
|
|
26655
26256
|
var hook = path__namespace.isAbsolute(module_2.name)
|
|
26656
|
-
? new Hook_1$
|
|
26257
|
+
? new Hook_1$1([module_2.name], { internals: true }, onRequire)
|
|
26657
26258
|
: this_1._requireInTheMiddleSingleton.register(module_2.name, onRequire);
|
|
26658
26259
|
this_1._hooks.push(hook);
|
|
26659
|
-
var esmHook = new Hook_1
|
|
26260
|
+
var esmHook = new Hook_1([module_2.name], { internals: false }, hookFn);
|
|
26660
26261
|
this_1._hooks.push(esmHook);
|
|
26661
26262
|
};
|
|
26662
26263
|
var this_1 = this;
|
|
@@ -26750,32 +26351,7 @@ function isSupported$1(supportedVersions, version, includePrerelease) {
|
|
|
26750
26351
|
* See the License for the specific language governing permissions and
|
|
26751
26352
|
* limitations under the License.
|
|
26752
26353
|
*/
|
|
26753
|
-
var
|
|
26754
|
-
(function (AttributeNames) {
|
|
26755
|
-
AttributeNames["EVENT_TYPE"] = "event_type";
|
|
26756
|
-
AttributeNames["TARGET_ELEMENT"] = "target_element";
|
|
26757
|
-
AttributeNames["TARGET_XPATH"] = "target_xpath";
|
|
26758
|
-
AttributeNames["HTTP_URL"] = "http.url";
|
|
26759
|
-
})(AttributeNames$1 || (AttributeNames$1 = {}));
|
|
26760
|
-
|
|
26761
|
-
/*
|
|
26762
|
-
* Copyright The OpenTelemetry Authors
|
|
26763
|
-
*
|
|
26764
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
26765
|
-
* you may not use this file except in compliance with the License.
|
|
26766
|
-
* You may obtain a copy of the License at
|
|
26767
|
-
*
|
|
26768
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
26769
|
-
*
|
|
26770
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
26771
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
26772
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26773
|
-
* See the License for the specific language governing permissions and
|
|
26774
|
-
* limitations under the License.
|
|
26775
|
-
*/
|
|
26776
|
-
// this is autogenerated file, see scripts/version-update.js
|
|
26777
|
-
var PACKAGE_VERSION = '0.39.0';
|
|
26778
|
-
var PACKAGE_NAME = '@opentelemetry/instrumentation-user-interaction';
|
|
26354
|
+
var otperformance$1 = perf_hooks$2.performance;
|
|
26779
26355
|
|
|
26780
26356
|
/*
|
|
26781
26357
|
* Copyright The OpenTelemetry Authors
|
|
@@ -26792,10 +26368,113 @@ var PACKAGE_NAME = '@opentelemetry/instrumentation-user-interaction';
|
|
|
26792
26368
|
* See the License for the specific language governing permissions and
|
|
26793
26369
|
* limitations under the License.
|
|
26794
26370
|
*/
|
|
26795
|
-
var
|
|
26796
|
-
|
|
26797
|
-
|
|
26798
|
-
|
|
26371
|
+
var NANOSECOND_DIGITS$1 = 9;
|
|
26372
|
+
var NANOSECOND_DIGITS_IN_MILLIS$1 = 6;
|
|
26373
|
+
var MILLISECONDS_TO_NANOSECONDS$1 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS$1);
|
|
26374
|
+
var SECOND_TO_NANOSECONDS$1 = Math.pow(10, NANOSECOND_DIGITS$1);
|
|
26375
|
+
/**
|
|
26376
|
+
* Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).
|
|
26377
|
+
* @param epochMillis
|
|
26378
|
+
*/
|
|
26379
|
+
function millisToHrTime$1(epochMillis) {
|
|
26380
|
+
var epochSeconds = epochMillis / 1000;
|
|
26381
|
+
// Decimals only.
|
|
26382
|
+
var seconds = Math.trunc(epochSeconds);
|
|
26383
|
+
// Round sub-nanosecond accuracy to nanosecond.
|
|
26384
|
+
var nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS$1);
|
|
26385
|
+
return [seconds, nanos];
|
|
26386
|
+
}
|
|
26387
|
+
function getTimeOrigin$1() {
|
|
26388
|
+
var timeOrigin = otperformance$1.timeOrigin;
|
|
26389
|
+
if (typeof timeOrigin !== 'number') {
|
|
26390
|
+
var perf = otperformance$1;
|
|
26391
|
+
timeOrigin = perf.timing && perf.timing.fetchStart;
|
|
26392
|
+
}
|
|
26393
|
+
return timeOrigin;
|
|
26394
|
+
}
|
|
26395
|
+
/**
|
|
26396
|
+
* Returns an hrtime calculated via performance component.
|
|
26397
|
+
* @param performanceNow
|
|
26398
|
+
*/
|
|
26399
|
+
function hrTime$1(performanceNow) {
|
|
26400
|
+
var timeOrigin = millisToHrTime$1(getTimeOrigin$1());
|
|
26401
|
+
var now = millisToHrTime$1(otperformance$1.now());
|
|
26402
|
+
return addHrTimes$1(timeOrigin, now);
|
|
26403
|
+
}
|
|
26404
|
+
/**
|
|
26405
|
+
* Given 2 HrTime formatted times, return their sum as an HrTime.
|
|
26406
|
+
*/
|
|
26407
|
+
function addHrTimes$1(time1, time2) {
|
|
26408
|
+
var out = [time1[0] + time2[0], time1[1] + time2[1]];
|
|
26409
|
+
// Nanoseconds
|
|
26410
|
+
if (out[1] >= SECOND_TO_NANOSECONDS$1) {
|
|
26411
|
+
out[1] -= SECOND_TO_NANOSECONDS$1;
|
|
26412
|
+
out[0] += 1;
|
|
26413
|
+
}
|
|
26414
|
+
return out;
|
|
26415
|
+
}
|
|
26416
|
+
|
|
26417
|
+
/*
|
|
26418
|
+
* Copyright The OpenTelemetry Authors
|
|
26419
|
+
*
|
|
26420
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
26421
|
+
* you may not use this file except in compliance with the License.
|
|
26422
|
+
* You may obtain a copy of the License at
|
|
26423
|
+
*
|
|
26424
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
26425
|
+
*
|
|
26426
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
26427
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
26428
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26429
|
+
* See the License for the specific language governing permissions and
|
|
26430
|
+
* limitations under the License.
|
|
26431
|
+
*/
|
|
26432
|
+
var AttributeNames$1;
|
|
26433
|
+
(function (AttributeNames) {
|
|
26434
|
+
AttributeNames["EVENT_TYPE"] = "event_type";
|
|
26435
|
+
AttributeNames["TARGET_ELEMENT"] = "target_element";
|
|
26436
|
+
AttributeNames["TARGET_XPATH"] = "target_xpath";
|
|
26437
|
+
AttributeNames["HTTP_URL"] = "http.url";
|
|
26438
|
+
})(AttributeNames$1 || (AttributeNames$1 = {}));
|
|
26439
|
+
|
|
26440
|
+
/*
|
|
26441
|
+
* Copyright The OpenTelemetry Authors
|
|
26442
|
+
*
|
|
26443
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
26444
|
+
* you may not use this file except in compliance with the License.
|
|
26445
|
+
* You may obtain a copy of the License at
|
|
26446
|
+
*
|
|
26447
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
26448
|
+
*
|
|
26449
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
26450
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
26451
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26452
|
+
* See the License for the specific language governing permissions and
|
|
26453
|
+
* limitations under the License.
|
|
26454
|
+
*/
|
|
26455
|
+
// this is autogenerated file, see scripts/version-update.js
|
|
26456
|
+
var PACKAGE_VERSION = '0.39.0';
|
|
26457
|
+
var PACKAGE_NAME = '@opentelemetry/instrumentation-user-interaction';
|
|
26458
|
+
|
|
26459
|
+
/*
|
|
26460
|
+
* Copyright The OpenTelemetry Authors
|
|
26461
|
+
*
|
|
26462
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
26463
|
+
* you may not use this file except in compliance with the License.
|
|
26464
|
+
* You may obtain a copy of the License at
|
|
26465
|
+
*
|
|
26466
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
26467
|
+
*
|
|
26468
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
26469
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
26470
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26471
|
+
* See the License for the specific language governing permissions and
|
|
26472
|
+
* limitations under the License.
|
|
26473
|
+
*/
|
|
26474
|
+
var __extends$2 = (undefined && undefined.__extends) || (function () {
|
|
26475
|
+
var extendStatics = function (d, b) {
|
|
26476
|
+
extendStatics = Object.setPrototypeOf ||
|
|
26477
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26799
26478
|
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
26800
26479
|
return extendStatics(d, b);
|
|
26801
26480
|
};
|
|
@@ -26851,7 +26530,7 @@ var UserInteractionInstrumentation = /** @class */ (function (_super) {
|
|
|
26851
26530
|
var spanData = this._spansData.get(span);
|
|
26852
26531
|
if (spanData) {
|
|
26853
26532
|
if (task.source === 'setTimeout') {
|
|
26854
|
-
spanData.hrTimeLastTimeout = hrTime$
|
|
26533
|
+
spanData.hrTimeLastTimeout = hrTime$1();
|
|
26855
26534
|
}
|
|
26856
26535
|
else if (task.source !== 'Promise.then' &&
|
|
26857
26536
|
task.source !== 'setTimeout') {
|
|
@@ -28161,7 +27840,7 @@ let SemVer$d = class SemVer {
|
|
|
28161
27840
|
var semver$1 = SemVer$d;
|
|
28162
27841
|
|
|
28163
27842
|
const SemVer$c = semver$1;
|
|
28164
|
-
const parse$
|
|
27843
|
+
const parse$7 = (version, options, throwErrors = false) => {
|
|
28165
27844
|
if (version instanceof SemVer$c) {
|
|
28166
27845
|
return version
|
|
28167
27846
|
}
|
|
@@ -28175,18 +27854,18 @@ const parse$8 = (version, options, throwErrors = false) => {
|
|
|
28175
27854
|
}
|
|
28176
27855
|
};
|
|
28177
27856
|
|
|
28178
|
-
var parse_1 = parse$
|
|
27857
|
+
var parse_1 = parse$7;
|
|
28179
27858
|
|
|
28180
|
-
const parse$
|
|
27859
|
+
const parse$6 = parse_1;
|
|
28181
27860
|
const valid$2 = (version, options) => {
|
|
28182
|
-
const v = parse$
|
|
27861
|
+
const v = parse$6(version, options);
|
|
28183
27862
|
return v ? v.version : null
|
|
28184
27863
|
};
|
|
28185
27864
|
var valid_1 = valid$2;
|
|
28186
27865
|
|
|
28187
|
-
const parse$
|
|
27866
|
+
const parse$5 = parse_1;
|
|
28188
27867
|
const clean$1 = (version, options) => {
|
|
28189
|
-
const s = parse$
|
|
27868
|
+
const s = parse$5(version.trim().replace(/^[=v]+/, ''), options);
|
|
28190
27869
|
return s ? s.version : null
|
|
28191
27870
|
};
|
|
28192
27871
|
var clean_1 = clean$1;
|
|
@@ -28211,11 +27890,11 @@ const inc$1 = (version, release, options, identifier, identifierBase) => {
|
|
|
28211
27890
|
};
|
|
28212
27891
|
var inc_1 = inc$1;
|
|
28213
27892
|
|
|
28214
|
-
const parse$
|
|
27893
|
+
const parse$4 = parse_1;
|
|
28215
27894
|
|
|
28216
27895
|
const diff$1 = (version1, version2) => {
|
|
28217
|
-
const v1 = parse$
|
|
28218
|
-
const v2 = parse$
|
|
27896
|
+
const v1 = parse$4(version1, null, true);
|
|
27897
|
+
const v2 = parse$4(version2, null, true);
|
|
28219
27898
|
const comparison = v1.compare(v2);
|
|
28220
27899
|
|
|
28221
27900
|
if (comparison === 0) {
|
|
@@ -28282,9 +27961,9 @@ const SemVer$8 = semver$1;
|
|
|
28282
27961
|
const patch$1 = (a, loose) => new SemVer$8(a, loose).patch;
|
|
28283
27962
|
var patch_1 = patch$1;
|
|
28284
27963
|
|
|
28285
|
-
const parse$
|
|
27964
|
+
const parse$3 = parse_1;
|
|
28286
27965
|
const prerelease$1 = (version, options) => {
|
|
28287
|
-
const parsed = parse$
|
|
27966
|
+
const parsed = parse$3(version, options);
|
|
28288
27967
|
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
|
28289
27968
|
};
|
|
28290
27969
|
var prerelease_1 = prerelease$1;
|
|
@@ -28397,7 +28076,7 @@ const cmp$1 = (a, op, b, loose) => {
|
|
|
28397
28076
|
var cmp_1 = cmp$1;
|
|
28398
28077
|
|
|
28399
28078
|
const SemVer$5 = semver$1;
|
|
28400
|
-
const parse$
|
|
28079
|
+
const parse$2 = parse_1;
|
|
28401
28080
|
const { safeRe: re, t } = reExports;
|
|
28402
28081
|
|
|
28403
28082
|
const coerce$1 = (version, options) => {
|
|
@@ -28453,7 +28132,7 @@ const coerce$1 = (version, options) => {
|
|
|
28453
28132
|
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
|
|
28454
28133
|
const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
|
|
28455
28134
|
|
|
28456
|
-
return parse$
|
|
28135
|
+
return parse$2(`${major}.${minor}.${patch}${prerelease}${build}`, options)
|
|
28457
28136
|
};
|
|
28458
28137
|
var coerce_1 = coerce$1;
|
|
28459
28138
|
|
|
@@ -29758,7 +29437,7 @@ const internalRe = reExports;
|
|
|
29758
29437
|
const constants = constants$1;
|
|
29759
29438
|
const SemVer = semver$1;
|
|
29760
29439
|
const identifiers = identifiers$1;
|
|
29761
|
-
const parse$
|
|
29440
|
+
const parse$1 = parse_1;
|
|
29762
29441
|
const valid = valid_1;
|
|
29763
29442
|
const clean = clean_1;
|
|
29764
29443
|
const inc = inc_1;
|
|
@@ -29796,7 +29475,7 @@ const intersects = intersects_1;
|
|
|
29796
29475
|
const simplifyRange = simplify;
|
|
29797
29476
|
const subset = subset_1;
|
|
29798
29477
|
var semver = {
|
|
29799
|
-
parse: parse$
|
|
29478
|
+
parse: parse$1,
|
|
29800
29479
|
valid,
|
|
29801
29480
|
clean,
|
|
29802
29481
|
inc,
|
|
@@ -30210,7 +29889,7 @@ var RequireInTheMiddleSingleton = /** @class */ (function () {
|
|
|
30210
29889
|
}
|
|
30211
29890
|
RequireInTheMiddleSingleton.prototype._initialize = function () {
|
|
30212
29891
|
var _this = this;
|
|
30213
|
-
new Hook_1$
|
|
29892
|
+
new Hook_1$1(
|
|
30214
29893
|
// Intercept all `require` calls; we will filter the matching ones below
|
|
30215
29894
|
null, { internals: true }, function (exports, name, basedir) {
|
|
30216
29895
|
var e_1, _a;
|
|
@@ -30279,243 +29958,6 @@ function normalizePathSeparators(moduleNameOrPath) {
|
|
|
30279
29958
|
: moduleNameOrPath;
|
|
30280
29959
|
}
|
|
30281
29960
|
|
|
30282
|
-
var importInTheMiddle = {exports: {}};
|
|
30283
|
-
|
|
30284
|
-
var register$1 = {};
|
|
30285
|
-
|
|
30286
|
-
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
|
|
30287
|
-
//
|
|
30288
|
-
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
|
|
30289
|
-
|
|
30290
|
-
const importHooks$1 = []; // TODO should this be a Set?
|
|
30291
|
-
const setters = new WeakMap();
|
|
30292
|
-
const getters = new WeakMap();
|
|
30293
|
-
const specifiers$1 = new Map();
|
|
30294
|
-
const toHook$1 = [];
|
|
30295
|
-
|
|
30296
|
-
const proxyHandler = {
|
|
30297
|
-
set (target, name, value) {
|
|
30298
|
-
return setters.get(target)[name](value)
|
|
30299
|
-
},
|
|
30300
|
-
|
|
30301
|
-
get (target, name) {
|
|
30302
|
-
if (name === Symbol.toStringTag) {
|
|
30303
|
-
return 'Module'
|
|
30304
|
-
}
|
|
30305
|
-
|
|
30306
|
-
const getter = getters.get(target)[name];
|
|
30307
|
-
|
|
30308
|
-
if (typeof getter === 'function') {
|
|
30309
|
-
return getter()
|
|
30310
|
-
}
|
|
30311
|
-
},
|
|
30312
|
-
|
|
30313
|
-
defineProperty (target, property, descriptor) {
|
|
30314
|
-
if ((!('value' in descriptor))) {
|
|
30315
|
-
throw new Error('Getters/setters are not supported for exports property descriptors.')
|
|
30316
|
-
}
|
|
30317
|
-
|
|
30318
|
-
return setters.get(target)[property](descriptor.value)
|
|
30319
|
-
}
|
|
30320
|
-
};
|
|
30321
|
-
|
|
30322
|
-
function register (name, namespace, set, get, specifier) {
|
|
30323
|
-
specifiers$1.set(name, specifier);
|
|
30324
|
-
setters.set(namespace, set);
|
|
30325
|
-
getters.set(namespace, get);
|
|
30326
|
-
const proxy = new Proxy(namespace, proxyHandler);
|
|
30327
|
-
importHooks$1.forEach(hook => hook(name, proxy));
|
|
30328
|
-
toHook$1.push([name, proxy]);
|
|
30329
|
-
}
|
|
30330
|
-
|
|
30331
|
-
let experimentalPatchInternals = false;
|
|
30332
|
-
|
|
30333
|
-
function getExperimentalPatchInternals$1 () {
|
|
30334
|
-
return experimentalPatchInternals
|
|
30335
|
-
}
|
|
30336
|
-
|
|
30337
|
-
function setExperimentalPatchInternals (value) {
|
|
30338
|
-
experimentalPatchInternals = value;
|
|
30339
|
-
}
|
|
30340
|
-
|
|
30341
|
-
register$1.register = register;
|
|
30342
|
-
register$1.importHooks = importHooks$1;
|
|
30343
|
-
register$1.specifiers = specifiers$1;
|
|
30344
|
-
register$1.toHook = toHook$1;
|
|
30345
|
-
register$1.getExperimentalPatchInternals = getExperimentalPatchInternals$1;
|
|
30346
|
-
register$1.setExperimentalPatchInternals = setExperimentalPatchInternals;
|
|
30347
|
-
|
|
30348
|
-
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
|
|
30349
|
-
//
|
|
30350
|
-
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
|
|
30351
|
-
|
|
30352
|
-
const path = path$7;
|
|
30353
|
-
const parse$1 = moduleDetailsFromPath$1;
|
|
30354
|
-
const { fileURLToPath } = require$$2;
|
|
30355
|
-
const { MessageChannel } = require$$3;
|
|
30356
|
-
|
|
30357
|
-
const {
|
|
30358
|
-
importHooks,
|
|
30359
|
-
specifiers,
|
|
30360
|
-
toHook,
|
|
30361
|
-
getExperimentalPatchInternals
|
|
30362
|
-
} = register$1;
|
|
30363
|
-
|
|
30364
|
-
function addHook (hook) {
|
|
30365
|
-
importHooks.push(hook);
|
|
30366
|
-
toHook.forEach(([name, namespace]) => hook(name, namespace));
|
|
30367
|
-
}
|
|
30368
|
-
|
|
30369
|
-
function removeHook (hook) {
|
|
30370
|
-
const index = importHooks.indexOf(hook);
|
|
30371
|
-
if (index > -1) {
|
|
30372
|
-
importHooks.splice(index, 1);
|
|
30373
|
-
}
|
|
30374
|
-
}
|
|
30375
|
-
|
|
30376
|
-
function callHookFn (hookFn, namespace, name, baseDir) {
|
|
30377
|
-
const newDefault = hookFn(namespace, name, baseDir);
|
|
30378
|
-
if (newDefault && newDefault !== namespace) {
|
|
30379
|
-
namespace.default = newDefault;
|
|
30380
|
-
}
|
|
30381
|
-
}
|
|
30382
|
-
|
|
30383
|
-
let sendModulesToLoader;
|
|
30384
|
-
|
|
30385
|
-
/**
|
|
30386
|
-
* EXPERIMENTAL
|
|
30387
|
-
* This feature is experimental and may change in minor versions.
|
|
30388
|
-
* **NOTE** This feature is incompatible with the {internals: true} Hook option.
|
|
30389
|
-
*
|
|
30390
|
-
* Creates a message channel with a port that can be used to add hooks to the
|
|
30391
|
-
* list of exclusively included modules.
|
|
30392
|
-
*
|
|
30393
|
-
* This can be used to only wrap modules that are Hook'ed, however modules need
|
|
30394
|
-
* to be hooked before they are imported.
|
|
30395
|
-
*
|
|
30396
|
-
* ```ts
|
|
30397
|
-
* import { register } from 'module'
|
|
30398
|
-
* import { Hook, createAddHookMessageChannel } from 'import-in-the-middle'
|
|
30399
|
-
*
|
|
30400
|
-
* const { registerOptions, waitForAllMessagesAcknowledged } = createAddHookMessageChannel()
|
|
30401
|
-
*
|
|
30402
|
-
* register('import-in-the-middle/hook.mjs', import.meta.url, registerOptions)
|
|
30403
|
-
*
|
|
30404
|
-
* Hook(['fs'], (exported, name, baseDir) => {
|
|
30405
|
-
* // Instrument the fs module
|
|
30406
|
-
* })
|
|
30407
|
-
*
|
|
30408
|
-
* // Ensure that the loader has acknowledged all the modules
|
|
30409
|
-
* // before we allow execution to continue
|
|
30410
|
-
* await waitForAllMessagesAcknowledged()
|
|
30411
|
-
* ```
|
|
30412
|
-
*/
|
|
30413
|
-
function createAddHookMessageChannel () {
|
|
30414
|
-
const { port1, port2 } = new MessageChannel();
|
|
30415
|
-
let pendingAckCount = 0;
|
|
30416
|
-
let resolveFn;
|
|
30417
|
-
|
|
30418
|
-
sendModulesToLoader = (modules) => {
|
|
30419
|
-
pendingAckCount++;
|
|
30420
|
-
port1.postMessage(modules);
|
|
30421
|
-
};
|
|
30422
|
-
|
|
30423
|
-
port1.on('message', () => {
|
|
30424
|
-
pendingAckCount--;
|
|
30425
|
-
|
|
30426
|
-
if (resolveFn && pendingAckCount <= 0) {
|
|
30427
|
-
resolveFn();
|
|
30428
|
-
}
|
|
30429
|
-
}).unref();
|
|
30430
|
-
|
|
30431
|
-
function waitForAllMessagesAcknowledged () {
|
|
30432
|
-
// This timer is to prevent the process from exiting with code 13:
|
|
30433
|
-
// 13: Unsettled Top-Level Await.
|
|
30434
|
-
const timer = setInterval(() => { }, 1000);
|
|
30435
|
-
const promise = new Promise((resolve) => {
|
|
30436
|
-
resolveFn = resolve;
|
|
30437
|
-
}).then(() => { clearInterval(timer); });
|
|
30438
|
-
|
|
30439
|
-
if (pendingAckCount === 0) {
|
|
30440
|
-
resolveFn();
|
|
30441
|
-
}
|
|
30442
|
-
|
|
30443
|
-
return promise
|
|
30444
|
-
}
|
|
30445
|
-
|
|
30446
|
-
const addHookMessagePort = port2;
|
|
30447
|
-
const registerOptions = { data: { addHookMessagePort, include: [] }, transferList: [addHookMessagePort] };
|
|
30448
|
-
|
|
30449
|
-
return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged }
|
|
30450
|
-
}
|
|
30451
|
-
|
|
30452
|
-
function Hook (modules, options, hookFn) {
|
|
30453
|
-
if ((this instanceof Hook) === false) return new Hook(modules, options, hookFn)
|
|
30454
|
-
if (typeof modules === 'function') {
|
|
30455
|
-
hookFn = modules;
|
|
30456
|
-
modules = null;
|
|
30457
|
-
options = null;
|
|
30458
|
-
} else if (typeof options === 'function') {
|
|
30459
|
-
hookFn = options;
|
|
30460
|
-
options = null;
|
|
30461
|
-
}
|
|
30462
|
-
const internals = options ? options.internals === true : false;
|
|
30463
|
-
|
|
30464
|
-
if (sendModulesToLoader && Array.isArray(modules)) {
|
|
30465
|
-
sendModulesToLoader(modules);
|
|
30466
|
-
}
|
|
30467
|
-
|
|
30468
|
-
this._iitmHook = (name, namespace) => {
|
|
30469
|
-
const filename = name;
|
|
30470
|
-
const isBuiltin = name.startsWith('node:');
|
|
30471
|
-
let baseDir;
|
|
30472
|
-
|
|
30473
|
-
if (isBuiltin) {
|
|
30474
|
-
name = name.replace(/^node:/, '');
|
|
30475
|
-
} else {
|
|
30476
|
-
if (name.startsWith('file://')) {
|
|
30477
|
-
try {
|
|
30478
|
-
name = fileURLToPath(name);
|
|
30479
|
-
} catch (e) {}
|
|
30480
|
-
}
|
|
30481
|
-
const details = parse$1(name);
|
|
30482
|
-
if (details) {
|
|
30483
|
-
name = details.name;
|
|
30484
|
-
baseDir = details.basedir;
|
|
30485
|
-
}
|
|
30486
|
-
}
|
|
30487
|
-
|
|
30488
|
-
if (modules) {
|
|
30489
|
-
for (const moduleName of modules) {
|
|
30490
|
-
if (moduleName === name) {
|
|
30491
|
-
if (baseDir) {
|
|
30492
|
-
if (internals) {
|
|
30493
|
-
name = name + path.sep + path.relative(baseDir, fileURLToPath(filename));
|
|
30494
|
-
} else {
|
|
30495
|
-
if (!getExperimentalPatchInternals() && !baseDir.endsWith(specifiers.get(filename))) continue
|
|
30496
|
-
}
|
|
30497
|
-
}
|
|
30498
|
-
callHookFn(hookFn, namespace, name, baseDir);
|
|
30499
|
-
}
|
|
30500
|
-
}
|
|
30501
|
-
} else {
|
|
30502
|
-
callHookFn(hookFn, namespace, name, baseDir);
|
|
30503
|
-
}
|
|
30504
|
-
};
|
|
30505
|
-
|
|
30506
|
-
addHook(this._iitmHook);
|
|
30507
|
-
}
|
|
30508
|
-
|
|
30509
|
-
Hook.prototype.unhook = function () {
|
|
30510
|
-
removeHook(this._iitmHook);
|
|
30511
|
-
};
|
|
30512
|
-
|
|
30513
|
-
importInTheMiddle.exports = Hook;
|
|
30514
|
-
var Hook_1 = importInTheMiddle.exports.Hook = Hook;
|
|
30515
|
-
importInTheMiddle.exports.addHook = addHook;
|
|
30516
|
-
importInTheMiddle.exports.removeHook = removeHook;
|
|
30517
|
-
importInTheMiddle.exports.createAddHookMessageChannel = createAddHookMessageChannel;
|
|
30518
|
-
|
|
30519
29961
|
/*
|
|
30520
29962
|
* Copyright The OpenTelemetry Authors
|
|
30521
29963
|
*
|
|
@@ -30872,7 +30314,7 @@ var InstrumentationBase = /** @class */ (function (_super) {
|
|
|
30872
30314
|
// For an absolute paths, we must create a separate instance of the
|
|
30873
30315
|
// require-in-the-middle `Hook`.
|
|
30874
30316
|
var hook = path__namespace.isAbsolute(module_2.name)
|
|
30875
|
-
? new Hook_1$
|
|
30317
|
+
? new Hook_1$1([module_2.name], { internals: true }, onRequire)
|
|
30876
30318
|
: this_1._requireInTheMiddleSingleton.register(module_2.name, onRequire);
|
|
30877
30319
|
this_1._hooks.push(hook);
|
|
30878
30320
|
var esmHook = new Hook_1([module_2.name], { internals: false }, hookFn);
|
|
@@ -30971,66 +30413,6 @@ function isSupported(supportedVersions, version, includePrerelease) {
|
|
|
30971
30413
|
*/
|
|
30972
30414
|
var otperformance = perf_hooks$2.performance;
|
|
30973
30415
|
|
|
30974
|
-
/*
|
|
30975
|
-
* Copyright The OpenTelemetry Authors
|
|
30976
|
-
*
|
|
30977
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
30978
|
-
* you may not use this file except in compliance with the License.
|
|
30979
|
-
* You may obtain a copy of the License at
|
|
30980
|
-
*
|
|
30981
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
30982
|
-
*
|
|
30983
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
30984
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
30985
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30986
|
-
* See the License for the specific language governing permissions and
|
|
30987
|
-
* limitations under the License.
|
|
30988
|
-
*/
|
|
30989
|
-
var TMP_HTTP_METHOD = 'http.method';
|
|
30990
|
-
var TMP_HTTP_URL = 'http.url';
|
|
30991
|
-
var TMP_HTTP_HOST = 'http.host';
|
|
30992
|
-
var TMP_HTTP_SCHEME = 'http.scheme';
|
|
30993
|
-
var TMP_HTTP_STATUS_CODE = 'http.status_code';
|
|
30994
|
-
var TMP_HTTP_USER_AGENT = 'http.user_agent';
|
|
30995
|
-
var TMP_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length';
|
|
30996
|
-
var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed';
|
|
30997
|
-
/**
|
|
30998
|
-
* HTTP request method.
|
|
30999
|
-
*/
|
|
31000
|
-
var SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD;
|
|
31001
|
-
/**
|
|
31002
|
-
* Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
|
|
31003
|
-
*
|
|
31004
|
-
* Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`.
|
|
31005
|
-
*/
|
|
31006
|
-
var SEMATTRS_HTTP_URL = TMP_HTTP_URL;
|
|
31007
|
-
/**
|
|
31008
|
-
* The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note.
|
|
31009
|
-
*
|
|
31010
|
-
* Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set.
|
|
31011
|
-
*/
|
|
31012
|
-
var SEMATTRS_HTTP_HOST = TMP_HTTP_HOST;
|
|
31013
|
-
/**
|
|
31014
|
-
* The URI scheme identifying the used protocol.
|
|
31015
|
-
*/
|
|
31016
|
-
var SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME;
|
|
31017
|
-
/**
|
|
31018
|
-
* [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
|
|
31019
|
-
*/
|
|
31020
|
-
var SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE;
|
|
31021
|
-
/**
|
|
31022
|
-
* Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.
|
|
31023
|
-
*/
|
|
31024
|
-
var SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT;
|
|
31025
|
-
/**
|
|
31026
|
-
* The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.
|
|
31027
|
-
*/
|
|
31028
|
-
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH;
|
|
31029
|
-
/**
|
|
31030
|
-
* The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.
|
|
31031
|
-
*/
|
|
31032
|
-
var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED;
|
|
31033
|
-
|
|
31034
30416
|
/*
|
|
31035
30417
|
* Copyright The OpenTelemetry Authors
|
|
31036
30418
|
*
|