@pocket-tools/tracing 1.0.1 → 1.1.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/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-semantic-release.log +66 -76
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +290 -1582
- package/dist/index.mjs +283 -1578
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -4,9 +4,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __esm = (fn, res) => function __init() {
|
|
8
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
-
};
|
|
10
7
|
var __export = (target, all) => {
|
|
11
8
|
for (var name in all)
|
|
12
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -29,37 +26,32 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
26
|
));
|
|
30
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
28
|
|
|
32
|
-
//
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var src_exports = {};
|
|
31
|
+
__export(src_exports, {
|
|
32
|
+
AdditionalInstrumentation: () => AdditionalInstrumentation,
|
|
33
|
+
nodeSDKBuilder: () => nodeSDKBuilder
|
|
38
34
|
});
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
39
36
|
|
|
40
|
-
//
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
// src/tracing.ts
|
|
38
|
+
var import_process = __toESM(require("process"));
|
|
39
|
+
var import_sdk_node = require("@opentelemetry/sdk-node");
|
|
40
|
+
var import_instrumentation_graphql = require("@opentelemetry/instrumentation-graphql");
|
|
41
|
+
var import_instrumentation_aws_sdk = require("@opentelemetry/instrumentation-aws-sdk");
|
|
42
|
+
var import_id_generator_aws_xray = require("@opentelemetry/id-generator-aws-xray");
|
|
43
|
+
var import_propagator_aws_xray = require("@opentelemetry/propagator-aws-xray");
|
|
44
|
+
var import_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
|
45
|
+
var import_instrumentation_dataloader = require("@opentelemetry/instrumentation-dataloader");
|
|
46
46
|
|
|
47
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.
|
|
48
|
-
var
|
|
49
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/platform/index.js"() {
|
|
50
|
-
init_node();
|
|
51
|
-
}
|
|
52
|
-
});
|
|
47
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js
|
|
48
|
+
var _globalThis = typeof globalThis === "object" ? globalThis : global;
|
|
53
49
|
|
|
54
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.
|
|
55
|
-
var VERSION;
|
|
56
|
-
var init_version = __esm({
|
|
57
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/version.js"() {
|
|
58
|
-
VERSION = "1.8.0";
|
|
59
|
-
}
|
|
60
|
-
});
|
|
50
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/version.js
|
|
51
|
+
var VERSION = "1.4.1";
|
|
61
52
|
|
|
62
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.
|
|
53
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/internal/semver.js
|
|
54
|
+
var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
63
55
|
function _makeCompatibilityCheck(ownVersion) {
|
|
64
56
|
var acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
|
|
65
57
|
var rejectedVersions = /* @__PURE__ */ new Set();
|
|
@@ -123,22 +115,18 @@ function _makeCompatibilityCheck(ownVersion) {
|
|
|
123
115
|
return _reject(globalVersion);
|
|
124
116
|
};
|
|
125
117
|
}
|
|
126
|
-
var
|
|
127
|
-
var init_semver = __esm({
|
|
128
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/internal/semver.js"() {
|
|
129
|
-
init_version();
|
|
130
|
-
re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
131
|
-
isCompatible = _makeCompatibilityCheck(VERSION);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
118
|
+
var isCompatible = _makeCompatibilityCheck(VERSION);
|
|
134
119
|
|
|
135
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.
|
|
120
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
|
|
121
|
+
var major = VERSION.split(".")[0];
|
|
122
|
+
var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("opentelemetry.js.api." + major);
|
|
123
|
+
var _global = _globalThis;
|
|
136
124
|
function registerGlobal(type, instance, diag2, allowOverride) {
|
|
137
|
-
var
|
|
125
|
+
var _a;
|
|
138
126
|
if (allowOverride === void 0) {
|
|
139
127
|
allowOverride = false;
|
|
140
128
|
}
|
|
141
|
-
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (
|
|
129
|
+
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
|
|
142
130
|
version: VERSION
|
|
143
131
|
};
|
|
144
132
|
if (!allowOverride && api[type]) {
|
|
@@ -156,8 +144,8 @@ function registerGlobal(type, instance, diag2, allowOverride) {
|
|
|
156
144
|
return true;
|
|
157
145
|
}
|
|
158
146
|
function getGlobal(type) {
|
|
159
|
-
var
|
|
160
|
-
var globalVersion = (
|
|
147
|
+
var _a, _b;
|
|
148
|
+
var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
|
|
161
149
|
if (!globalVersion || !isCompatible(globalVersion)) {
|
|
162
150
|
return;
|
|
163
151
|
}
|
|
@@ -170,19 +158,84 @@ function unregisterGlobal(type, diag2) {
|
|
|
170
158
|
delete api[type];
|
|
171
159
|
}
|
|
172
160
|
}
|
|
173
|
-
var major, GLOBAL_OPENTELEMETRY_API_KEY, _global;
|
|
174
|
-
var init_global_utils = __esm({
|
|
175
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js"() {
|
|
176
|
-
init_platform();
|
|
177
|
-
init_version();
|
|
178
|
-
init_semver();
|
|
179
|
-
major = VERSION.split(".")[0];
|
|
180
|
-
GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("opentelemetry.js.api." + major);
|
|
181
|
-
_global = _globalThis;
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
161
|
|
|
185
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.
|
|
162
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
|
|
163
|
+
var __read = function(o, n) {
|
|
164
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
165
|
+
if (!m)
|
|
166
|
+
return o;
|
|
167
|
+
var i = m.call(o), r, ar = [], e;
|
|
168
|
+
try {
|
|
169
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
170
|
+
ar.push(r.value);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
e = { error };
|
|
173
|
+
} finally {
|
|
174
|
+
try {
|
|
175
|
+
if (r && !r.done && (m = i["return"]))
|
|
176
|
+
m.call(i);
|
|
177
|
+
} finally {
|
|
178
|
+
if (e)
|
|
179
|
+
throw e.error;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return ar;
|
|
183
|
+
};
|
|
184
|
+
var __spreadArray = function(to, from, pack) {
|
|
185
|
+
if (pack || arguments.length === 2)
|
|
186
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
187
|
+
if (ar || !(i in from)) {
|
|
188
|
+
if (!ar)
|
|
189
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
190
|
+
ar[i] = from[i];
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
194
|
+
};
|
|
195
|
+
var DiagComponentLogger = (
|
|
196
|
+
/** @class */
|
|
197
|
+
function() {
|
|
198
|
+
function DiagComponentLogger2(props) {
|
|
199
|
+
this._namespace = props.namespace || "DiagComponentLogger";
|
|
200
|
+
}
|
|
201
|
+
DiagComponentLogger2.prototype.debug = function() {
|
|
202
|
+
var args = [];
|
|
203
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
204
|
+
args[_i] = arguments[_i];
|
|
205
|
+
}
|
|
206
|
+
return logProxy("debug", this._namespace, args);
|
|
207
|
+
};
|
|
208
|
+
DiagComponentLogger2.prototype.error = function() {
|
|
209
|
+
var args = [];
|
|
210
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
211
|
+
args[_i] = arguments[_i];
|
|
212
|
+
}
|
|
213
|
+
return logProxy("error", this._namespace, args);
|
|
214
|
+
};
|
|
215
|
+
DiagComponentLogger2.prototype.info = function() {
|
|
216
|
+
var args = [];
|
|
217
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
218
|
+
args[_i] = arguments[_i];
|
|
219
|
+
}
|
|
220
|
+
return logProxy("info", this._namespace, args);
|
|
221
|
+
};
|
|
222
|
+
DiagComponentLogger2.prototype.warn = function() {
|
|
223
|
+
var args = [];
|
|
224
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
225
|
+
args[_i] = arguments[_i];
|
|
226
|
+
}
|
|
227
|
+
return logProxy("warn", this._namespace, args);
|
|
228
|
+
};
|
|
229
|
+
DiagComponentLogger2.prototype.verbose = function() {
|
|
230
|
+
var args = [];
|
|
231
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
232
|
+
args[_i] = arguments[_i];
|
|
233
|
+
}
|
|
234
|
+
return logProxy("verbose", this._namespace, args);
|
|
235
|
+
};
|
|
236
|
+
return DiagComponentLogger2;
|
|
237
|
+
}()
|
|
238
|
+
);
|
|
186
239
|
function logProxy(funcName, namespace, args) {
|
|
187
240
|
var logger = getGlobal("diag");
|
|
188
241
|
if (!logger) {
|
|
@@ -191,104 +244,20 @@ function logProxy(funcName, namespace, args) {
|
|
|
191
244
|
args.unshift(namespace);
|
|
192
245
|
return logger[funcName].apply(logger, __spreadArray([], __read(args), false));
|
|
193
246
|
}
|
|
194
|
-
var __read, __spreadArray, DiagComponentLogger;
|
|
195
|
-
var init_ComponentLogger = __esm({
|
|
196
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js"() {
|
|
197
|
-
init_global_utils();
|
|
198
|
-
__read = function(o, n) {
|
|
199
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
200
|
-
if (!m)
|
|
201
|
-
return o;
|
|
202
|
-
var i = m.call(o), r, ar = [], e;
|
|
203
|
-
try {
|
|
204
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
205
|
-
ar.push(r.value);
|
|
206
|
-
} catch (error) {
|
|
207
|
-
e = { error };
|
|
208
|
-
} finally {
|
|
209
|
-
try {
|
|
210
|
-
if (r && !r.done && (m = i["return"]))
|
|
211
|
-
m.call(i);
|
|
212
|
-
} finally {
|
|
213
|
-
if (e)
|
|
214
|
-
throw e.error;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
return ar;
|
|
218
|
-
};
|
|
219
|
-
__spreadArray = function(to, from, pack) {
|
|
220
|
-
if (pack || arguments.length === 2)
|
|
221
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
222
|
-
if (ar || !(i in from)) {
|
|
223
|
-
if (!ar)
|
|
224
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
225
|
-
ar[i] = from[i];
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
229
|
-
};
|
|
230
|
-
DiagComponentLogger = /** @class */
|
|
231
|
-
function() {
|
|
232
|
-
function DiagComponentLogger2(props) {
|
|
233
|
-
this._namespace = props.namespace || "DiagComponentLogger";
|
|
234
|
-
}
|
|
235
|
-
DiagComponentLogger2.prototype.debug = function() {
|
|
236
|
-
var args = [];
|
|
237
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
238
|
-
args[_i] = arguments[_i];
|
|
239
|
-
}
|
|
240
|
-
return logProxy("debug", this._namespace, args);
|
|
241
|
-
};
|
|
242
|
-
DiagComponentLogger2.prototype.error = function() {
|
|
243
|
-
var args = [];
|
|
244
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
245
|
-
args[_i] = arguments[_i];
|
|
246
|
-
}
|
|
247
|
-
return logProxy("error", this._namespace, args);
|
|
248
|
-
};
|
|
249
|
-
DiagComponentLogger2.prototype.info = function() {
|
|
250
|
-
var args = [];
|
|
251
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
252
|
-
args[_i] = arguments[_i];
|
|
253
|
-
}
|
|
254
|
-
return logProxy("info", this._namespace, args);
|
|
255
|
-
};
|
|
256
|
-
DiagComponentLogger2.prototype.warn = function() {
|
|
257
|
-
var args = [];
|
|
258
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
259
|
-
args[_i] = arguments[_i];
|
|
260
|
-
}
|
|
261
|
-
return logProxy("warn", this._namespace, args);
|
|
262
|
-
};
|
|
263
|
-
DiagComponentLogger2.prototype.verbose = function() {
|
|
264
|
-
var args = [];
|
|
265
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
266
|
-
args[_i] = arguments[_i];
|
|
267
|
-
}
|
|
268
|
-
return logProxy("verbose", this._namespace, args);
|
|
269
|
-
};
|
|
270
|
-
return DiagComponentLogger2;
|
|
271
|
-
}();
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
247
|
|
|
275
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.
|
|
248
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/diag/types.js
|
|
276
249
|
var DiagLogLevel;
|
|
277
|
-
|
|
278
|
-
"
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
|
|
250
|
+
(function(DiagLogLevel2) {
|
|
251
|
+
DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
|
|
252
|
+
DiagLogLevel2[DiagLogLevel2["ERROR"] = 30] = "ERROR";
|
|
253
|
+
DiagLogLevel2[DiagLogLevel2["WARN"] = 50] = "WARN";
|
|
254
|
+
DiagLogLevel2[DiagLogLevel2["INFO"] = 60] = "INFO";
|
|
255
|
+
DiagLogLevel2[DiagLogLevel2["DEBUG"] = 70] = "DEBUG";
|
|
256
|
+
DiagLogLevel2[DiagLogLevel2["VERBOSE"] = 80] = "VERBOSE";
|
|
257
|
+
DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL";
|
|
258
|
+
})(DiagLogLevel || (DiagLogLevel = {}));
|
|
259
|
+
|
|
260
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
|
|
292
261
|
function createLogLevelDiagLogger(maxLevel, logger) {
|
|
293
262
|
if (maxLevel < DiagLogLevel.NONE) {
|
|
294
263
|
maxLevel = DiagLogLevel.NONE;
|
|
@@ -312,665 +281,154 @@ function createLogLevelDiagLogger(maxLevel, logger) {
|
|
|
312
281
|
verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE)
|
|
313
282
|
};
|
|
314
283
|
}
|
|
315
|
-
var init_logLevelLogger = __esm({
|
|
316
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js"() {
|
|
317
|
-
init_types();
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
284
|
|
|
321
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.
|
|
322
|
-
var __read2
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
e
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
285
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/api/diag.js
|
|
286
|
+
var __read2 = function(o, n) {
|
|
287
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
288
|
+
if (!m)
|
|
289
|
+
return o;
|
|
290
|
+
var i = m.call(o), r, ar = [], e;
|
|
291
|
+
try {
|
|
292
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
293
|
+
ar.push(r.value);
|
|
294
|
+
} catch (error) {
|
|
295
|
+
e = { error };
|
|
296
|
+
} finally {
|
|
297
|
+
try {
|
|
298
|
+
if (r && !r.done && (m = i["return"]))
|
|
299
|
+
m.call(i);
|
|
300
|
+
} finally {
|
|
301
|
+
if (e)
|
|
302
|
+
throw e.error;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return ar;
|
|
306
|
+
};
|
|
307
|
+
var __spreadArray2 = function(to, from, pack) {
|
|
308
|
+
if (pack || arguments.length === 2)
|
|
309
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
310
|
+
if (ar || !(i in from)) {
|
|
311
|
+
if (!ar)
|
|
312
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
313
|
+
ar[i] = from[i];
|
|
347
314
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
API_NAME = "diag";
|
|
362
|
-
DiagAPI = /** @class */
|
|
363
|
-
function() {
|
|
364
|
-
function DiagAPI2() {
|
|
365
|
-
function _logProxy(funcName) {
|
|
366
|
-
return function() {
|
|
367
|
-
var args = [];
|
|
368
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
369
|
-
args[_i] = arguments[_i];
|
|
370
|
-
}
|
|
371
|
-
var logger = getGlobal("diag");
|
|
372
|
-
if (!logger)
|
|
373
|
-
return;
|
|
374
|
-
return logger[funcName].apply(logger, __spreadArray2([], __read2(args), false));
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
var self = this;
|
|
378
|
-
var setLogger = function(logger, optionsOrLogLevel) {
|
|
379
|
-
var _a2, _b, _c;
|
|
380
|
-
if (optionsOrLogLevel === void 0) {
|
|
381
|
-
optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
|
|
382
|
-
}
|
|
383
|
-
if (logger === self) {
|
|
384
|
-
var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
385
|
-
self.error((_a2 = err.stack) !== null && _a2 !== void 0 ? _a2 : err.message);
|
|
386
|
-
return false;
|
|
387
|
-
}
|
|
388
|
-
if (typeof optionsOrLogLevel === "number") {
|
|
389
|
-
optionsOrLogLevel = {
|
|
390
|
-
logLevel: optionsOrLogLevel
|
|
391
|
-
};
|
|
392
|
-
}
|
|
393
|
-
var oldLogger = getGlobal("diag");
|
|
394
|
-
var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
|
|
395
|
-
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
396
|
-
var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
397
|
-
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
398
|
-
newLogger.warn("Current logger will overwrite one already registered from " + stack);
|
|
315
|
+
}
|
|
316
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
317
|
+
};
|
|
318
|
+
var API_NAME = "diag";
|
|
319
|
+
var DiagAPI = (
|
|
320
|
+
/** @class */
|
|
321
|
+
function() {
|
|
322
|
+
function DiagAPI2() {
|
|
323
|
+
function _logProxy(funcName) {
|
|
324
|
+
return function() {
|
|
325
|
+
var args = [];
|
|
326
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
327
|
+
args[_i] = arguments[_i];
|
|
399
328
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
unregisterGlobal(API_NAME, self);
|
|
329
|
+
var logger = getGlobal("diag");
|
|
330
|
+
if (!logger)
|
|
331
|
+
return;
|
|
332
|
+
return logger[funcName].apply(logger, __spreadArray2([], __read2(args), false));
|
|
405
333
|
};
|
|
406
|
-
self.createComponentLogger = function(options) {
|
|
407
|
-
return new DiagComponentLogger(options);
|
|
408
|
-
};
|
|
409
|
-
self.verbose = _logProxy("verbose");
|
|
410
|
-
self.debug = _logProxy("debug");
|
|
411
|
-
self.info = _logProxy("info");
|
|
412
|
-
self.warn = _logProxy("warn");
|
|
413
|
-
self.error = _logProxy("error");
|
|
414
334
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
335
|
+
var self = this;
|
|
336
|
+
var setLogger = function(logger, optionsOrLogLevel) {
|
|
337
|
+
var _a, _b, _c;
|
|
338
|
+
if (optionsOrLogLevel === void 0) {
|
|
339
|
+
optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
|
|
418
340
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
}
|
|
424
|
-
});
|
|
425
|
-
|
|
426
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/context/context.js
|
|
427
|
-
function createContextKey(description) {
|
|
428
|
-
return Symbol.for(description);
|
|
429
|
-
}
|
|
430
|
-
var BaseContext, ROOT_CONTEXT;
|
|
431
|
-
var init_context = __esm({
|
|
432
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/context/context.js"() {
|
|
433
|
-
BaseContext = /** @class */
|
|
434
|
-
/* @__PURE__ */ function() {
|
|
435
|
-
function BaseContext2(parentContext) {
|
|
436
|
-
var self = this;
|
|
437
|
-
self._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
|
|
438
|
-
self.getValue = function(key) {
|
|
439
|
-
return self._currentContext.get(key);
|
|
440
|
-
};
|
|
441
|
-
self.setValue = function(key, value) {
|
|
442
|
-
var context2 = new BaseContext2(self._currentContext);
|
|
443
|
-
context2._currentContext.set(key, value);
|
|
444
|
-
return context2;
|
|
445
|
-
};
|
|
446
|
-
self.deleteValue = function(key) {
|
|
447
|
-
var context2 = new BaseContext2(self._currentContext);
|
|
448
|
-
context2._currentContext.delete(key);
|
|
449
|
-
return context2;
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
return BaseContext2;
|
|
453
|
-
}();
|
|
454
|
-
ROOT_CONTEXT = new BaseContext();
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
|
|
458
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js
|
|
459
|
-
var consoleMap, DiagConsoleLogger;
|
|
460
|
-
var init_consoleLogger = __esm({
|
|
461
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js"() {
|
|
462
|
-
consoleMap = [
|
|
463
|
-
{ n: "error", c: "error" },
|
|
464
|
-
{ n: "warn", c: "warn" },
|
|
465
|
-
{ n: "info", c: "info" },
|
|
466
|
-
{ n: "debug", c: "debug" },
|
|
467
|
-
{ n: "verbose", c: "trace" }
|
|
468
|
-
];
|
|
469
|
-
DiagConsoleLogger = /** @class */
|
|
470
|
-
/* @__PURE__ */ function() {
|
|
471
|
-
function DiagConsoleLogger2() {
|
|
472
|
-
function _consoleFunc(funcName) {
|
|
473
|
-
return function() {
|
|
474
|
-
var args = [];
|
|
475
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
476
|
-
args[_i] = arguments[_i];
|
|
477
|
-
}
|
|
478
|
-
if (console) {
|
|
479
|
-
var theFunc = console[funcName];
|
|
480
|
-
if (typeof theFunc !== "function") {
|
|
481
|
-
theFunc = console.log;
|
|
482
|
-
}
|
|
483
|
-
if (typeof theFunc === "function") {
|
|
484
|
-
return theFunc.apply(console, args);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
for (var i = 0; i < consoleMap.length; i++) {
|
|
490
|
-
this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
return DiagConsoleLogger2;
|
|
494
|
-
}();
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
|
|
499
|
-
var __read3, __spreadArray3, NoopContextManager;
|
|
500
|
-
var init_NoopContextManager = __esm({
|
|
501
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js"() {
|
|
502
|
-
init_context();
|
|
503
|
-
__read3 = function(o, n) {
|
|
504
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
505
|
-
if (!m)
|
|
506
|
-
return o;
|
|
507
|
-
var i = m.call(o), r, ar = [], e;
|
|
508
|
-
try {
|
|
509
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
510
|
-
ar.push(r.value);
|
|
511
|
-
} catch (error) {
|
|
512
|
-
e = { error };
|
|
513
|
-
} finally {
|
|
514
|
-
try {
|
|
515
|
-
if (r && !r.done && (m = i["return"]))
|
|
516
|
-
m.call(i);
|
|
517
|
-
} finally {
|
|
518
|
-
if (e)
|
|
519
|
-
throw e.error;
|
|
341
|
+
if (logger === self) {
|
|
342
|
+
var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
343
|
+
self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
|
|
344
|
+
return false;
|
|
520
345
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
if (pack || arguments.length === 2)
|
|
526
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
527
|
-
if (ar || !(i in from)) {
|
|
528
|
-
if (!ar)
|
|
529
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
530
|
-
ar[i] = from[i];
|
|
531
|
-
}
|
|
346
|
+
if (typeof optionsOrLogLevel === "number") {
|
|
347
|
+
optionsOrLogLevel = {
|
|
348
|
+
logLevel: optionsOrLogLevel
|
|
349
|
+
};
|
|
532
350
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
NoopContextManager2.prototype.active = function() {
|
|
540
|
-
return ROOT_CONTEXT;
|
|
541
|
-
};
|
|
542
|
-
NoopContextManager2.prototype.with = function(_context, fn, thisArg) {
|
|
543
|
-
var args = [];
|
|
544
|
-
for (var _i = 3; _i < arguments.length; _i++) {
|
|
545
|
-
args[_i - 3] = arguments[_i];
|
|
351
|
+
var oldLogger = getGlobal("diag");
|
|
352
|
+
var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
|
|
353
|
+
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
354
|
+
var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
355
|
+
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
356
|
+
newLogger.warn("Current logger will overwrite one already registered from " + stack);
|
|
546
357
|
}
|
|
547
|
-
return
|
|
358
|
+
return registerGlobal("diag", newLogger, self, true);
|
|
548
359
|
};
|
|
549
|
-
|
|
550
|
-
|
|
360
|
+
self.setLogger = setLogger;
|
|
361
|
+
self.disable = function() {
|
|
362
|
+
unregisterGlobal(API_NAME, self);
|
|
551
363
|
};
|
|
552
|
-
|
|
553
|
-
return
|
|
364
|
+
self.createComponentLogger = function(options) {
|
|
365
|
+
return new DiagComponentLogger(options);
|
|
554
366
|
};
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
var __read4, __spreadArray4, API_NAME2, NOOP_CONTEXT_MANAGER, ContextAPI;
|
|
565
|
-
var init_context2 = __esm({
|
|
566
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/api/context.js"() {
|
|
567
|
-
init_NoopContextManager();
|
|
568
|
-
init_global_utils();
|
|
569
|
-
init_diag();
|
|
570
|
-
__read4 = function(o, n) {
|
|
571
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
572
|
-
if (!m)
|
|
573
|
-
return o;
|
|
574
|
-
var i = m.call(o), r, ar = [], e;
|
|
575
|
-
try {
|
|
576
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
577
|
-
ar.push(r.value);
|
|
578
|
-
} catch (error) {
|
|
579
|
-
e = { error };
|
|
580
|
-
} finally {
|
|
581
|
-
try {
|
|
582
|
-
if (r && !r.done && (m = i["return"]))
|
|
583
|
-
m.call(i);
|
|
584
|
-
} finally {
|
|
585
|
-
if (e)
|
|
586
|
-
throw e.error;
|
|
587
|
-
}
|
|
367
|
+
self.verbose = _logProxy("verbose");
|
|
368
|
+
self.debug = _logProxy("debug");
|
|
369
|
+
self.info = _logProxy("info");
|
|
370
|
+
self.warn = _logProxy("warn");
|
|
371
|
+
self.error = _logProxy("error");
|
|
372
|
+
}
|
|
373
|
+
DiagAPI2.instance = function() {
|
|
374
|
+
if (!this._instance) {
|
|
375
|
+
this._instance = new DiagAPI2();
|
|
588
376
|
}
|
|
589
|
-
return
|
|
377
|
+
return this._instance;
|
|
590
378
|
};
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
if (ar || !(i in from)) {
|
|
595
|
-
if (!ar)
|
|
596
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
597
|
-
ar[i] = from[i];
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
601
|
-
};
|
|
602
|
-
API_NAME2 = "context";
|
|
603
|
-
NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
604
|
-
ContextAPI = /** @class */
|
|
605
|
-
function() {
|
|
606
|
-
function ContextAPI2() {
|
|
607
|
-
}
|
|
608
|
-
ContextAPI2.getInstance = function() {
|
|
609
|
-
if (!this._instance) {
|
|
610
|
-
this._instance = new ContextAPI2();
|
|
611
|
-
}
|
|
612
|
-
return this._instance;
|
|
613
|
-
};
|
|
614
|
-
ContextAPI2.prototype.setGlobalContextManager = function(contextManager) {
|
|
615
|
-
return registerGlobal(API_NAME2, contextManager, DiagAPI.instance());
|
|
616
|
-
};
|
|
617
|
-
ContextAPI2.prototype.active = function() {
|
|
618
|
-
return this._getContextManager().active();
|
|
619
|
-
};
|
|
620
|
-
ContextAPI2.prototype.with = function(context2, fn, thisArg) {
|
|
621
|
-
var _a2;
|
|
622
|
-
var args = [];
|
|
623
|
-
for (var _i = 3; _i < arguments.length; _i++) {
|
|
624
|
-
args[_i - 3] = arguments[_i];
|
|
625
|
-
}
|
|
626
|
-
return (_a2 = this._getContextManager()).with.apply(_a2, __spreadArray4([context2, fn, thisArg], __read4(args), false));
|
|
627
|
-
};
|
|
628
|
-
ContextAPI2.prototype.bind = function(context2, target) {
|
|
629
|
-
return this._getContextManager().bind(context2, target);
|
|
630
|
-
};
|
|
631
|
-
ContextAPI2.prototype._getContextManager = function() {
|
|
632
|
-
return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
|
|
633
|
-
};
|
|
634
|
-
ContextAPI2.prototype.disable = function() {
|
|
635
|
-
this._getContextManager().disable();
|
|
636
|
-
unregisterGlobal(API_NAME2, DiagAPI.instance());
|
|
637
|
-
};
|
|
638
|
-
return ContextAPI2;
|
|
639
|
-
}();
|
|
640
|
-
}
|
|
641
|
-
});
|
|
642
|
-
|
|
643
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js
|
|
644
|
-
var TraceFlags;
|
|
645
|
-
var init_trace_flags = __esm({
|
|
646
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js"() {
|
|
647
|
-
(function(TraceFlags2) {
|
|
648
|
-
TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
|
|
649
|
-
TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
|
|
650
|
-
})(TraceFlags || (TraceFlags = {}));
|
|
651
|
-
}
|
|
652
|
-
});
|
|
653
|
-
|
|
654
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/context-api.js
|
|
655
|
-
var context;
|
|
656
|
-
var init_context_api = __esm({
|
|
657
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/context-api.js"() {
|
|
658
|
-
init_context2();
|
|
659
|
-
context = ContextAPI.getInstance();
|
|
660
|
-
}
|
|
661
|
-
});
|
|
662
|
-
|
|
663
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/diag-api.js
|
|
664
|
-
var diag;
|
|
665
|
-
var init_diag_api = __esm({
|
|
666
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/diag-api.js"() {
|
|
667
|
-
init_diag();
|
|
668
|
-
diag = DiagAPI.instance();
|
|
669
|
-
}
|
|
670
|
-
});
|
|
671
|
-
|
|
672
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/index.js
|
|
673
|
-
var init_esm = __esm({
|
|
674
|
-
"../../node_modules/.pnpm/@opentelemetry+api@1.8.0/node_modules/@opentelemetry/api/build/esm/index.js"() {
|
|
675
|
-
init_context();
|
|
676
|
-
init_consoleLogger();
|
|
677
|
-
init_types();
|
|
678
|
-
init_trace_flags();
|
|
679
|
-
init_context_api();
|
|
680
|
-
init_diag_api();
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
|
|
684
|
-
// src/index.ts
|
|
685
|
-
var src_exports = {};
|
|
686
|
-
__export(src_exports, {
|
|
687
|
-
nodeSDKBuilder: () => nodeSDKBuilder
|
|
688
|
-
});
|
|
689
|
-
module.exports = __toCommonJS(src_exports);
|
|
690
|
-
|
|
691
|
-
// src/tracing.ts
|
|
692
|
-
var import_process = __toESM(require("process"));
|
|
693
|
-
var import_sdk_node = require("@opentelemetry/sdk-node");
|
|
694
|
-
var import_instrumentation_graphql = require("@opentelemetry/instrumentation-graphql");
|
|
695
|
-
var import_instrumentation_aws_sdk = require("@opentelemetry/instrumentation-aws-sdk");
|
|
696
|
-
var import_id_generator_aws_xray = require("@opentelemetry/id-generator-aws-xray");
|
|
697
|
-
var import_propagator_aws_xray = require("@opentelemetry/propagator-aws-xray");
|
|
698
|
-
|
|
699
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/trace/suppress-tracing.js
|
|
700
|
-
init_esm();
|
|
701
|
-
var SUPPRESS_TRACING_KEY = createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");
|
|
702
|
-
function suppressTracing(context2) {
|
|
703
|
-
return context2.setValue(SUPPRESS_TRACING_KEY, true);
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js
|
|
707
|
-
init_esm();
|
|
708
|
-
function loggingErrorHandler() {
|
|
709
|
-
return function(ex) {
|
|
710
|
-
diag.error(stringifyException(ex));
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
function stringifyException(ex) {
|
|
714
|
-
if (typeof ex === "string") {
|
|
715
|
-
return ex;
|
|
716
|
-
} else {
|
|
717
|
-
return JSON.stringify(flattenException(ex));
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
function flattenException(ex) {
|
|
721
|
-
var result = {};
|
|
722
|
-
var current = ex;
|
|
723
|
-
while (current !== null) {
|
|
724
|
-
Object.getOwnPropertyNames(current).forEach(function(propertyName) {
|
|
725
|
-
if (result[propertyName])
|
|
726
|
-
return;
|
|
727
|
-
var value = current[propertyName];
|
|
728
|
-
if (value) {
|
|
729
|
-
result[propertyName] = String(value);
|
|
730
|
-
}
|
|
731
|
-
});
|
|
732
|
-
current = Object.getPrototypeOf(current);
|
|
733
|
-
}
|
|
734
|
-
return result;
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js
|
|
738
|
-
var delegateHandler = loggingErrorHandler();
|
|
739
|
-
function globalErrorHandler(ex) {
|
|
740
|
-
try {
|
|
741
|
-
delegateHandler(ex);
|
|
742
|
-
} catch (_a2) {
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/utils/environment.js
|
|
747
|
-
init_esm();
|
|
748
|
-
|
|
749
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/utils/sampling.js
|
|
750
|
-
var TracesSamplerValues;
|
|
751
|
-
(function(TracesSamplerValues2) {
|
|
752
|
-
TracesSamplerValues2["AlwaysOff"] = "always_off";
|
|
753
|
-
TracesSamplerValues2["AlwaysOn"] = "always_on";
|
|
754
|
-
TracesSamplerValues2["ParentBasedAlwaysOff"] = "parentbased_always_off";
|
|
755
|
-
TracesSamplerValues2["ParentBasedAlwaysOn"] = "parentbased_always_on";
|
|
756
|
-
TracesSamplerValues2["ParentBasedTraceIdRatio"] = "parentbased_traceidratio";
|
|
757
|
-
TracesSamplerValues2["TraceIdRatio"] = "traceidratio";
|
|
758
|
-
})(TracesSamplerValues || (TracesSamplerValues = {}));
|
|
379
|
+
return DiagAPI2;
|
|
380
|
+
}()
|
|
381
|
+
);
|
|
759
382
|
|
|
760
|
-
// ../../node_modules/.pnpm/@opentelemetry+
|
|
761
|
-
var
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
"OTEL_BSP_EXPORT_TIMEOUT",
|
|
768
|
-
"OTEL_BSP_MAX_EXPORT_BATCH_SIZE",
|
|
769
|
-
"OTEL_BSP_MAX_QUEUE_SIZE",
|
|
770
|
-
"OTEL_BSP_SCHEDULE_DELAY",
|
|
771
|
-
"OTEL_BLRP_EXPORT_TIMEOUT",
|
|
772
|
-
"OTEL_BLRP_MAX_EXPORT_BATCH_SIZE",
|
|
773
|
-
"OTEL_BLRP_MAX_QUEUE_SIZE",
|
|
774
|
-
"OTEL_BLRP_SCHEDULE_DELAY",
|
|
775
|
-
"OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT",
|
|
776
|
-
"OTEL_ATTRIBUTE_COUNT_LIMIT",
|
|
777
|
-
"OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT",
|
|
778
|
-
"OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT",
|
|
779
|
-
"OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT",
|
|
780
|
-
"OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT",
|
|
781
|
-
"OTEL_SPAN_EVENT_COUNT_LIMIT",
|
|
782
|
-
"OTEL_SPAN_LINK_COUNT_LIMIT",
|
|
783
|
-
"OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT",
|
|
784
|
-
"OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT",
|
|
785
|
-
"OTEL_EXPORTER_OTLP_TIMEOUT",
|
|
786
|
-
"OTEL_EXPORTER_OTLP_TRACES_TIMEOUT",
|
|
787
|
-
"OTEL_EXPORTER_OTLP_METRICS_TIMEOUT",
|
|
788
|
-
"OTEL_EXPORTER_OTLP_LOGS_TIMEOUT",
|
|
789
|
-
"OTEL_EXPORTER_JAEGER_AGENT_PORT"
|
|
790
|
-
];
|
|
791
|
-
function isEnvVarANumber(key) {
|
|
792
|
-
return ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1;
|
|
793
|
-
}
|
|
794
|
-
var ENVIRONMENT_LISTS_KEYS = [
|
|
795
|
-
"OTEL_NO_PATCH_MODULES",
|
|
796
|
-
"OTEL_PROPAGATORS"
|
|
383
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js
|
|
384
|
+
var consoleMap = [
|
|
385
|
+
{ n: "error", c: "error" },
|
|
386
|
+
{ n: "warn", c: "warn" },
|
|
387
|
+
{ n: "info", c: "info" },
|
|
388
|
+
{ n: "debug", c: "debug" },
|
|
389
|
+
{ n: "verbose", c: "trace" }
|
|
797
390
|
];
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
var
|
|
805
|
-
var
|
|
806
|
-
|
|
807
|
-
CONTAINER_NAME: "",
|
|
808
|
-
ECS_CONTAINER_METADATA_URI_V4: "",
|
|
809
|
-
ECS_CONTAINER_METADATA_URI: "",
|
|
810
|
-
HOSTNAME: "",
|
|
811
|
-
KUBERNETES_SERVICE_HOST: "",
|
|
812
|
-
NAMESPACE: "",
|
|
813
|
-
OTEL_BSP_EXPORT_TIMEOUT: 3e4,
|
|
814
|
-
OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512,
|
|
815
|
-
OTEL_BSP_MAX_QUEUE_SIZE: 2048,
|
|
816
|
-
OTEL_BSP_SCHEDULE_DELAY: 5e3,
|
|
817
|
-
OTEL_BLRP_EXPORT_TIMEOUT: 3e4,
|
|
818
|
-
OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: 512,
|
|
819
|
-
OTEL_BLRP_MAX_QUEUE_SIZE: 2048,
|
|
820
|
-
OTEL_BLRP_SCHEDULE_DELAY: 5e3,
|
|
821
|
-
OTEL_EXPORTER_JAEGER_AGENT_HOST: "",
|
|
822
|
-
OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832,
|
|
823
|
-
OTEL_EXPORTER_JAEGER_ENDPOINT: "",
|
|
824
|
-
OTEL_EXPORTER_JAEGER_PASSWORD: "",
|
|
825
|
-
OTEL_EXPORTER_JAEGER_USER: "",
|
|
826
|
-
OTEL_EXPORTER_OTLP_ENDPOINT: "",
|
|
827
|
-
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "",
|
|
828
|
-
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: "",
|
|
829
|
-
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: "",
|
|
830
|
-
OTEL_EXPORTER_OTLP_HEADERS: "",
|
|
831
|
-
OTEL_EXPORTER_OTLP_TRACES_HEADERS: "",
|
|
832
|
-
OTEL_EXPORTER_OTLP_METRICS_HEADERS: "",
|
|
833
|
-
OTEL_EXPORTER_OTLP_LOGS_HEADERS: "",
|
|
834
|
-
OTEL_EXPORTER_OTLP_TIMEOUT: 1e4,
|
|
835
|
-
OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 1e4,
|
|
836
|
-
OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 1e4,
|
|
837
|
-
OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: 1e4,
|
|
838
|
-
OTEL_EXPORTER_ZIPKIN_ENDPOINT: "http://localhost:9411/api/v2/spans",
|
|
839
|
-
OTEL_LOG_LEVEL: DiagLogLevel.INFO,
|
|
840
|
-
OTEL_NO_PATCH_MODULES: [],
|
|
841
|
-
OTEL_PROPAGATORS: ["tracecontext", "baggage"],
|
|
842
|
-
OTEL_RESOURCE_ATTRIBUTES: "",
|
|
843
|
-
OTEL_SERVICE_NAME: "",
|
|
844
|
-
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,
|
|
845
|
-
OTEL_ATTRIBUTE_COUNT_LIMIT: DEFAULT_ATTRIBUTE_COUNT_LIMIT,
|
|
846
|
-
OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,
|
|
847
|
-
OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: DEFAULT_ATTRIBUTE_COUNT_LIMIT,
|
|
848
|
-
OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT: DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,
|
|
849
|
-
OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT: DEFAULT_ATTRIBUTE_COUNT_LIMIT,
|
|
850
|
-
OTEL_SPAN_EVENT_COUNT_LIMIT: 128,
|
|
851
|
-
OTEL_SPAN_LINK_COUNT_LIMIT: 128,
|
|
852
|
-
OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT: DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,
|
|
853
|
-
OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT: DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,
|
|
854
|
-
OTEL_TRACES_EXPORTER: "",
|
|
855
|
-
OTEL_TRACES_SAMPLER: TracesSamplerValues.ParentBasedAlwaysOn,
|
|
856
|
-
OTEL_TRACES_SAMPLER_ARG: "",
|
|
857
|
-
OTEL_LOGS_EXPORTER: "",
|
|
858
|
-
OTEL_EXPORTER_OTLP_INSECURE: "",
|
|
859
|
-
OTEL_EXPORTER_OTLP_TRACES_INSECURE: "",
|
|
860
|
-
OTEL_EXPORTER_OTLP_METRICS_INSECURE: "",
|
|
861
|
-
OTEL_EXPORTER_OTLP_LOGS_INSECURE: "",
|
|
862
|
-
OTEL_EXPORTER_OTLP_CERTIFICATE: "",
|
|
863
|
-
OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: "",
|
|
864
|
-
OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: "",
|
|
865
|
-
OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE: "",
|
|
866
|
-
OTEL_EXPORTER_OTLP_COMPRESSION: "",
|
|
867
|
-
OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: "",
|
|
868
|
-
OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: "",
|
|
869
|
-
OTEL_EXPORTER_OTLP_LOGS_COMPRESSION: "",
|
|
870
|
-
OTEL_EXPORTER_OTLP_CLIENT_KEY: "",
|
|
871
|
-
OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: "",
|
|
872
|
-
OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: "",
|
|
873
|
-
OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY: "",
|
|
874
|
-
OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: "",
|
|
875
|
-
OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: "",
|
|
876
|
-
OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: "",
|
|
877
|
-
OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE: "",
|
|
878
|
-
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf",
|
|
879
|
-
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: "http/protobuf",
|
|
880
|
-
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL: "http/protobuf",
|
|
881
|
-
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: "http/protobuf",
|
|
882
|
-
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: "cumulative"
|
|
883
|
-
};
|
|
884
|
-
function parseBoolean(key, environment, values) {
|
|
885
|
-
if (typeof values[key] === "undefined") {
|
|
886
|
-
return;
|
|
887
|
-
}
|
|
888
|
-
var value = String(values[key]);
|
|
889
|
-
environment[key] = value.toLowerCase() === "true";
|
|
890
|
-
}
|
|
891
|
-
function parseNumber(name, environment, values, min, max) {
|
|
892
|
-
if (min === void 0) {
|
|
893
|
-
min = -Infinity;
|
|
894
|
-
}
|
|
895
|
-
if (max === void 0) {
|
|
896
|
-
max = Infinity;
|
|
897
|
-
}
|
|
898
|
-
if (typeof values[name] !== "undefined") {
|
|
899
|
-
var value = Number(values[name]);
|
|
900
|
-
if (!isNaN(value)) {
|
|
901
|
-
if (value < min) {
|
|
902
|
-
environment[name] = min;
|
|
903
|
-
} else if (value > max) {
|
|
904
|
-
environment[name] = max;
|
|
905
|
-
} else {
|
|
906
|
-
environment[name] = value;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
function parseStringList(name, output, input, separator) {
|
|
912
|
-
if (separator === void 0) {
|
|
913
|
-
separator = DEFAULT_LIST_SEPARATOR;
|
|
914
|
-
}
|
|
915
|
-
var givenValue = input[name];
|
|
916
|
-
if (typeof givenValue === "string") {
|
|
917
|
-
output[name] = givenValue.split(separator).map(function(v) {
|
|
918
|
-
return v.trim();
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
var logLevelMap = {
|
|
923
|
-
ALL: DiagLogLevel.ALL,
|
|
924
|
-
VERBOSE: DiagLogLevel.VERBOSE,
|
|
925
|
-
DEBUG: DiagLogLevel.DEBUG,
|
|
926
|
-
INFO: DiagLogLevel.INFO,
|
|
927
|
-
WARN: DiagLogLevel.WARN,
|
|
928
|
-
ERROR: DiagLogLevel.ERROR,
|
|
929
|
-
NONE: DiagLogLevel.NONE
|
|
930
|
-
};
|
|
931
|
-
function setLogLevelFromEnv(key, environment, values) {
|
|
932
|
-
var value = values[key];
|
|
933
|
-
if (typeof value === "string") {
|
|
934
|
-
var theLevel = logLevelMap[value.toUpperCase()];
|
|
935
|
-
if (theLevel != null) {
|
|
936
|
-
environment[key] = theLevel;
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
function parseEnvironment(values) {
|
|
941
|
-
var environment = {};
|
|
942
|
-
for (var env in DEFAULT_ENVIRONMENT) {
|
|
943
|
-
var key = env;
|
|
944
|
-
switch (key) {
|
|
945
|
-
case "OTEL_LOG_LEVEL":
|
|
946
|
-
setLogLevelFromEnv(key, environment, values);
|
|
947
|
-
break;
|
|
948
|
-
default:
|
|
949
|
-
if (isEnvVarABoolean(key)) {
|
|
950
|
-
parseBoolean(key, environment, values);
|
|
951
|
-
} else if (isEnvVarANumber(key)) {
|
|
952
|
-
parseNumber(key, environment, values);
|
|
953
|
-
} else if (isEnvVarAList(key)) {
|
|
954
|
-
parseStringList(key, environment, values);
|
|
955
|
-
} else {
|
|
956
|
-
var value = values[key];
|
|
957
|
-
if (typeof value !== "undefined" && value !== null) {
|
|
958
|
-
environment[key] = String(value);
|
|
391
|
+
var DiagConsoleLogger = (
|
|
392
|
+
/** @class */
|
|
393
|
+
/* @__PURE__ */ function() {
|
|
394
|
+
function DiagConsoleLogger2() {
|
|
395
|
+
function _consoleFunc(funcName) {
|
|
396
|
+
return function() {
|
|
397
|
+
var args = [];
|
|
398
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
399
|
+
args[_i] = arguments[_i];
|
|
959
400
|
}
|
|
960
|
-
|
|
401
|
+
if (console) {
|
|
402
|
+
var theFunc = console[funcName];
|
|
403
|
+
if (typeof theFunc !== "function") {
|
|
404
|
+
theFunc = console.log;
|
|
405
|
+
}
|
|
406
|
+
if (typeof theFunc === "function") {
|
|
407
|
+
return theFunc.apply(console, args);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
for (var i = 0; i < consoleMap.length; i++) {
|
|
413
|
+
this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
|
|
414
|
+
}
|
|
961
415
|
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
416
|
+
return DiagConsoleLogger2;
|
|
417
|
+
}()
|
|
418
|
+
);
|
|
965
419
|
|
|
966
|
-
// ../../node_modules/.pnpm/@opentelemetry+
|
|
967
|
-
|
|
968
|
-
var processEnv = parseEnvironment(process.env);
|
|
969
|
-
return Object.assign({}, DEFAULT_ENVIRONMENT, processEnv);
|
|
970
|
-
}
|
|
420
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.4.1/node_modules/@opentelemetry/api/build/esm/diag-api.js
|
|
421
|
+
var diag = DiagAPI.instance();
|
|
971
422
|
|
|
972
|
-
//
|
|
973
|
-
var
|
|
423
|
+
// src/tracing.ts
|
|
424
|
+
var import_instrumentation_express = require("@opentelemetry/instrumentation-express");
|
|
425
|
+
var import_instrumentation_http = require("@opentelemetry/instrumentation-http");
|
|
426
|
+
var import_instrumentation_knex = require("@opentelemetry/instrumentation-knex");
|
|
427
|
+
var import_instrumentation_mysql2 = require("@opentelemetry/instrumentation-mysql2");
|
|
428
|
+
var import_instrumentation_net = require("@opentelemetry/instrumentation-net");
|
|
429
|
+
var import_exporter_trace_otlp_grpc = require("@opentelemetry/exporter-trace-otlp-grpc");
|
|
430
|
+
var import_instrumentation = require("@prisma/instrumentation");
|
|
431
|
+
var import_resources = require("@opentelemetry/resources");
|
|
974
432
|
|
|
975
433
|
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.24.0/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js
|
|
976
434
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1068,10 +526,6 @@ var TMP_TELEMETRY_AUTO_VERSION = "telemetry.auto.version";
|
|
|
1068
526
|
var TMP_WEBENGINE_NAME = "webengine.name";
|
|
1069
527
|
var TMP_WEBENGINE_VERSION = "webengine.version";
|
|
1070
528
|
var TMP_WEBENGINE_DESCRIPTION = "webengine.description";
|
|
1071
|
-
var SEMRESATTRS_SERVICE_NAME = TMP_SERVICE_NAME;
|
|
1072
|
-
var SEMRESATTRS_TELEMETRY_SDK_NAME = TMP_TELEMETRY_SDK_NAME;
|
|
1073
|
-
var SEMRESATTRS_TELEMETRY_SDK_LANGUAGE = TMP_TELEMETRY_SDK_LANGUAGE;
|
|
1074
|
-
var SEMRESATTRS_TELEMETRY_SDK_VERSION = TMP_TELEMETRY_SDK_VERSION;
|
|
1075
529
|
var SemanticResourceAttributes = /* @__PURE__ */ createConstMap([
|
|
1076
530
|
TMP_CLOUD_PROVIDER,
|
|
1077
531
|
TMP_CLOUD_ACCOUNT_ID,
|
|
@@ -1155,772 +609,19 @@ var SemanticResourceAttributes = /* @__PURE__ */ createConstMap([
|
|
|
1155
609
|
TMP_WEBENGINE_VERSION,
|
|
1156
610
|
TMP_WEBENGINE_DESCRIPTION
|
|
1157
611
|
]);
|
|
1158
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_CPP = "cpp";
|
|
1159
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET = "dotnet";
|
|
1160
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG = "erlang";
|
|
1161
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_GO = "go";
|
|
1162
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA = "java";
|
|
1163
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS = "nodejs";
|
|
1164
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_PHP = "php";
|
|
1165
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON = "python";
|
|
1166
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY = "ruby";
|
|
1167
|
-
var TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS = "webjs";
|
|
1168
|
-
var TelemetrySdkLanguageValues = /* @__PURE__ */ createConstMap([
|
|
1169
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_CPP,
|
|
1170
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_DOTNET,
|
|
1171
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_ERLANG,
|
|
1172
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_GO,
|
|
1173
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_JAVA,
|
|
1174
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_NODEJS,
|
|
1175
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_PHP,
|
|
1176
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_PYTHON,
|
|
1177
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_RUBY,
|
|
1178
|
-
TMP_TELEMETRYSDKLANGUAGEVALUES_WEBJS
|
|
1179
|
-
]);
|
|
1180
|
-
|
|
1181
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/platform/node/sdk-info.js
|
|
1182
|
-
var _a;
|
|
1183
|
-
var SDK_INFO = (_a = {}, _a[SemanticResourceAttributes.TELEMETRY_SDK_NAME] = "opentelemetry", _a[SemanticResourceAttributes.PROCESS_RUNTIME_NAME] = "node", _a[SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE] = TelemetrySdkLanguageValues.NODEJS, _a[SemanticResourceAttributes.TELEMETRY_SDK_VERSION] = VERSION2, _a);
|
|
1184
|
-
|
|
1185
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/platform/node/timer-util.js
|
|
1186
|
-
function unrefTimer(timer) {
|
|
1187
|
-
timer.unref();
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/ExportResult.js
|
|
1191
|
-
var ExportResultCode;
|
|
1192
|
-
(function(ExportResultCode2) {
|
|
1193
|
-
ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS";
|
|
1194
|
-
ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED";
|
|
1195
|
-
})(ExportResultCode || (ExportResultCode = {}));
|
|
1196
|
-
|
|
1197
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/utils/promise.js
|
|
1198
|
-
var Deferred = (
|
|
1199
|
-
/** @class */
|
|
1200
|
-
function() {
|
|
1201
|
-
function Deferred2() {
|
|
1202
|
-
var _this = this;
|
|
1203
|
-
this._promise = new Promise(function(resolve, reject) {
|
|
1204
|
-
_this._resolve = resolve;
|
|
1205
|
-
_this._reject = reject;
|
|
1206
|
-
});
|
|
1207
|
-
}
|
|
1208
|
-
Object.defineProperty(Deferred2.prototype, "promise", {
|
|
1209
|
-
get: function() {
|
|
1210
|
-
return this._promise;
|
|
1211
|
-
},
|
|
1212
|
-
enumerable: false,
|
|
1213
|
-
configurable: true
|
|
1214
|
-
});
|
|
1215
|
-
Deferred2.prototype.resolve = function(val) {
|
|
1216
|
-
this._resolve(val);
|
|
1217
|
-
};
|
|
1218
|
-
Deferred2.prototype.reject = function(err) {
|
|
1219
|
-
this._reject(err);
|
|
1220
|
-
};
|
|
1221
|
-
return Deferred2;
|
|
1222
|
-
}()
|
|
1223
|
-
);
|
|
1224
|
-
|
|
1225
|
-
// ../../node_modules/.pnpm/@opentelemetry+core@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/core/build/esm/utils/callback.js
|
|
1226
|
-
var __read5 = function(o, n) {
|
|
1227
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1228
|
-
if (!m)
|
|
1229
|
-
return o;
|
|
1230
|
-
var i = m.call(o), r, ar = [], e;
|
|
1231
|
-
try {
|
|
1232
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
1233
|
-
ar.push(r.value);
|
|
1234
|
-
} catch (error) {
|
|
1235
|
-
e = { error };
|
|
1236
|
-
} finally {
|
|
1237
|
-
try {
|
|
1238
|
-
if (r && !r.done && (m = i["return"]))
|
|
1239
|
-
m.call(i);
|
|
1240
|
-
} finally {
|
|
1241
|
-
if (e)
|
|
1242
|
-
throw e.error;
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
return ar;
|
|
1246
|
-
};
|
|
1247
|
-
var __spreadArray5 = function(to, from, pack) {
|
|
1248
|
-
if (pack || arguments.length === 2)
|
|
1249
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1250
|
-
if (ar || !(i in from)) {
|
|
1251
|
-
if (!ar)
|
|
1252
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
1253
|
-
ar[i] = from[i];
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1257
|
-
};
|
|
1258
|
-
var BindOnceFuture = (
|
|
1259
|
-
/** @class */
|
|
1260
|
-
function() {
|
|
1261
|
-
function BindOnceFuture2(_callback, _that) {
|
|
1262
|
-
this._callback = _callback;
|
|
1263
|
-
this._that = _that;
|
|
1264
|
-
this._isCalled = false;
|
|
1265
|
-
this._deferred = new Deferred();
|
|
1266
|
-
}
|
|
1267
|
-
Object.defineProperty(BindOnceFuture2.prototype, "isCalled", {
|
|
1268
|
-
get: function() {
|
|
1269
|
-
return this._isCalled;
|
|
1270
|
-
},
|
|
1271
|
-
enumerable: false,
|
|
1272
|
-
configurable: true
|
|
1273
|
-
});
|
|
1274
|
-
Object.defineProperty(BindOnceFuture2.prototype, "promise", {
|
|
1275
|
-
get: function() {
|
|
1276
|
-
return this._deferred.promise;
|
|
1277
|
-
},
|
|
1278
|
-
enumerable: false,
|
|
1279
|
-
configurable: true
|
|
1280
|
-
});
|
|
1281
|
-
BindOnceFuture2.prototype.call = function() {
|
|
1282
|
-
var _a2;
|
|
1283
|
-
var _this = this;
|
|
1284
|
-
var args = [];
|
|
1285
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1286
|
-
args[_i] = arguments[_i];
|
|
1287
|
-
}
|
|
1288
|
-
if (!this._isCalled) {
|
|
1289
|
-
this._isCalled = true;
|
|
1290
|
-
try {
|
|
1291
|
-
Promise.resolve((_a2 = this._callback).call.apply(_a2, __spreadArray5([this._that], __read5(args), false))).then(function(val) {
|
|
1292
|
-
return _this._deferred.resolve(val);
|
|
1293
|
-
}, function(err) {
|
|
1294
|
-
return _this._deferred.reject(err);
|
|
1295
|
-
});
|
|
1296
|
-
} catch (err) {
|
|
1297
|
-
this._deferred.reject(err);
|
|
1298
|
-
}
|
|
1299
|
-
}
|
|
1300
|
-
return this._deferred.promise;
|
|
1301
|
-
};
|
|
1302
|
-
return BindOnceFuture2;
|
|
1303
|
-
}()
|
|
1304
|
-
);
|
|
1305
|
-
|
|
1306
|
-
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/BatchSpanProcessorBase.js
|
|
1307
|
-
init_esm();
|
|
1308
|
-
var BatchSpanProcessorBase = (
|
|
1309
|
-
/** @class */
|
|
1310
|
-
function() {
|
|
1311
|
-
function BatchSpanProcessorBase2(_exporter, config) {
|
|
1312
|
-
this._exporter = _exporter;
|
|
1313
|
-
this._isExporting = false;
|
|
1314
|
-
this._finishedSpans = [];
|
|
1315
|
-
this._droppedSpansCount = 0;
|
|
1316
|
-
var env = getEnv();
|
|
1317
|
-
this._maxExportBatchSize = typeof (config === null || config === void 0 ? void 0 : config.maxExportBatchSize) === "number" ? config.maxExportBatchSize : env.OTEL_BSP_MAX_EXPORT_BATCH_SIZE;
|
|
1318
|
-
this._maxQueueSize = typeof (config === null || config === void 0 ? void 0 : config.maxQueueSize) === "number" ? config.maxQueueSize : env.OTEL_BSP_MAX_QUEUE_SIZE;
|
|
1319
|
-
this._scheduledDelayMillis = typeof (config === null || config === void 0 ? void 0 : config.scheduledDelayMillis) === "number" ? config.scheduledDelayMillis : env.OTEL_BSP_SCHEDULE_DELAY;
|
|
1320
|
-
this._exportTimeoutMillis = typeof (config === null || config === void 0 ? void 0 : config.exportTimeoutMillis) === "number" ? config.exportTimeoutMillis : env.OTEL_BSP_EXPORT_TIMEOUT;
|
|
1321
|
-
this._shutdownOnce = new BindOnceFuture(this._shutdown, this);
|
|
1322
|
-
if (this._maxExportBatchSize > this._maxQueueSize) {
|
|
1323
|
-
diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize");
|
|
1324
|
-
this._maxExportBatchSize = this._maxQueueSize;
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
BatchSpanProcessorBase2.prototype.forceFlush = function() {
|
|
1328
|
-
if (this._shutdownOnce.isCalled) {
|
|
1329
|
-
return this._shutdownOnce.promise;
|
|
1330
|
-
}
|
|
1331
|
-
return this._flushAll();
|
|
1332
|
-
};
|
|
1333
|
-
BatchSpanProcessorBase2.prototype.onStart = function(_span, _parentContext) {
|
|
1334
|
-
};
|
|
1335
|
-
BatchSpanProcessorBase2.prototype.onEnd = function(span) {
|
|
1336
|
-
if (this._shutdownOnce.isCalled) {
|
|
1337
|
-
return;
|
|
1338
|
-
}
|
|
1339
|
-
if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) {
|
|
1340
|
-
return;
|
|
1341
|
-
}
|
|
1342
|
-
this._addToBuffer(span);
|
|
1343
|
-
};
|
|
1344
|
-
BatchSpanProcessorBase2.prototype.shutdown = function() {
|
|
1345
|
-
return this._shutdownOnce.call();
|
|
1346
|
-
};
|
|
1347
|
-
BatchSpanProcessorBase2.prototype._shutdown = function() {
|
|
1348
|
-
var _this = this;
|
|
1349
|
-
return Promise.resolve().then(function() {
|
|
1350
|
-
return _this.onShutdown();
|
|
1351
|
-
}).then(function() {
|
|
1352
|
-
return _this._flushAll();
|
|
1353
|
-
}).then(function() {
|
|
1354
|
-
return _this._exporter.shutdown();
|
|
1355
|
-
});
|
|
1356
|
-
};
|
|
1357
|
-
BatchSpanProcessorBase2.prototype._addToBuffer = function(span) {
|
|
1358
|
-
if (this._finishedSpans.length >= this._maxQueueSize) {
|
|
1359
|
-
if (this._droppedSpansCount === 0) {
|
|
1360
|
-
diag.debug("maxQueueSize reached, dropping spans");
|
|
1361
|
-
}
|
|
1362
|
-
this._droppedSpansCount++;
|
|
1363
|
-
return;
|
|
1364
|
-
}
|
|
1365
|
-
if (this._droppedSpansCount > 0) {
|
|
1366
|
-
diag.warn("Dropped " + this._droppedSpansCount + " spans because maxQueueSize reached");
|
|
1367
|
-
this._droppedSpansCount = 0;
|
|
1368
|
-
}
|
|
1369
|
-
this._finishedSpans.push(span);
|
|
1370
|
-
this._maybeStartTimer();
|
|
1371
|
-
};
|
|
1372
|
-
BatchSpanProcessorBase2.prototype._flushAll = function() {
|
|
1373
|
-
var _this = this;
|
|
1374
|
-
return new Promise(function(resolve, reject) {
|
|
1375
|
-
var promises = [];
|
|
1376
|
-
var count = Math.ceil(_this._finishedSpans.length / _this._maxExportBatchSize);
|
|
1377
|
-
for (var i = 0, j = count; i < j; i++) {
|
|
1378
|
-
promises.push(_this._flushOneBatch());
|
|
1379
|
-
}
|
|
1380
|
-
Promise.all(promises).then(function() {
|
|
1381
|
-
resolve();
|
|
1382
|
-
}).catch(reject);
|
|
1383
|
-
});
|
|
1384
|
-
};
|
|
1385
|
-
BatchSpanProcessorBase2.prototype._flushOneBatch = function() {
|
|
1386
|
-
var _this = this;
|
|
1387
|
-
this._clearTimer();
|
|
1388
|
-
if (this._finishedSpans.length === 0) {
|
|
1389
|
-
return Promise.resolve();
|
|
1390
|
-
}
|
|
1391
|
-
return new Promise(function(resolve, reject) {
|
|
1392
|
-
var timer = setTimeout(function() {
|
|
1393
|
-
reject(new Error("Timeout"));
|
|
1394
|
-
}, _this._exportTimeoutMillis);
|
|
1395
|
-
context.with(suppressTracing(context.active()), function() {
|
|
1396
|
-
var spans;
|
|
1397
|
-
if (_this._finishedSpans.length <= _this._maxExportBatchSize) {
|
|
1398
|
-
spans = _this._finishedSpans;
|
|
1399
|
-
_this._finishedSpans = [];
|
|
1400
|
-
} else {
|
|
1401
|
-
spans = _this._finishedSpans.splice(0, _this._maxExportBatchSize);
|
|
1402
|
-
}
|
|
1403
|
-
var doExport = function() {
|
|
1404
|
-
return _this._exporter.export(spans, function(result) {
|
|
1405
|
-
var _a2;
|
|
1406
|
-
clearTimeout(timer);
|
|
1407
|
-
if (result.code === ExportResultCode.SUCCESS) {
|
|
1408
|
-
resolve();
|
|
1409
|
-
} else {
|
|
1410
|
-
reject((_a2 = result.error) !== null && _a2 !== void 0 ? _a2 : new Error("BatchSpanProcessor: span export failed"));
|
|
1411
|
-
}
|
|
1412
|
-
});
|
|
1413
|
-
};
|
|
1414
|
-
var pendingResources = null;
|
|
1415
|
-
for (var i = 0, len = spans.length; i < len; i++) {
|
|
1416
|
-
var span = spans[i];
|
|
1417
|
-
if (span.resource.asyncAttributesPending && span.resource.waitForAsyncAttributes) {
|
|
1418
|
-
pendingResources !== null && pendingResources !== void 0 ? pendingResources : pendingResources = [];
|
|
1419
|
-
pendingResources.push(span.resource.waitForAsyncAttributes());
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
if (pendingResources === null) {
|
|
1423
|
-
doExport();
|
|
1424
|
-
} else {
|
|
1425
|
-
Promise.all(pendingResources).then(doExport, function(err) {
|
|
1426
|
-
globalErrorHandler(err);
|
|
1427
|
-
reject(err);
|
|
1428
|
-
});
|
|
1429
|
-
}
|
|
1430
|
-
});
|
|
1431
|
-
});
|
|
1432
|
-
};
|
|
1433
|
-
BatchSpanProcessorBase2.prototype._maybeStartTimer = function() {
|
|
1434
|
-
var _this = this;
|
|
1435
|
-
if (this._isExporting)
|
|
1436
|
-
return;
|
|
1437
|
-
var flush = function() {
|
|
1438
|
-
_this._isExporting = true;
|
|
1439
|
-
_this._flushOneBatch().finally(function() {
|
|
1440
|
-
_this._isExporting = false;
|
|
1441
|
-
if (_this._finishedSpans.length > 0) {
|
|
1442
|
-
_this._clearTimer();
|
|
1443
|
-
_this._maybeStartTimer();
|
|
1444
|
-
}
|
|
1445
|
-
}).catch(function(e) {
|
|
1446
|
-
_this._isExporting = false;
|
|
1447
|
-
globalErrorHandler(e);
|
|
1448
|
-
});
|
|
1449
|
-
};
|
|
1450
|
-
if (this._finishedSpans.length >= this._maxExportBatchSize) {
|
|
1451
|
-
return flush();
|
|
1452
|
-
}
|
|
1453
|
-
if (this._timer !== void 0)
|
|
1454
|
-
return;
|
|
1455
|
-
this._timer = setTimeout(function() {
|
|
1456
|
-
return flush();
|
|
1457
|
-
}, this._scheduledDelayMillis);
|
|
1458
|
-
unrefTimer(this._timer);
|
|
1459
|
-
};
|
|
1460
|
-
BatchSpanProcessorBase2.prototype._clearTimer = function() {
|
|
1461
|
-
if (this._timer !== void 0) {
|
|
1462
|
-
clearTimeout(this._timer);
|
|
1463
|
-
this._timer = void 0;
|
|
1464
|
-
}
|
|
1465
|
-
};
|
|
1466
|
-
return BatchSpanProcessorBase2;
|
|
1467
|
-
}()
|
|
1468
|
-
);
|
|
1469
|
-
|
|
1470
|
-
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/export/BatchSpanProcessor.js
|
|
1471
|
-
var __extends = /* @__PURE__ */ function() {
|
|
1472
|
-
var extendStatics = function(d, b) {
|
|
1473
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
1474
|
-
d2.__proto__ = b2;
|
|
1475
|
-
} || function(d2, b2) {
|
|
1476
|
-
for (var p in b2)
|
|
1477
|
-
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
1478
|
-
d2[p] = b2[p];
|
|
1479
|
-
};
|
|
1480
|
-
return extendStatics(d, b);
|
|
1481
|
-
};
|
|
1482
|
-
return function(d, b) {
|
|
1483
|
-
if (typeof b !== "function" && b !== null)
|
|
1484
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1485
|
-
extendStatics(d, b);
|
|
1486
|
-
function __() {
|
|
1487
|
-
this.constructor = d;
|
|
1488
|
-
}
|
|
1489
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1490
|
-
};
|
|
1491
|
-
}();
|
|
1492
|
-
var BatchSpanProcessor = (
|
|
1493
|
-
/** @class */
|
|
1494
|
-
function(_super) {
|
|
1495
|
-
__extends(BatchSpanProcessor2, _super);
|
|
1496
|
-
function BatchSpanProcessor2() {
|
|
1497
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1498
|
-
}
|
|
1499
|
-
BatchSpanProcessor2.prototype.onShutdown = function() {
|
|
1500
|
-
};
|
|
1501
|
-
return BatchSpanProcessor2;
|
|
1502
|
-
}(BatchSpanProcessorBase)
|
|
1503
|
-
);
|
|
1504
|
-
|
|
1505
|
-
// ../../node_modules/.pnpm/@opentelemetry+resources@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/resources/build/esm/Resource.js
|
|
1506
|
-
init_esm();
|
|
1507
|
-
|
|
1508
|
-
// ../../node_modules/.pnpm/@opentelemetry+resources@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js
|
|
1509
|
-
function defaultServiceName() {
|
|
1510
|
-
return "unknown_service:" + process.argv0;
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
// ../../node_modules/.pnpm/@opentelemetry+resources@1.24.0_@opentelemetry+api@1.8.0/node_modules/@opentelemetry/resources/build/esm/Resource.js
|
|
1514
|
-
var __assign = function() {
|
|
1515
|
-
__assign = Object.assign || function(t) {
|
|
1516
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1517
|
-
s = arguments[i];
|
|
1518
|
-
for (var p in s)
|
|
1519
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1520
|
-
t[p] = s[p];
|
|
1521
|
-
}
|
|
1522
|
-
return t;
|
|
1523
|
-
};
|
|
1524
|
-
return __assign.apply(this, arguments);
|
|
1525
|
-
};
|
|
1526
|
-
var __awaiter = function(thisArg, _arguments, P, generator) {
|
|
1527
|
-
function adopt(value) {
|
|
1528
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
1529
|
-
resolve(value);
|
|
1530
|
-
});
|
|
1531
|
-
}
|
|
1532
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
1533
|
-
function fulfilled(value) {
|
|
1534
|
-
try {
|
|
1535
|
-
step(generator.next(value));
|
|
1536
|
-
} catch (e) {
|
|
1537
|
-
reject(e);
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
function rejected(value) {
|
|
1541
|
-
try {
|
|
1542
|
-
step(generator["throw"](value));
|
|
1543
|
-
} catch (e) {
|
|
1544
|
-
reject(e);
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
function step(result) {
|
|
1548
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
1549
|
-
}
|
|
1550
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
1551
|
-
});
|
|
1552
|
-
};
|
|
1553
|
-
var __generator = function(thisArg, body) {
|
|
1554
|
-
var _ = { label: 0, sent: function() {
|
|
1555
|
-
if (t[0] & 1)
|
|
1556
|
-
throw t[1];
|
|
1557
|
-
return t[1];
|
|
1558
|
-
}, trys: [], ops: [] }, f, y, t, g;
|
|
1559
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
1560
|
-
return this;
|
|
1561
|
-
}), g;
|
|
1562
|
-
function verb(n) {
|
|
1563
|
-
return function(v) {
|
|
1564
|
-
return step([n, v]);
|
|
1565
|
-
};
|
|
1566
|
-
}
|
|
1567
|
-
function step(op) {
|
|
1568
|
-
if (f)
|
|
1569
|
-
throw new TypeError("Generator is already executing.");
|
|
1570
|
-
while (_)
|
|
1571
|
-
try {
|
|
1572
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
1573
|
-
return t;
|
|
1574
|
-
if (y = 0, t)
|
|
1575
|
-
op = [op[0] & 2, t.value];
|
|
1576
|
-
switch (op[0]) {
|
|
1577
|
-
case 0:
|
|
1578
|
-
case 1:
|
|
1579
|
-
t = op;
|
|
1580
|
-
break;
|
|
1581
|
-
case 4:
|
|
1582
|
-
_.label++;
|
|
1583
|
-
return { value: op[1], done: false };
|
|
1584
|
-
case 5:
|
|
1585
|
-
_.label++;
|
|
1586
|
-
y = op[1];
|
|
1587
|
-
op = [0];
|
|
1588
|
-
continue;
|
|
1589
|
-
case 7:
|
|
1590
|
-
op = _.ops.pop();
|
|
1591
|
-
_.trys.pop();
|
|
1592
|
-
continue;
|
|
1593
|
-
default:
|
|
1594
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
1595
|
-
_ = 0;
|
|
1596
|
-
continue;
|
|
1597
|
-
}
|
|
1598
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
1599
|
-
_.label = op[1];
|
|
1600
|
-
break;
|
|
1601
|
-
}
|
|
1602
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
1603
|
-
_.label = t[1];
|
|
1604
|
-
t = op;
|
|
1605
|
-
break;
|
|
1606
|
-
}
|
|
1607
|
-
if (t && _.label < t[2]) {
|
|
1608
|
-
_.label = t[2];
|
|
1609
|
-
_.ops.push(op);
|
|
1610
|
-
break;
|
|
1611
|
-
}
|
|
1612
|
-
if (t[2])
|
|
1613
|
-
_.ops.pop();
|
|
1614
|
-
_.trys.pop();
|
|
1615
|
-
continue;
|
|
1616
|
-
}
|
|
1617
|
-
op = body.call(thisArg, _);
|
|
1618
|
-
} catch (e) {
|
|
1619
|
-
op = [6, e];
|
|
1620
|
-
y = 0;
|
|
1621
|
-
} finally {
|
|
1622
|
-
f = t = 0;
|
|
1623
|
-
}
|
|
1624
|
-
if (op[0] & 5)
|
|
1625
|
-
throw op[1];
|
|
1626
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
1627
|
-
}
|
|
1628
|
-
};
|
|
1629
|
-
var __read6 = function(o, n) {
|
|
1630
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
1631
|
-
if (!m)
|
|
1632
|
-
return o;
|
|
1633
|
-
var i = m.call(o), r, ar = [], e;
|
|
1634
|
-
try {
|
|
1635
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
1636
|
-
ar.push(r.value);
|
|
1637
|
-
} catch (error) {
|
|
1638
|
-
e = { error };
|
|
1639
|
-
} finally {
|
|
1640
|
-
try {
|
|
1641
|
-
if (r && !r.done && (m = i["return"]))
|
|
1642
|
-
m.call(i);
|
|
1643
|
-
} finally {
|
|
1644
|
-
if (e)
|
|
1645
|
-
throw e.error;
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
return ar;
|
|
1649
|
-
};
|
|
1650
|
-
var Resource = (
|
|
1651
|
-
/** @class */
|
|
1652
|
-
function() {
|
|
1653
|
-
function Resource2(attributes, asyncAttributesPromise) {
|
|
1654
|
-
var _this = this;
|
|
1655
|
-
var _a2;
|
|
1656
|
-
this._attributes = attributes;
|
|
1657
|
-
this.asyncAttributesPending = asyncAttributesPromise != null;
|
|
1658
|
-
this._syncAttributes = (_a2 = this._attributes) !== null && _a2 !== void 0 ? _a2 : {};
|
|
1659
|
-
this._asyncAttributesPromise = asyncAttributesPromise === null || asyncAttributesPromise === void 0 ? void 0 : asyncAttributesPromise.then(function(asyncAttributes) {
|
|
1660
|
-
_this._attributes = Object.assign({}, _this._attributes, asyncAttributes);
|
|
1661
|
-
_this.asyncAttributesPending = false;
|
|
1662
|
-
return asyncAttributes;
|
|
1663
|
-
}, function(err) {
|
|
1664
|
-
diag.debug("a resource's async attributes promise rejected: %s", err);
|
|
1665
|
-
_this.asyncAttributesPending = false;
|
|
1666
|
-
return {};
|
|
1667
|
-
});
|
|
1668
|
-
}
|
|
1669
|
-
Resource2.empty = function() {
|
|
1670
|
-
return Resource2.EMPTY;
|
|
1671
|
-
};
|
|
1672
|
-
Resource2.default = function() {
|
|
1673
|
-
var _a2;
|
|
1674
|
-
return new Resource2((_a2 = {}, _a2[SEMRESATTRS_SERVICE_NAME] = defaultServiceName(), _a2[SEMRESATTRS_TELEMETRY_SDK_LANGUAGE] = SDK_INFO[SEMRESATTRS_TELEMETRY_SDK_LANGUAGE], _a2[SEMRESATTRS_TELEMETRY_SDK_NAME] = SDK_INFO[SEMRESATTRS_TELEMETRY_SDK_NAME], _a2[SEMRESATTRS_TELEMETRY_SDK_VERSION] = SDK_INFO[SEMRESATTRS_TELEMETRY_SDK_VERSION], _a2));
|
|
1675
|
-
};
|
|
1676
|
-
Object.defineProperty(Resource2.prototype, "attributes", {
|
|
1677
|
-
get: function() {
|
|
1678
|
-
var _a2;
|
|
1679
|
-
if (this.asyncAttributesPending) {
|
|
1680
|
-
diag.error("Accessing resource attributes before async attributes settled");
|
|
1681
|
-
}
|
|
1682
|
-
return (_a2 = this._attributes) !== null && _a2 !== void 0 ? _a2 : {};
|
|
1683
|
-
},
|
|
1684
|
-
enumerable: false,
|
|
1685
|
-
configurable: true
|
|
1686
|
-
});
|
|
1687
|
-
Resource2.prototype.waitForAsyncAttributes = function() {
|
|
1688
|
-
return __awaiter(this, void 0, void 0, function() {
|
|
1689
|
-
return __generator(this, function(_a2) {
|
|
1690
|
-
switch (_a2.label) {
|
|
1691
|
-
case 0:
|
|
1692
|
-
if (!this.asyncAttributesPending)
|
|
1693
|
-
return [3, 2];
|
|
1694
|
-
return [4, this._asyncAttributesPromise];
|
|
1695
|
-
case 1:
|
|
1696
|
-
_a2.sent();
|
|
1697
|
-
_a2.label = 2;
|
|
1698
|
-
case 2:
|
|
1699
|
-
return [
|
|
1700
|
-
2
|
|
1701
|
-
/*return*/
|
|
1702
|
-
];
|
|
1703
|
-
}
|
|
1704
|
-
});
|
|
1705
|
-
});
|
|
1706
|
-
};
|
|
1707
|
-
Resource2.prototype.merge = function(other) {
|
|
1708
|
-
var _this = this;
|
|
1709
|
-
var _a2;
|
|
1710
|
-
if (!other)
|
|
1711
|
-
return this;
|
|
1712
|
-
var mergedSyncAttributes = __assign(__assign({}, this._syncAttributes), (_a2 = other._syncAttributes) !== null && _a2 !== void 0 ? _a2 : other.attributes);
|
|
1713
|
-
if (!this._asyncAttributesPromise && !other._asyncAttributesPromise) {
|
|
1714
|
-
return new Resource2(mergedSyncAttributes);
|
|
1715
|
-
}
|
|
1716
|
-
var mergedAttributesPromise = Promise.all([
|
|
1717
|
-
this._asyncAttributesPromise,
|
|
1718
|
-
other._asyncAttributesPromise
|
|
1719
|
-
]).then(function(_a3) {
|
|
1720
|
-
var _b;
|
|
1721
|
-
var _c = __read6(_a3, 2), thisAsyncAttributes = _c[0], otherAsyncAttributes = _c[1];
|
|
1722
|
-
return __assign(__assign(__assign(__assign({}, _this._syncAttributes), thisAsyncAttributes), (_b = other._syncAttributes) !== null && _b !== void 0 ? _b : other.attributes), otherAsyncAttributes);
|
|
1723
|
-
});
|
|
1724
|
-
return new Resource2(mergedSyncAttributes, mergedAttributesPromise);
|
|
1725
|
-
};
|
|
1726
|
-
Resource2.EMPTY = new Resource2({});
|
|
1727
|
-
return Resource2;
|
|
1728
|
-
}()
|
|
1729
|
-
);
|
|
1730
|
-
|
|
1731
|
-
// src/tracing.ts
|
|
1732
|
-
var import_instrumentation_dataloader = require("@opentelemetry/instrumentation-dataloader");
|
|
1733
|
-
init_esm();
|
|
1734
|
-
var import_instrumentation_express = require("@opentelemetry/instrumentation-express");
|
|
1735
|
-
var import_instrumentation_http = require("@opentelemetry/instrumentation-http");
|
|
1736
|
-
var import_instrumentation_knex = require("@opentelemetry/instrumentation-knex");
|
|
1737
|
-
var import_instrumentation_mysql2 = require("@opentelemetry/instrumentation-mysql2");
|
|
1738
|
-
var import_instrumentation_net = require("@opentelemetry/instrumentation-net");
|
|
1739
|
-
var import_exporter_trace_otlp_grpc = require("@opentelemetry/exporter-trace-otlp-grpc");
|
|
1740
|
-
|
|
1741
|
-
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.23.0/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js
|
|
1742
|
-
// @__NO_SIDE_EFFECTS__
|
|
1743
|
-
function createConstMap2(values) {
|
|
1744
|
-
var res = {};
|
|
1745
|
-
var len = values.length;
|
|
1746
|
-
for (var lp = 0; lp < len; lp++) {
|
|
1747
|
-
var val = values[lp];
|
|
1748
|
-
if (val) {
|
|
1749
|
-
res[String(val).toUpperCase().replace(/[-.]/g, "_")] = val;
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
return res;
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.23.0/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js
|
|
1756
|
-
var TMP_CLOUD_PROVIDER2 = "cloud.provider";
|
|
1757
|
-
var TMP_CLOUD_ACCOUNT_ID2 = "cloud.account.id";
|
|
1758
|
-
var TMP_CLOUD_REGION2 = "cloud.region";
|
|
1759
|
-
var TMP_CLOUD_AVAILABILITY_ZONE2 = "cloud.availability_zone";
|
|
1760
|
-
var TMP_CLOUD_PLATFORM2 = "cloud.platform";
|
|
1761
|
-
var TMP_AWS_ECS_CONTAINER_ARN2 = "aws.ecs.container.arn";
|
|
1762
|
-
var TMP_AWS_ECS_CLUSTER_ARN2 = "aws.ecs.cluster.arn";
|
|
1763
|
-
var TMP_AWS_ECS_LAUNCHTYPE2 = "aws.ecs.launchtype";
|
|
1764
|
-
var TMP_AWS_ECS_TASK_ARN2 = "aws.ecs.task.arn";
|
|
1765
|
-
var TMP_AWS_ECS_TASK_FAMILY2 = "aws.ecs.task.family";
|
|
1766
|
-
var TMP_AWS_ECS_TASK_REVISION2 = "aws.ecs.task.revision";
|
|
1767
|
-
var TMP_AWS_EKS_CLUSTER_ARN2 = "aws.eks.cluster.arn";
|
|
1768
|
-
var TMP_AWS_LOG_GROUP_NAMES2 = "aws.log.group.names";
|
|
1769
|
-
var TMP_AWS_LOG_GROUP_ARNS2 = "aws.log.group.arns";
|
|
1770
|
-
var TMP_AWS_LOG_STREAM_NAMES2 = "aws.log.stream.names";
|
|
1771
|
-
var TMP_AWS_LOG_STREAM_ARNS2 = "aws.log.stream.arns";
|
|
1772
|
-
var TMP_CONTAINER_NAME2 = "container.name";
|
|
1773
|
-
var TMP_CONTAINER_ID2 = "container.id";
|
|
1774
|
-
var TMP_CONTAINER_RUNTIME2 = "container.runtime";
|
|
1775
|
-
var TMP_CONTAINER_IMAGE_NAME2 = "container.image.name";
|
|
1776
|
-
var TMP_CONTAINER_IMAGE_TAG2 = "container.image.tag";
|
|
1777
|
-
var TMP_DEPLOYMENT_ENVIRONMENT2 = "deployment.environment";
|
|
1778
|
-
var TMP_DEVICE_ID2 = "device.id";
|
|
1779
|
-
var TMP_DEVICE_MODEL_IDENTIFIER2 = "device.model.identifier";
|
|
1780
|
-
var TMP_DEVICE_MODEL_NAME2 = "device.model.name";
|
|
1781
|
-
var TMP_FAAS_NAME2 = "faas.name";
|
|
1782
|
-
var TMP_FAAS_ID2 = "faas.id";
|
|
1783
|
-
var TMP_FAAS_VERSION2 = "faas.version";
|
|
1784
|
-
var TMP_FAAS_INSTANCE2 = "faas.instance";
|
|
1785
|
-
var TMP_FAAS_MAX_MEMORY2 = "faas.max_memory";
|
|
1786
|
-
var TMP_HOST_ID2 = "host.id";
|
|
1787
|
-
var TMP_HOST_NAME2 = "host.name";
|
|
1788
|
-
var TMP_HOST_TYPE2 = "host.type";
|
|
1789
|
-
var TMP_HOST_ARCH2 = "host.arch";
|
|
1790
|
-
var TMP_HOST_IMAGE_NAME2 = "host.image.name";
|
|
1791
|
-
var TMP_HOST_IMAGE_ID2 = "host.image.id";
|
|
1792
|
-
var TMP_HOST_IMAGE_VERSION2 = "host.image.version";
|
|
1793
|
-
var TMP_K8S_CLUSTER_NAME2 = "k8s.cluster.name";
|
|
1794
|
-
var TMP_K8S_NODE_NAME2 = "k8s.node.name";
|
|
1795
|
-
var TMP_K8S_NODE_UID2 = "k8s.node.uid";
|
|
1796
|
-
var TMP_K8S_NAMESPACE_NAME2 = "k8s.namespace.name";
|
|
1797
|
-
var TMP_K8S_POD_UID2 = "k8s.pod.uid";
|
|
1798
|
-
var TMP_K8S_POD_NAME2 = "k8s.pod.name";
|
|
1799
|
-
var TMP_K8S_CONTAINER_NAME2 = "k8s.container.name";
|
|
1800
|
-
var TMP_K8S_REPLICASET_UID2 = "k8s.replicaset.uid";
|
|
1801
|
-
var TMP_K8S_REPLICASET_NAME2 = "k8s.replicaset.name";
|
|
1802
|
-
var TMP_K8S_DEPLOYMENT_UID2 = "k8s.deployment.uid";
|
|
1803
|
-
var TMP_K8S_DEPLOYMENT_NAME2 = "k8s.deployment.name";
|
|
1804
|
-
var TMP_K8S_STATEFULSET_UID2 = "k8s.statefulset.uid";
|
|
1805
|
-
var TMP_K8S_STATEFULSET_NAME2 = "k8s.statefulset.name";
|
|
1806
|
-
var TMP_K8S_DAEMONSET_UID2 = "k8s.daemonset.uid";
|
|
1807
|
-
var TMP_K8S_DAEMONSET_NAME2 = "k8s.daemonset.name";
|
|
1808
|
-
var TMP_K8S_JOB_UID2 = "k8s.job.uid";
|
|
1809
|
-
var TMP_K8S_JOB_NAME2 = "k8s.job.name";
|
|
1810
|
-
var TMP_K8S_CRONJOB_UID2 = "k8s.cronjob.uid";
|
|
1811
|
-
var TMP_K8S_CRONJOB_NAME2 = "k8s.cronjob.name";
|
|
1812
|
-
var TMP_OS_TYPE2 = "os.type";
|
|
1813
|
-
var TMP_OS_DESCRIPTION2 = "os.description";
|
|
1814
|
-
var TMP_OS_NAME2 = "os.name";
|
|
1815
|
-
var TMP_OS_VERSION2 = "os.version";
|
|
1816
|
-
var TMP_PROCESS_PID2 = "process.pid";
|
|
1817
|
-
var TMP_PROCESS_EXECUTABLE_NAME2 = "process.executable.name";
|
|
1818
|
-
var TMP_PROCESS_EXECUTABLE_PATH2 = "process.executable.path";
|
|
1819
|
-
var TMP_PROCESS_COMMAND2 = "process.command";
|
|
1820
|
-
var TMP_PROCESS_COMMAND_LINE2 = "process.command_line";
|
|
1821
|
-
var TMP_PROCESS_COMMAND_ARGS2 = "process.command_args";
|
|
1822
|
-
var TMP_PROCESS_OWNER2 = "process.owner";
|
|
1823
|
-
var TMP_PROCESS_RUNTIME_NAME2 = "process.runtime.name";
|
|
1824
|
-
var TMP_PROCESS_RUNTIME_VERSION2 = "process.runtime.version";
|
|
1825
|
-
var TMP_PROCESS_RUNTIME_DESCRIPTION2 = "process.runtime.description";
|
|
1826
|
-
var TMP_SERVICE_NAME2 = "service.name";
|
|
1827
|
-
var TMP_SERVICE_NAMESPACE2 = "service.namespace";
|
|
1828
|
-
var TMP_SERVICE_INSTANCE_ID2 = "service.instance.id";
|
|
1829
|
-
var TMP_SERVICE_VERSION2 = "service.version";
|
|
1830
|
-
var TMP_TELEMETRY_SDK_NAME2 = "telemetry.sdk.name";
|
|
1831
|
-
var TMP_TELEMETRY_SDK_LANGUAGE2 = "telemetry.sdk.language";
|
|
1832
|
-
var TMP_TELEMETRY_SDK_VERSION2 = "telemetry.sdk.version";
|
|
1833
|
-
var TMP_TELEMETRY_AUTO_VERSION2 = "telemetry.auto.version";
|
|
1834
|
-
var TMP_WEBENGINE_NAME2 = "webengine.name";
|
|
1835
|
-
var TMP_WEBENGINE_VERSION2 = "webengine.version";
|
|
1836
|
-
var TMP_WEBENGINE_DESCRIPTION2 = "webengine.description";
|
|
1837
|
-
var SemanticResourceAttributes2 = /* @__PURE__ */ createConstMap2([
|
|
1838
|
-
TMP_CLOUD_PROVIDER2,
|
|
1839
|
-
TMP_CLOUD_ACCOUNT_ID2,
|
|
1840
|
-
TMP_CLOUD_REGION2,
|
|
1841
|
-
TMP_CLOUD_AVAILABILITY_ZONE2,
|
|
1842
|
-
TMP_CLOUD_PLATFORM2,
|
|
1843
|
-
TMP_AWS_ECS_CONTAINER_ARN2,
|
|
1844
|
-
TMP_AWS_ECS_CLUSTER_ARN2,
|
|
1845
|
-
TMP_AWS_ECS_LAUNCHTYPE2,
|
|
1846
|
-
TMP_AWS_ECS_TASK_ARN2,
|
|
1847
|
-
TMP_AWS_ECS_TASK_FAMILY2,
|
|
1848
|
-
TMP_AWS_ECS_TASK_REVISION2,
|
|
1849
|
-
TMP_AWS_EKS_CLUSTER_ARN2,
|
|
1850
|
-
TMP_AWS_LOG_GROUP_NAMES2,
|
|
1851
|
-
TMP_AWS_LOG_GROUP_ARNS2,
|
|
1852
|
-
TMP_AWS_LOG_STREAM_NAMES2,
|
|
1853
|
-
TMP_AWS_LOG_STREAM_ARNS2,
|
|
1854
|
-
TMP_CONTAINER_NAME2,
|
|
1855
|
-
TMP_CONTAINER_ID2,
|
|
1856
|
-
TMP_CONTAINER_RUNTIME2,
|
|
1857
|
-
TMP_CONTAINER_IMAGE_NAME2,
|
|
1858
|
-
TMP_CONTAINER_IMAGE_TAG2,
|
|
1859
|
-
TMP_DEPLOYMENT_ENVIRONMENT2,
|
|
1860
|
-
TMP_DEVICE_ID2,
|
|
1861
|
-
TMP_DEVICE_MODEL_IDENTIFIER2,
|
|
1862
|
-
TMP_DEVICE_MODEL_NAME2,
|
|
1863
|
-
TMP_FAAS_NAME2,
|
|
1864
|
-
TMP_FAAS_ID2,
|
|
1865
|
-
TMP_FAAS_VERSION2,
|
|
1866
|
-
TMP_FAAS_INSTANCE2,
|
|
1867
|
-
TMP_FAAS_MAX_MEMORY2,
|
|
1868
|
-
TMP_HOST_ID2,
|
|
1869
|
-
TMP_HOST_NAME2,
|
|
1870
|
-
TMP_HOST_TYPE2,
|
|
1871
|
-
TMP_HOST_ARCH2,
|
|
1872
|
-
TMP_HOST_IMAGE_NAME2,
|
|
1873
|
-
TMP_HOST_IMAGE_ID2,
|
|
1874
|
-
TMP_HOST_IMAGE_VERSION2,
|
|
1875
|
-
TMP_K8S_CLUSTER_NAME2,
|
|
1876
|
-
TMP_K8S_NODE_NAME2,
|
|
1877
|
-
TMP_K8S_NODE_UID2,
|
|
1878
|
-
TMP_K8S_NAMESPACE_NAME2,
|
|
1879
|
-
TMP_K8S_POD_UID2,
|
|
1880
|
-
TMP_K8S_POD_NAME2,
|
|
1881
|
-
TMP_K8S_CONTAINER_NAME2,
|
|
1882
|
-
TMP_K8S_REPLICASET_UID2,
|
|
1883
|
-
TMP_K8S_REPLICASET_NAME2,
|
|
1884
|
-
TMP_K8S_DEPLOYMENT_UID2,
|
|
1885
|
-
TMP_K8S_DEPLOYMENT_NAME2,
|
|
1886
|
-
TMP_K8S_STATEFULSET_UID2,
|
|
1887
|
-
TMP_K8S_STATEFULSET_NAME2,
|
|
1888
|
-
TMP_K8S_DAEMONSET_UID2,
|
|
1889
|
-
TMP_K8S_DAEMONSET_NAME2,
|
|
1890
|
-
TMP_K8S_JOB_UID2,
|
|
1891
|
-
TMP_K8S_JOB_NAME2,
|
|
1892
|
-
TMP_K8S_CRONJOB_UID2,
|
|
1893
|
-
TMP_K8S_CRONJOB_NAME2,
|
|
1894
|
-
TMP_OS_TYPE2,
|
|
1895
|
-
TMP_OS_DESCRIPTION2,
|
|
1896
|
-
TMP_OS_NAME2,
|
|
1897
|
-
TMP_OS_VERSION2,
|
|
1898
|
-
TMP_PROCESS_PID2,
|
|
1899
|
-
TMP_PROCESS_EXECUTABLE_NAME2,
|
|
1900
|
-
TMP_PROCESS_EXECUTABLE_PATH2,
|
|
1901
|
-
TMP_PROCESS_COMMAND2,
|
|
1902
|
-
TMP_PROCESS_COMMAND_LINE2,
|
|
1903
|
-
TMP_PROCESS_COMMAND_ARGS2,
|
|
1904
|
-
TMP_PROCESS_OWNER2,
|
|
1905
|
-
TMP_PROCESS_RUNTIME_NAME2,
|
|
1906
|
-
TMP_PROCESS_RUNTIME_VERSION2,
|
|
1907
|
-
TMP_PROCESS_RUNTIME_DESCRIPTION2,
|
|
1908
|
-
TMP_SERVICE_NAME2,
|
|
1909
|
-
TMP_SERVICE_NAMESPACE2,
|
|
1910
|
-
TMP_SERVICE_INSTANCE_ID2,
|
|
1911
|
-
TMP_SERVICE_VERSION2,
|
|
1912
|
-
TMP_TELEMETRY_SDK_NAME2,
|
|
1913
|
-
TMP_TELEMETRY_SDK_LANGUAGE2,
|
|
1914
|
-
TMP_TELEMETRY_SDK_VERSION2,
|
|
1915
|
-
TMP_TELEMETRY_AUTO_VERSION2,
|
|
1916
|
-
TMP_WEBENGINE_NAME2,
|
|
1917
|
-
TMP_WEBENGINE_VERSION2,
|
|
1918
|
-
TMP_WEBENGINE_DESCRIPTION2
|
|
1919
|
-
]);
|
|
1920
612
|
|
|
1921
613
|
// src/tracing.ts
|
|
1922
614
|
var import_sdk_trace_node = require("@opentelemetry/sdk-trace-node");
|
|
1923
615
|
var import_ExpressLayerType = require("@opentelemetry/instrumentation-express/build/src/enums/ExpressLayerType");
|
|
616
|
+
var AdditionalInstrumentation = /* @__PURE__ */ ((AdditionalInstrumentation2) => {
|
|
617
|
+
AdditionalInstrumentation2["KNEX"] = "KNEX";
|
|
618
|
+
AdditionalInstrumentation2["PRISMA"] = "PRISMA";
|
|
619
|
+
return AdditionalInstrumentation2;
|
|
620
|
+
})(AdditionalInstrumentation || {});
|
|
621
|
+
var additionalInstrumentationConstructors = {
|
|
622
|
+
KNEX: import_instrumentation_knex.KnexInstrumentation,
|
|
623
|
+
PRISMA: import_instrumentation.PrismaInstrumentation
|
|
624
|
+
};
|
|
1924
625
|
var tracingDefaults = {
|
|
1925
626
|
serviceName: "unknown",
|
|
1926
627
|
release: "unknown",
|
|
@@ -1929,50 +630,56 @@ var tracingDefaults = {
|
|
|
1929
630
|
grpcDefaultPort: 4317,
|
|
1930
631
|
httpDefaultPort: 4318,
|
|
1931
632
|
host: "otlpcollector",
|
|
1932
|
-
logger: new DiagConsoleLogger()
|
|
633
|
+
logger: new DiagConsoleLogger(),
|
|
634
|
+
additionalInstrumentations: []
|
|
1933
635
|
};
|
|
1934
636
|
async function nodeSDKBuilder(config) {
|
|
1935
637
|
config = { ...tracingDefaults, ...config };
|
|
1936
638
|
diag.setLogger(config.logger, DiagLogLevel.WARN);
|
|
1937
|
-
const _resource = Resource.default().merge(
|
|
1938
|
-
new Resource({
|
|
1939
|
-
[
|
|
1940
|
-
[
|
|
639
|
+
const _resource = import_resources.Resource.default().merge(
|
|
640
|
+
new import_resources.Resource({
|
|
641
|
+
[SemanticResourceAttributes.SERVICE_NAME]: config.serviceName,
|
|
642
|
+
[SemanticResourceAttributes.SERVICE_VERSION]: config.release
|
|
1941
643
|
})
|
|
1942
644
|
);
|
|
1943
645
|
const _traceExporter = new import_exporter_trace_otlp_grpc.OTLPTraceExporter({
|
|
1944
646
|
//collector url
|
|
1945
647
|
url: `http://${config.host}:${config.grpcDefaultPort}`
|
|
1946
648
|
});
|
|
1947
|
-
const _spanProcessor = new BatchSpanProcessor(_traceExporter, {
|
|
649
|
+
const _spanProcessor = new import_sdk_trace_base.BatchSpanProcessor(_traceExporter, {
|
|
1948
650
|
// only force 100ms between 2 batch exports.
|
|
1949
651
|
// Default is 5000ms which is 5 seconds and causes us to lose spans
|
|
1950
652
|
scheduledDelayMillis: 100
|
|
1951
653
|
});
|
|
1952
654
|
const _idGenerator = new import_id_generator_aws_xray.AWSXRayIdGenerator();
|
|
655
|
+
let instrumentations = [
|
|
656
|
+
new import_instrumentation_aws_sdk.AwsInstrumentation({
|
|
657
|
+
suppressInternalInstrumentation: true
|
|
658
|
+
}),
|
|
659
|
+
new import_instrumentation_dataloader.DataloaderInstrumentation({}),
|
|
660
|
+
new import_instrumentation_express.ExpressInstrumentation({
|
|
661
|
+
ignoreLayersType: [import_ExpressLayerType.ExpressLayerType.MIDDLEWARE]
|
|
662
|
+
}),
|
|
663
|
+
new import_instrumentation_graphql.GraphQLInstrumentation({
|
|
664
|
+
// optional params
|
|
665
|
+
depth: config.graphQLDepth,
|
|
666
|
+
//query depth
|
|
667
|
+
allowValues: true
|
|
668
|
+
}),
|
|
669
|
+
new import_instrumentation_http.HttpInstrumentation({
|
|
670
|
+
ignoreIncomingPaths: ["/.well-known/apollo/server-health"]
|
|
671
|
+
}),
|
|
672
|
+
new import_instrumentation_mysql2.MySQL2Instrumentation({}),
|
|
673
|
+
new import_instrumentation_net.NetInstrumentation({})
|
|
674
|
+
];
|
|
675
|
+
config.additionalInstrumentations.forEach((instrumentation) => {
|
|
676
|
+
instrumentations.push(
|
|
677
|
+
new additionalInstrumentationConstructors[instrumentation]()
|
|
678
|
+
);
|
|
679
|
+
});
|
|
1953
680
|
const sdk = new import_sdk_node.NodeSDK({
|
|
1954
681
|
textMapPropagator: new import_propagator_aws_xray.AWSXRayPropagator(),
|
|
1955
|
-
instrumentations
|
|
1956
|
-
new import_instrumentation_aws_sdk.AwsInstrumentation({
|
|
1957
|
-
suppressInternalInstrumentation: true
|
|
1958
|
-
}),
|
|
1959
|
-
new import_instrumentation_dataloader.DataloaderInstrumentation({}),
|
|
1960
|
-
new import_instrumentation_express.ExpressInstrumentation({
|
|
1961
|
-
ignoreLayersType: [import_ExpressLayerType.ExpressLayerType.MIDDLEWARE]
|
|
1962
|
-
}),
|
|
1963
|
-
new import_instrumentation_graphql.GraphQLInstrumentation({
|
|
1964
|
-
// optional params
|
|
1965
|
-
depth: config.graphQLDepth,
|
|
1966
|
-
//query depth
|
|
1967
|
-
allowValues: true
|
|
1968
|
-
}),
|
|
1969
|
-
new import_instrumentation_http.HttpInstrumentation({
|
|
1970
|
-
ignoreIncomingPaths: ["/.well-known/apollo/server-health"]
|
|
1971
|
-
}),
|
|
1972
|
-
new import_instrumentation_knex.KnexInstrumentation({}),
|
|
1973
|
-
new import_instrumentation_mysql2.MySQL2Instrumentation({}),
|
|
1974
|
-
new import_instrumentation_net.NetInstrumentation({})
|
|
1975
|
-
],
|
|
682
|
+
instrumentations,
|
|
1976
683
|
resource: _resource,
|
|
1977
684
|
spanProcessor: _spanProcessor,
|
|
1978
685
|
traceExporter: _traceExporter,
|
|
@@ -1991,5 +698,6 @@ async function nodeSDKBuilder(config) {
|
|
|
1991
698
|
}
|
|
1992
699
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1993
700
|
0 && (module.exports = {
|
|
701
|
+
AdditionalInstrumentation,
|
|
1994
702
|
nodeSDKBuilder
|
|
1995
703
|
});
|