@redocly/realm 0.124.2 → 0.124.3
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/CHANGELOG.md +12 -0
- package/dist/client/runtime/generated/browser-plugins.js +12 -0
- package/dist/client/runtime/generated/package.json +1 -0
- package/dist/client/runtime/generated/routes.js +6 -0
- package/dist/client/runtime/generated/templates.js +27 -0
- package/dist/server/esbuild/cache/server/api-request-handlers-entry.js +13 -0
- package/dist/server/esbuild/cache/server/chunks/403-QNUJFFYN.js +21 -0
- package/dist/server/esbuild/cache/server/chunks/403OIDC-XVNN4OKQ.js +20 -0
- package/dist/server/esbuild/cache/server/chunks/404-TJA4JKKM.js +22 -0
- package/dist/server/esbuild/cache/server/chunks/AsyncApiDocs-DO2XADGJ.js +5012 -0
- package/dist/server/esbuild/cache/server/chunks/AsyncApiDocs-LWZY6WLJ.css +228 -0
- package/dist/server/esbuild/cache/server/chunks/CatalogClassic-62FIL6VX.js +27 -0
- package/dist/server/esbuild/cache/server/chunks/CompilationError-3AK7S6GQ.js +28 -0
- package/dist/server/esbuild/cache/server/chunks/ErrorDetails-NOXCZVSO.css +228 -0
- package/dist/server/esbuild/cache/server/chunks/ErrorDetails-Z6XTH26B.js +32 -0
- package/dist/server/esbuild/cache/server/chunks/GraphQLDocs-R7GIPOHX.js +14517 -0
- package/dist/server/esbuild/cache/server/chunks/GraphQLDocs-XWEZKQTJ.css +228 -0
- package/dist/server/esbuild/cache/server/chunks/Invite-JG7HOKGB.js +72 -0
- package/dist/server/esbuild/cache/server/chunks/Markdown-U5QMVBIW.js +90 -0
- package/dist/server/esbuild/cache/server/chunks/OpenAPIDocs-33NUY4VY.js +93 -0
- package/dist/server/esbuild/cache/server/chunks/OpenAPIDocs-QNK5DFJC.css +228 -0
- package/dist/server/esbuild/cache/server/chunks/ar-QYSYPAAE.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/changelog.page-P7J4MWQX.js +9133 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-27G3BZUU.js +6053 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-37VWTTWG.js +112 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-3F23673J.js +63 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-5Q7CA7UT.js +3610 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-5RECXZNE.js +23042 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-5WWZZ3I5.js +148 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-65DJDEU7.js +21923 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-6TWMFDXM.js +50 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-6ZPXNRVV.js +72349 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-72YI47PJ.js +61 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-AOEKZ7MP.js +1653 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-ARMFCOWJ.js +58 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-CEMEM3CC.js +1201 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-CYRM4SZM.js +200 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-CZ4WUWHR.js +145 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-EPDKKVDX.js +49 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-F2FIOV3B.js +3564 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-FN46NAFA.js +880 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-FWP7SBRO.js +40 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-HH6YBD7K.js +39 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-HMCVWUH5.js +21734 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-IPLOR6BM.js +39 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-IU4AXQIQ.js +20 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-OFZF52DH.js +367 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-ORVLLFH3.js +34 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-PLCILU3C.js +189 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-PP5BCTYO.js +481 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-PS2DM6W4.js +233 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-PX5DFLJN.js +6418 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-QD5LMSMC.js +39 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-R2ATFYSQ.js +18 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-RAOSTGG5.js +68 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-RD675JLY.js +63 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-RP4GABLB.js +104 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-TSM7ATHM.js +63 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-UNPSJPQX.js +421 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-UOJU7UCE.js +117 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-VQWN4DGI.js +117 -0
- package/dist/server/esbuild/cache/server/chunks/chunk-ZTN3K75A.js +17085 -0
- package/dist/server/esbuild/cache/server/chunks/de-NFTIOJWS.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/en-MHWJMBVA.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/es-FNU5GYZ3.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/fr-26CHXVGL.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/get-server-props-6AZWGXNL.js +23 -0
- package/dist/server/esbuild/cache/server/chunks/get-server-props-7QLMUENA.js +35 -0
- package/dist/server/esbuild/cache/server/chunks/get-server-props-CBKOAQ63.js +23 -0
- package/dist/server/esbuild/cache/server/chunks/get-server-props-UVJ7E655.js +257 -0
- package/dist/server/esbuild/cache/server/chunks/get-server-props-custom-fields-3L6PMPKS.js +30 -0
- package/dist/server/esbuild/cache/server/chunks/getMachineId-bsd-XBQCAKER.js +41 -0
- package/dist/server/esbuild/cache/server/chunks/getMachineId-darwin-75TDDERU.js +41 -0
- package/dist/server/esbuild/cache/server/chunks/getMachineId-linux-ZVY3HPZF.js +33 -0
- package/dist/server/esbuild/cache/server/chunks/getMachineId-unsupported-Z55ZGKX4.js +24 -0
- package/dist/server/esbuild/cache/server/chunks/getMachineId-win-XFRAFDV7.js +43 -0
- package/dist/server/esbuild/cache/server/chunks/hi-LMIMTEVV.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/it-KQBB6UHC.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/ja-M4G7SWOW.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/ko-UMCYPTNU.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/lib-7OVRXOGN.js +9738 -0
- package/dist/server/esbuild/cache/server/chunks/mock-server-request-handler-EPNUNSB4.js +19760 -0
- package/dist/server/esbuild/cache/server/chunks/openapi-PYAD6YIG.js +211 -0
- package/dist/server/esbuild/cache/server/chunks/openapi-SWJOOCDZ.css +228 -0
- package/dist/server/esbuild/cache/server/chunks/pl-WFS4SBNZ.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/pt-BR-6UMAIW4R.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/pt-H3U3OOD6.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/replay-SG7SV62B.js +44 -0
- package/dist/server/esbuild/cache/server/chunks/replay-tauri-path-CUezwea2-PVNYM2NO.js +51 -0
- package/dist/server/esbuild/cache/server/chunks/ru-XWABYCCX.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/schema-OQNNVD4I.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/spec-download.api-224C7JPA.js +2678 -0
- package/dist/server/esbuild/cache/server/chunks/spec-download.api-456PUG54.js +36 -0
- package/dist/server/esbuild/cache/server/chunks/template-NMUEV3UV.css +228 -0
- package/dist/server/esbuild/cache/server/chunks/template-TMZOF26J.js +6490 -0
- package/dist/server/esbuild/cache/server/chunks/uk-SANI42KH.js +9 -0
- package/dist/server/esbuild/cache/server/chunks/zh-FC3S2NSG.js +9 -0
- package/dist/server/esbuild/cache/server/middleware-entry.js +9 -0
- package/dist/server/esbuild/cache/server/migrations/catalog-sqlite/0000_initial_migration.sql +46 -0
- package/dist/server/esbuild/cache/server/migrations/catalog-sqlite/meta/0000_snapshot.json +307 -0
- package/dist/server/esbuild/cache/server/migrations/catalog-sqlite/meta/_journal.json +13 -0
- package/dist/server/esbuild/cache/server/migrations/main-sqlite/0000_initial_migration.sql +11 -0
- package/dist/server/esbuild/cache/server/migrations/main-sqlite/meta/0000_snapshot.json +82 -0
- package/dist/server/esbuild/cache/server/migrations/main-sqlite/meta/_journal.json +13 -0
- package/dist/server/esbuild/cache/server/package.json +1 -0
- package/dist/server/esbuild/cache/server/server-entry.css +294 -0
- package/dist/server/esbuild/cache/server/server-entry.js +1716 -0
- package/dist/server/esbuild/cache/server/server-props-entry.js +15 -0
- package/dist/server/esbuild/cache/server/user-tags-entry.js +9 -0
- package/package.json +5 -5
|
@@ -0,0 +1,3610 @@
|
|
|
1
|
+
import { createRequire as topLevelCreateRequire } from 'module';
|
|
2
|
+
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
DiagLogLevel,
|
|
5
|
+
INVALID_SPAN_CONTEXT,
|
|
6
|
+
SamplingDecision,
|
|
7
|
+
SpanKind,
|
|
8
|
+
SpanStatusCode,
|
|
9
|
+
TraceFlags,
|
|
10
|
+
baggageEntryMetadataFromString,
|
|
11
|
+
context,
|
|
12
|
+
createContextKey,
|
|
13
|
+
diag,
|
|
14
|
+
init_esm,
|
|
15
|
+
isSpanContextValid,
|
|
16
|
+
isValidTraceId,
|
|
17
|
+
propagation,
|
|
18
|
+
trace
|
|
19
|
+
} from "./chunk-AOEKZ7MP.js";
|
|
20
|
+
import {
|
|
21
|
+
__esm,
|
|
22
|
+
__export,
|
|
23
|
+
__require,
|
|
24
|
+
__toCommonJS
|
|
25
|
+
} from "./chunk-6TWMFDXM.js";
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/trace/suppress-tracing.js
|
|
28
|
+
function suppressTracing(context2) {
|
|
29
|
+
return context2.setValue(SUPPRESS_TRACING_KEY, true);
|
|
30
|
+
}
|
|
31
|
+
function unsuppressTracing(context2) {
|
|
32
|
+
return context2.deleteValue(SUPPRESS_TRACING_KEY);
|
|
33
|
+
}
|
|
34
|
+
function isTracingSuppressed(context2) {
|
|
35
|
+
return context2.getValue(SUPPRESS_TRACING_KEY) === true;
|
|
36
|
+
}
|
|
37
|
+
var SUPPRESS_TRACING_KEY;
|
|
38
|
+
var init_suppress_tracing = __esm({
|
|
39
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/trace/suppress-tracing.js"() {
|
|
40
|
+
init_esm();
|
|
41
|
+
SUPPRESS_TRACING_KEY = createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/baggage/constants.js
|
|
46
|
+
var BAGGAGE_KEY_PAIR_SEPARATOR, BAGGAGE_PROPERTIES_SEPARATOR, BAGGAGE_ITEMS_SEPARATOR, BAGGAGE_HEADER, BAGGAGE_MAX_NAME_VALUE_PAIRS, BAGGAGE_MAX_PER_NAME_VALUE_PAIRS, BAGGAGE_MAX_TOTAL_LENGTH;
|
|
47
|
+
var init_constants = __esm({
|
|
48
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/baggage/constants.js"() {
|
|
49
|
+
BAGGAGE_KEY_PAIR_SEPARATOR = "=";
|
|
50
|
+
BAGGAGE_PROPERTIES_SEPARATOR = ";";
|
|
51
|
+
BAGGAGE_ITEMS_SEPARATOR = ",";
|
|
52
|
+
BAGGAGE_HEADER = "baggage";
|
|
53
|
+
BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;
|
|
54
|
+
BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;
|
|
55
|
+
BAGGAGE_MAX_TOTAL_LENGTH = 8192;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/baggage/utils.js
|
|
60
|
+
function serializeKeyPairs(keyPairs) {
|
|
61
|
+
return keyPairs.reduce((hValue, current) => {
|
|
62
|
+
const value = `${hValue}${hValue !== "" ? BAGGAGE_ITEMS_SEPARATOR : ""}${current}`;
|
|
63
|
+
return value.length > BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value;
|
|
64
|
+
}, "");
|
|
65
|
+
}
|
|
66
|
+
function getKeyPairs(baggage) {
|
|
67
|
+
return baggage.getAllEntries().map(([key, value]) => {
|
|
68
|
+
let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`;
|
|
69
|
+
if (value.metadata !== void 0) {
|
|
70
|
+
entry += BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString();
|
|
71
|
+
}
|
|
72
|
+
return entry;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function parsePairKeyValue(entry) {
|
|
76
|
+
const valueProps = entry.split(BAGGAGE_PROPERTIES_SEPARATOR);
|
|
77
|
+
if (valueProps.length <= 0)
|
|
78
|
+
return;
|
|
79
|
+
const keyPairPart = valueProps.shift();
|
|
80
|
+
if (!keyPairPart)
|
|
81
|
+
return;
|
|
82
|
+
const separatorIndex = keyPairPart.indexOf(BAGGAGE_KEY_PAIR_SEPARATOR);
|
|
83
|
+
if (separatorIndex <= 0)
|
|
84
|
+
return;
|
|
85
|
+
const key = decodeURIComponent(keyPairPart.substring(0, separatorIndex).trim());
|
|
86
|
+
const value = decodeURIComponent(keyPairPart.substring(separatorIndex + 1).trim());
|
|
87
|
+
let metadata;
|
|
88
|
+
if (valueProps.length > 0) {
|
|
89
|
+
metadata = baggageEntryMetadataFromString(valueProps.join(BAGGAGE_PROPERTIES_SEPARATOR));
|
|
90
|
+
}
|
|
91
|
+
return { key, value, metadata };
|
|
92
|
+
}
|
|
93
|
+
function parseKeyPairsIntoRecord(value) {
|
|
94
|
+
const result = {};
|
|
95
|
+
if (typeof value === "string" && value.length > 0) {
|
|
96
|
+
value.split(BAGGAGE_ITEMS_SEPARATOR).forEach((entry) => {
|
|
97
|
+
const keyPair = parsePairKeyValue(entry);
|
|
98
|
+
if (keyPair !== void 0 && keyPair.value.length > 0) {
|
|
99
|
+
result[keyPair.key] = keyPair.value;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
var init_utils = __esm({
|
|
106
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/baggage/utils.js"() {
|
|
107
|
+
init_esm();
|
|
108
|
+
init_constants();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/baggage/propagation/W3CBaggagePropagator.js
|
|
113
|
+
var W3CBaggagePropagator;
|
|
114
|
+
var init_W3CBaggagePropagator = __esm({
|
|
115
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/baggage/propagation/W3CBaggagePropagator.js"() {
|
|
116
|
+
init_esm();
|
|
117
|
+
init_suppress_tracing();
|
|
118
|
+
init_constants();
|
|
119
|
+
init_utils();
|
|
120
|
+
W3CBaggagePropagator = class {
|
|
121
|
+
inject(context2, carrier, setter) {
|
|
122
|
+
const baggage = propagation.getBaggage(context2);
|
|
123
|
+
if (!baggage || isTracingSuppressed(context2))
|
|
124
|
+
return;
|
|
125
|
+
const keyPairs = getKeyPairs(baggage).filter((pair) => {
|
|
126
|
+
return pair.length <= BAGGAGE_MAX_PER_NAME_VALUE_PAIRS;
|
|
127
|
+
}).slice(0, BAGGAGE_MAX_NAME_VALUE_PAIRS);
|
|
128
|
+
const headerValue = serializeKeyPairs(keyPairs);
|
|
129
|
+
if (headerValue.length > 0) {
|
|
130
|
+
setter.set(carrier, BAGGAGE_HEADER, headerValue);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
extract(context2, carrier, getter) {
|
|
134
|
+
const headerValue = getter.get(carrier, BAGGAGE_HEADER);
|
|
135
|
+
const baggageString = Array.isArray(headerValue) ? headerValue.join(BAGGAGE_ITEMS_SEPARATOR) : headerValue;
|
|
136
|
+
if (!baggageString)
|
|
137
|
+
return context2;
|
|
138
|
+
const baggage = {};
|
|
139
|
+
if (baggageString.length === 0) {
|
|
140
|
+
return context2;
|
|
141
|
+
}
|
|
142
|
+
const pairs = baggageString.split(BAGGAGE_ITEMS_SEPARATOR);
|
|
143
|
+
pairs.forEach((entry) => {
|
|
144
|
+
const keyPair = parsePairKeyValue(entry);
|
|
145
|
+
if (keyPair) {
|
|
146
|
+
const baggageEntry = { value: keyPair.value };
|
|
147
|
+
if (keyPair.metadata) {
|
|
148
|
+
baggageEntry.metadata = keyPair.metadata;
|
|
149
|
+
}
|
|
150
|
+
baggage[keyPair.key] = baggageEntry;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
if (Object.entries(baggage).length === 0) {
|
|
154
|
+
return context2;
|
|
155
|
+
}
|
|
156
|
+
return propagation.setBaggage(context2, propagation.createBaggage(baggage));
|
|
157
|
+
}
|
|
158
|
+
fields() {
|
|
159
|
+
return [BAGGAGE_HEADER];
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js
|
|
166
|
+
var ATTR_ERROR_TYPE, ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_REQUEST_METHOD_ORIGINAL, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION, ATTR_TELEMETRY_SDK_LANGUAGE, TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, ATTR_URL_FULL;
|
|
167
|
+
var init_stable_attributes = __esm({
|
|
168
|
+
"../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js"() {
|
|
169
|
+
ATTR_ERROR_TYPE = "error.type";
|
|
170
|
+
ATTR_EXCEPTION_MESSAGE = "exception.message";
|
|
171
|
+
ATTR_EXCEPTION_STACKTRACE = "exception.stacktrace";
|
|
172
|
+
ATTR_EXCEPTION_TYPE = "exception.type";
|
|
173
|
+
ATTR_HTTP_REQUEST_METHOD = "http.request.method";
|
|
174
|
+
ATTR_HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original";
|
|
175
|
+
ATTR_HTTP_RESPONSE_STATUS_CODE = "http.response.status_code";
|
|
176
|
+
ATTR_SERVER_ADDRESS = "server.address";
|
|
177
|
+
ATTR_SERVER_PORT = "server.port";
|
|
178
|
+
ATTR_SERVICE_NAME = "service.name";
|
|
179
|
+
ATTR_SERVICE_VERSION = "service.version";
|
|
180
|
+
ATTR_TELEMETRY_SDK_LANGUAGE = "telemetry.sdk.language";
|
|
181
|
+
TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = "nodejs";
|
|
182
|
+
ATTR_TELEMETRY_SDK_NAME = "telemetry.sdk.name";
|
|
183
|
+
ATTR_TELEMETRY_SDK_VERSION = "telemetry.sdk.version";
|
|
184
|
+
ATTR_URL_FULL = "url.full";
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js
|
|
189
|
+
var TMP_HTTP_URL, TMP_HTTP_USER_AGENT, SEMATTRS_HTTP_URL, SEMATTRS_HTTP_USER_AGENT;
|
|
190
|
+
var init_SemanticAttributes = __esm({
|
|
191
|
+
"../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js"() {
|
|
192
|
+
TMP_HTTP_URL = "http.url";
|
|
193
|
+
TMP_HTTP_USER_AGENT = "http.user_agent";
|
|
194
|
+
SEMATTRS_HTTP_URL = TMP_HTTP_URL;
|
|
195
|
+
SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js
|
|
200
|
+
var init_trace = __esm({
|
|
201
|
+
"../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js"() {
|
|
202
|
+
init_SemanticAttributes();
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js
|
|
207
|
+
var init_SemanticResourceAttributes = __esm({
|
|
208
|
+
"../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js"() {
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js
|
|
213
|
+
var init_resource = __esm({
|
|
214
|
+
"../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js"() {
|
|
215
|
+
init_SemanticResourceAttributes();
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js
|
|
220
|
+
var init_stable_metrics = __esm({
|
|
221
|
+
"../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js"() {
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
// ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js
|
|
226
|
+
var init_esm2 = __esm({
|
|
227
|
+
"../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.34.0/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js"() {
|
|
228
|
+
init_trace();
|
|
229
|
+
init_resource();
|
|
230
|
+
init_stable_attributes();
|
|
231
|
+
init_stable_metrics();
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/propagation/composite.js
|
|
236
|
+
var CompositePropagator;
|
|
237
|
+
var init_composite = __esm({
|
|
238
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/propagation/composite.js"() {
|
|
239
|
+
init_esm();
|
|
240
|
+
CompositePropagator = class {
|
|
241
|
+
_propagators;
|
|
242
|
+
_fields;
|
|
243
|
+
/**
|
|
244
|
+
* Construct a composite propagator from a list of propagators.
|
|
245
|
+
*
|
|
246
|
+
* @param [config] Configuration object for composite propagator
|
|
247
|
+
*/
|
|
248
|
+
constructor(config = {}) {
|
|
249
|
+
this._propagators = config.propagators ?? [];
|
|
250
|
+
this._fields = Array.from(new Set(this._propagators.map((p) => typeof p.fields === "function" ? p.fields() : []).reduce((x, y) => x.concat(y), [])));
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Run each of the configured propagators with the given context and carrier.
|
|
254
|
+
* Propagators are run in the order they are configured, so if multiple
|
|
255
|
+
* propagators write the same carrier key, the propagator later in the list
|
|
256
|
+
* will "win".
|
|
257
|
+
*
|
|
258
|
+
* @param context Context to inject
|
|
259
|
+
* @param carrier Carrier into which context will be injected
|
|
260
|
+
*/
|
|
261
|
+
inject(context2, carrier, setter) {
|
|
262
|
+
for (const propagator of this._propagators) {
|
|
263
|
+
try {
|
|
264
|
+
propagator.inject(context2, carrier, setter);
|
|
265
|
+
} catch (err) {
|
|
266
|
+
diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Run each of the configured propagators with the given context and carrier.
|
|
272
|
+
* Propagators are run in the order they are configured, so if multiple
|
|
273
|
+
* propagators write the same context key, the propagator later in the list
|
|
274
|
+
* will "win".
|
|
275
|
+
*
|
|
276
|
+
* @param context Context to add values to
|
|
277
|
+
* @param carrier Carrier from which to extract context
|
|
278
|
+
*/
|
|
279
|
+
extract(context2, carrier, getter) {
|
|
280
|
+
return this._propagators.reduce((ctx, propagator) => {
|
|
281
|
+
try {
|
|
282
|
+
return propagator.extract(ctx, carrier, getter);
|
|
283
|
+
} catch (err) {
|
|
284
|
+
diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`);
|
|
285
|
+
}
|
|
286
|
+
return ctx;
|
|
287
|
+
}, context2);
|
|
288
|
+
}
|
|
289
|
+
fields() {
|
|
290
|
+
return this._fields.slice();
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/internal/validators.js
|
|
297
|
+
function validateKey(key) {
|
|
298
|
+
return VALID_KEY_REGEX.test(key);
|
|
299
|
+
}
|
|
300
|
+
function validateValue(value) {
|
|
301
|
+
return VALID_VALUE_BASE_REGEX.test(value) && !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value);
|
|
302
|
+
}
|
|
303
|
+
var VALID_KEY_CHAR_RANGE, VALID_KEY, VALID_VENDOR_KEY, VALID_KEY_REGEX, VALID_VALUE_BASE_REGEX, INVALID_VALUE_COMMA_EQUAL_REGEX;
|
|
304
|
+
var init_validators = __esm({
|
|
305
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/internal/validators.js"() {
|
|
306
|
+
VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]";
|
|
307
|
+
VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;
|
|
308
|
+
VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;
|
|
309
|
+
VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);
|
|
310
|
+
VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
|
|
311
|
+
INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/trace/TraceState.js
|
|
316
|
+
var MAX_TRACE_STATE_ITEMS, MAX_TRACE_STATE_LEN, LIST_MEMBERS_SEPARATOR, LIST_MEMBER_KEY_VALUE_SPLITTER, TraceState;
|
|
317
|
+
var init_TraceState = __esm({
|
|
318
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/trace/TraceState.js"() {
|
|
319
|
+
init_validators();
|
|
320
|
+
MAX_TRACE_STATE_ITEMS = 32;
|
|
321
|
+
MAX_TRACE_STATE_LEN = 512;
|
|
322
|
+
LIST_MEMBERS_SEPARATOR = ",";
|
|
323
|
+
LIST_MEMBER_KEY_VALUE_SPLITTER = "=";
|
|
324
|
+
TraceState = class _TraceState {
|
|
325
|
+
_internalState = /* @__PURE__ */ new Map();
|
|
326
|
+
constructor(rawTraceState) {
|
|
327
|
+
if (rawTraceState)
|
|
328
|
+
this._parse(rawTraceState);
|
|
329
|
+
}
|
|
330
|
+
set(key, value) {
|
|
331
|
+
const traceState = this._clone();
|
|
332
|
+
if (traceState._internalState.has(key)) {
|
|
333
|
+
traceState._internalState.delete(key);
|
|
334
|
+
}
|
|
335
|
+
traceState._internalState.set(key, value);
|
|
336
|
+
return traceState;
|
|
337
|
+
}
|
|
338
|
+
unset(key) {
|
|
339
|
+
const traceState = this._clone();
|
|
340
|
+
traceState._internalState.delete(key);
|
|
341
|
+
return traceState;
|
|
342
|
+
}
|
|
343
|
+
get(key) {
|
|
344
|
+
return this._internalState.get(key);
|
|
345
|
+
}
|
|
346
|
+
serialize() {
|
|
347
|
+
return this._keys().reduce((agg, key) => {
|
|
348
|
+
agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));
|
|
349
|
+
return agg;
|
|
350
|
+
}, []).join(LIST_MEMBERS_SEPARATOR);
|
|
351
|
+
}
|
|
352
|
+
_parse(rawTraceState) {
|
|
353
|
+
if (rawTraceState.length > MAX_TRACE_STATE_LEN)
|
|
354
|
+
return;
|
|
355
|
+
this._internalState = rawTraceState.split(LIST_MEMBERS_SEPARATOR).reverse().reduce((agg, part) => {
|
|
356
|
+
const listMember = part.trim();
|
|
357
|
+
const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);
|
|
358
|
+
if (i !== -1) {
|
|
359
|
+
const key = listMember.slice(0, i);
|
|
360
|
+
const value = listMember.slice(i + 1, part.length);
|
|
361
|
+
if (validateKey(key) && validateValue(value)) {
|
|
362
|
+
agg.set(key, value);
|
|
363
|
+
} else {
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return agg;
|
|
367
|
+
}, /* @__PURE__ */ new Map());
|
|
368
|
+
if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {
|
|
369
|
+
this._internalState = new Map(Array.from(this._internalState.entries()).reverse().slice(0, MAX_TRACE_STATE_ITEMS));
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
_keys() {
|
|
373
|
+
return Array.from(this._internalState.keys()).reverse();
|
|
374
|
+
}
|
|
375
|
+
_clone() {
|
|
376
|
+
const traceState = new _TraceState();
|
|
377
|
+
traceState._internalState = new Map(this._internalState);
|
|
378
|
+
return traceState;
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/trace/W3CTraceContextPropagator.js
|
|
385
|
+
function parseTraceParent(traceParent) {
|
|
386
|
+
const match = TRACE_PARENT_REGEX.exec(traceParent);
|
|
387
|
+
if (!match)
|
|
388
|
+
return null;
|
|
389
|
+
if (match[1] === "00" && match[5])
|
|
390
|
+
return null;
|
|
391
|
+
return {
|
|
392
|
+
traceId: match[2],
|
|
393
|
+
spanId: match[3],
|
|
394
|
+
traceFlags: parseInt(match[4], 16)
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
var TRACE_PARENT_HEADER, TRACE_STATE_HEADER, VERSION, VERSION_PART, TRACE_ID_PART, PARENT_ID_PART, FLAGS_PART, TRACE_PARENT_REGEX, W3CTraceContextPropagator;
|
|
398
|
+
var init_W3CTraceContextPropagator = __esm({
|
|
399
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/trace/W3CTraceContextPropagator.js"() {
|
|
400
|
+
init_esm();
|
|
401
|
+
init_suppress_tracing();
|
|
402
|
+
init_TraceState();
|
|
403
|
+
TRACE_PARENT_HEADER = "traceparent";
|
|
404
|
+
TRACE_STATE_HEADER = "tracestate";
|
|
405
|
+
VERSION = "00";
|
|
406
|
+
VERSION_PART = "(?!ff)[\\da-f]{2}";
|
|
407
|
+
TRACE_ID_PART = "(?![0]{32})[\\da-f]{32}";
|
|
408
|
+
PARENT_ID_PART = "(?![0]{16})[\\da-f]{16}";
|
|
409
|
+
FLAGS_PART = "[\\da-f]{2}";
|
|
410
|
+
TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`);
|
|
411
|
+
W3CTraceContextPropagator = class {
|
|
412
|
+
inject(context2, carrier, setter) {
|
|
413
|
+
const spanContext = trace.getSpanContext(context2);
|
|
414
|
+
if (!spanContext || isTracingSuppressed(context2) || !isSpanContextValid(spanContext))
|
|
415
|
+
return;
|
|
416
|
+
const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || TraceFlags.NONE).toString(16)}`;
|
|
417
|
+
setter.set(carrier, TRACE_PARENT_HEADER, traceParent);
|
|
418
|
+
if (spanContext.traceState) {
|
|
419
|
+
setter.set(carrier, TRACE_STATE_HEADER, spanContext.traceState.serialize());
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
extract(context2, carrier, getter) {
|
|
423
|
+
const traceParentHeader = getter.get(carrier, TRACE_PARENT_HEADER);
|
|
424
|
+
if (!traceParentHeader)
|
|
425
|
+
return context2;
|
|
426
|
+
const traceParent = Array.isArray(traceParentHeader) ? traceParentHeader[0] : traceParentHeader;
|
|
427
|
+
if (typeof traceParent !== "string")
|
|
428
|
+
return context2;
|
|
429
|
+
const spanContext = parseTraceParent(traceParent);
|
|
430
|
+
if (!spanContext)
|
|
431
|
+
return context2;
|
|
432
|
+
spanContext.isRemote = true;
|
|
433
|
+
const traceStateHeader = getter.get(carrier, TRACE_STATE_HEADER);
|
|
434
|
+
if (traceStateHeader) {
|
|
435
|
+
const state = Array.isArray(traceStateHeader) ? traceStateHeader.join(",") : traceStateHeader;
|
|
436
|
+
spanContext.traceState = new TraceState(typeof state === "string" ? state : void 0);
|
|
437
|
+
}
|
|
438
|
+
return trace.setSpanContext(context2, spanContext);
|
|
439
|
+
}
|
|
440
|
+
fields() {
|
|
441
|
+
return [TRACE_PARENT_HEADER, TRACE_STATE_HEADER];
|
|
442
|
+
}
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/anchored-clock.js
|
|
448
|
+
var AnchoredClock;
|
|
449
|
+
var init_anchored_clock = __esm({
|
|
450
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/anchored-clock.js"() {
|
|
451
|
+
AnchoredClock = class {
|
|
452
|
+
_monotonicClock;
|
|
453
|
+
_epochMillis;
|
|
454
|
+
_performanceMillis;
|
|
455
|
+
/**
|
|
456
|
+
* Create a new AnchoredClock anchored to the current time returned by systemClock.
|
|
457
|
+
*
|
|
458
|
+
* @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date
|
|
459
|
+
* @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance
|
|
460
|
+
*/
|
|
461
|
+
constructor(systemClock, monotonicClock) {
|
|
462
|
+
this._monotonicClock = monotonicClock;
|
|
463
|
+
this._epochMillis = systemClock.now();
|
|
464
|
+
this._performanceMillis = monotonicClock.now();
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Returns the current time by adding the number of milliseconds since the
|
|
468
|
+
* AnchoredClock was created to the creation epoch time
|
|
469
|
+
*/
|
|
470
|
+
now() {
|
|
471
|
+
const delta = this._monotonicClock.now() - this._performanceMillis;
|
|
472
|
+
return this._epochMillis + delta;
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/attributes.js
|
|
479
|
+
function sanitizeAttributes(attributes) {
|
|
480
|
+
const out = {};
|
|
481
|
+
if (typeof attributes !== "object" || attributes == null) {
|
|
482
|
+
return out;
|
|
483
|
+
}
|
|
484
|
+
for (const [key, val] of Object.entries(attributes)) {
|
|
485
|
+
if (!isAttributeKey(key)) {
|
|
486
|
+
diag.warn(`Invalid attribute key: ${key}`);
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
if (!isAttributeValue(val)) {
|
|
490
|
+
diag.warn(`Invalid attribute value set for key: ${key}`);
|
|
491
|
+
continue;
|
|
492
|
+
}
|
|
493
|
+
if (Array.isArray(val)) {
|
|
494
|
+
out[key] = val.slice();
|
|
495
|
+
} else {
|
|
496
|
+
out[key] = val;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return out;
|
|
500
|
+
}
|
|
501
|
+
function isAttributeKey(key) {
|
|
502
|
+
return typeof key === "string" && key.length > 0;
|
|
503
|
+
}
|
|
504
|
+
function isAttributeValue(val) {
|
|
505
|
+
if (val == null) {
|
|
506
|
+
return true;
|
|
507
|
+
}
|
|
508
|
+
if (Array.isArray(val)) {
|
|
509
|
+
return isHomogeneousAttributeValueArray(val);
|
|
510
|
+
}
|
|
511
|
+
return isValidPrimitiveAttributeValue(val);
|
|
512
|
+
}
|
|
513
|
+
function isHomogeneousAttributeValueArray(arr) {
|
|
514
|
+
let type;
|
|
515
|
+
for (const element of arr) {
|
|
516
|
+
if (element == null)
|
|
517
|
+
continue;
|
|
518
|
+
if (!type) {
|
|
519
|
+
if (isValidPrimitiveAttributeValue(element)) {
|
|
520
|
+
type = typeof element;
|
|
521
|
+
continue;
|
|
522
|
+
}
|
|
523
|
+
return false;
|
|
524
|
+
}
|
|
525
|
+
if (typeof element === type) {
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
528
|
+
return false;
|
|
529
|
+
}
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
function isValidPrimitiveAttributeValue(val) {
|
|
533
|
+
switch (typeof val) {
|
|
534
|
+
case "number":
|
|
535
|
+
case "boolean":
|
|
536
|
+
case "string":
|
|
537
|
+
return true;
|
|
538
|
+
}
|
|
539
|
+
return false;
|
|
540
|
+
}
|
|
541
|
+
var init_attributes = __esm({
|
|
542
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/attributes.js"() {
|
|
543
|
+
init_esm();
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js
|
|
548
|
+
function loggingErrorHandler() {
|
|
549
|
+
return (ex) => {
|
|
550
|
+
diag.error(stringifyException(ex));
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
function stringifyException(ex) {
|
|
554
|
+
if (typeof ex === "string") {
|
|
555
|
+
return ex;
|
|
556
|
+
} else {
|
|
557
|
+
return JSON.stringify(flattenException(ex));
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function flattenException(ex) {
|
|
561
|
+
const result = {};
|
|
562
|
+
let current = ex;
|
|
563
|
+
while (current !== null) {
|
|
564
|
+
Object.getOwnPropertyNames(current).forEach((propertyName) => {
|
|
565
|
+
if (result[propertyName])
|
|
566
|
+
return;
|
|
567
|
+
const value = current[propertyName];
|
|
568
|
+
if (value) {
|
|
569
|
+
result[propertyName] = String(value);
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
current = Object.getPrototypeOf(current);
|
|
573
|
+
}
|
|
574
|
+
return result;
|
|
575
|
+
}
|
|
576
|
+
var init_logging_error_handler = __esm({
|
|
577
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js"() {
|
|
578
|
+
init_esm();
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js
|
|
583
|
+
function setGlobalErrorHandler(handler) {
|
|
584
|
+
delegateHandler = handler;
|
|
585
|
+
}
|
|
586
|
+
function globalErrorHandler(ex) {
|
|
587
|
+
try {
|
|
588
|
+
delegateHandler(ex);
|
|
589
|
+
} catch {
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
var delegateHandler;
|
|
593
|
+
var init_global_error_handler = __esm({
|
|
594
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js"() {
|
|
595
|
+
init_logging_error_handler();
|
|
596
|
+
delegateHandler = loggingErrorHandler();
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
|
|
600
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/environment.js
|
|
601
|
+
import { inspect } from "util";
|
|
602
|
+
function getNumberFromEnv(key) {
|
|
603
|
+
const raw = process.env[key];
|
|
604
|
+
if (raw == null || raw.trim() === "") {
|
|
605
|
+
return void 0;
|
|
606
|
+
}
|
|
607
|
+
const value = Number(raw);
|
|
608
|
+
if (isNaN(value)) {
|
|
609
|
+
diag.warn(`Unknown value ${inspect(raw)} for ${key}, expected a number, using defaults`);
|
|
610
|
+
return void 0;
|
|
611
|
+
}
|
|
612
|
+
return value;
|
|
613
|
+
}
|
|
614
|
+
function getStringFromEnv(key) {
|
|
615
|
+
const raw = process.env[key];
|
|
616
|
+
if (raw == null || raw.trim() === "") {
|
|
617
|
+
return void 0;
|
|
618
|
+
}
|
|
619
|
+
return raw;
|
|
620
|
+
}
|
|
621
|
+
function getBooleanFromEnv(key) {
|
|
622
|
+
const raw = process.env[key]?.trim().toLowerCase();
|
|
623
|
+
if (raw == null || raw === "") {
|
|
624
|
+
return false;
|
|
625
|
+
}
|
|
626
|
+
if (raw === "true") {
|
|
627
|
+
return true;
|
|
628
|
+
} else if (raw === "false") {
|
|
629
|
+
return false;
|
|
630
|
+
} else {
|
|
631
|
+
diag.warn(`Unknown value ${inspect(raw)} for ${key}, expected 'true' or 'false', falling back to 'false' (default)`);
|
|
632
|
+
return false;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
function getStringListFromEnv(key) {
|
|
636
|
+
return getStringFromEnv(key)?.split(",").map((v) => v.trim()).filter((s) => s !== "");
|
|
637
|
+
}
|
|
638
|
+
var init_environment = __esm({
|
|
639
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/environment.js"() {
|
|
640
|
+
init_esm();
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/globalThis.js
|
|
645
|
+
var _globalThis;
|
|
646
|
+
var init_globalThis = __esm({
|
|
647
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/globalThis.js"() {
|
|
648
|
+
_globalThis = typeof globalThis === "object" ? globalThis : global;
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/performance.js
|
|
653
|
+
import { performance } from "perf_hooks";
|
|
654
|
+
var otperformance;
|
|
655
|
+
var init_performance = __esm({
|
|
656
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/performance.js"() {
|
|
657
|
+
otperformance = performance;
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
|
|
661
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/version.js
|
|
662
|
+
var VERSION2;
|
|
663
|
+
var init_version = __esm({
|
|
664
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/version.js"() {
|
|
665
|
+
VERSION2 = "2.0.1";
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/semconv.js
|
|
670
|
+
var ATTR_PROCESS_RUNTIME_NAME;
|
|
671
|
+
var init_semconv = __esm({
|
|
672
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/semconv.js"() {
|
|
673
|
+
ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name";
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/sdk-info.js
|
|
678
|
+
var SDK_INFO;
|
|
679
|
+
var init_sdk_info = __esm({
|
|
680
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/sdk-info.js"() {
|
|
681
|
+
init_version();
|
|
682
|
+
init_esm2();
|
|
683
|
+
init_semconv();
|
|
684
|
+
SDK_INFO = {
|
|
685
|
+
[ATTR_TELEMETRY_SDK_NAME]: "opentelemetry",
|
|
686
|
+
[ATTR_PROCESS_RUNTIME_NAME]: "node",
|
|
687
|
+
[ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,
|
|
688
|
+
[ATTR_TELEMETRY_SDK_VERSION]: VERSION2
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/timer-util.js
|
|
694
|
+
function unrefTimer(timer) {
|
|
695
|
+
timer.unref();
|
|
696
|
+
}
|
|
697
|
+
var init_timer_util = __esm({
|
|
698
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/timer-util.js"() {
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
|
|
702
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/index.js
|
|
703
|
+
var init_node = __esm({
|
|
704
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/node/index.js"() {
|
|
705
|
+
init_environment();
|
|
706
|
+
init_globalThis();
|
|
707
|
+
init_performance();
|
|
708
|
+
init_sdk_info();
|
|
709
|
+
init_timer_util();
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
|
|
713
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/index.js
|
|
714
|
+
var init_platform = __esm({
|
|
715
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/platform/index.js"() {
|
|
716
|
+
init_node();
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
|
|
720
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/time.js
|
|
721
|
+
function millisToHrTime(epochMillis) {
|
|
722
|
+
const epochSeconds = epochMillis / 1e3;
|
|
723
|
+
const seconds = Math.trunc(epochSeconds);
|
|
724
|
+
const nanos = Math.round(epochMillis % 1e3 * MILLISECONDS_TO_NANOSECONDS);
|
|
725
|
+
return [seconds, nanos];
|
|
726
|
+
}
|
|
727
|
+
function getTimeOrigin() {
|
|
728
|
+
let timeOrigin = otperformance.timeOrigin;
|
|
729
|
+
if (typeof timeOrigin !== "number") {
|
|
730
|
+
const perf = otperformance;
|
|
731
|
+
timeOrigin = perf.timing && perf.timing.fetchStart;
|
|
732
|
+
}
|
|
733
|
+
return timeOrigin;
|
|
734
|
+
}
|
|
735
|
+
function hrTime(performanceNow) {
|
|
736
|
+
const timeOrigin = millisToHrTime(getTimeOrigin());
|
|
737
|
+
const now = millisToHrTime(typeof performanceNow === "number" ? performanceNow : otperformance.now());
|
|
738
|
+
return addHrTimes(timeOrigin, now);
|
|
739
|
+
}
|
|
740
|
+
function timeInputToHrTime(time) {
|
|
741
|
+
if (isTimeInputHrTime(time)) {
|
|
742
|
+
return time;
|
|
743
|
+
} else if (typeof time === "number") {
|
|
744
|
+
if (time < getTimeOrigin()) {
|
|
745
|
+
return hrTime(time);
|
|
746
|
+
} else {
|
|
747
|
+
return millisToHrTime(time);
|
|
748
|
+
}
|
|
749
|
+
} else if (time instanceof Date) {
|
|
750
|
+
return millisToHrTime(time.getTime());
|
|
751
|
+
} else {
|
|
752
|
+
throw TypeError("Invalid input type");
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
function hrTimeDuration(startTime, endTime) {
|
|
756
|
+
let seconds = endTime[0] - startTime[0];
|
|
757
|
+
let nanos = endTime[1] - startTime[1];
|
|
758
|
+
if (nanos < 0) {
|
|
759
|
+
seconds -= 1;
|
|
760
|
+
nanos += SECOND_TO_NANOSECONDS;
|
|
761
|
+
}
|
|
762
|
+
return [seconds, nanos];
|
|
763
|
+
}
|
|
764
|
+
function hrTimeToTimeStamp(time) {
|
|
765
|
+
const precision = NANOSECOND_DIGITS;
|
|
766
|
+
const tmp = `${"0".repeat(precision)}${time[1]}Z`;
|
|
767
|
+
const nanoString = tmp.substring(tmp.length - precision - 1);
|
|
768
|
+
const date = new Date(time[0] * 1e3).toISOString();
|
|
769
|
+
return date.replace("000Z", nanoString);
|
|
770
|
+
}
|
|
771
|
+
function hrTimeToNanoseconds(time) {
|
|
772
|
+
return time[0] * SECOND_TO_NANOSECONDS + time[1];
|
|
773
|
+
}
|
|
774
|
+
function hrTimeToMilliseconds(time) {
|
|
775
|
+
return time[0] * 1e3 + time[1] / 1e6;
|
|
776
|
+
}
|
|
777
|
+
function hrTimeToMicroseconds(time) {
|
|
778
|
+
return time[0] * 1e6 + time[1] / 1e3;
|
|
779
|
+
}
|
|
780
|
+
function isTimeInputHrTime(value) {
|
|
781
|
+
return Array.isArray(value) && value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number";
|
|
782
|
+
}
|
|
783
|
+
function isTimeInput(value) {
|
|
784
|
+
return isTimeInputHrTime(value) || typeof value === "number" || value instanceof Date;
|
|
785
|
+
}
|
|
786
|
+
function addHrTimes(time1, time2) {
|
|
787
|
+
const out = [time1[0] + time2[0], time1[1] + time2[1]];
|
|
788
|
+
if (out[1] >= SECOND_TO_NANOSECONDS) {
|
|
789
|
+
out[1] -= SECOND_TO_NANOSECONDS;
|
|
790
|
+
out[0] += 1;
|
|
791
|
+
}
|
|
792
|
+
return out;
|
|
793
|
+
}
|
|
794
|
+
var NANOSECOND_DIGITS, NANOSECOND_DIGITS_IN_MILLIS, MILLISECONDS_TO_NANOSECONDS, SECOND_TO_NANOSECONDS;
|
|
795
|
+
var init_time = __esm({
|
|
796
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/common/time.js"() {
|
|
797
|
+
init_platform();
|
|
798
|
+
NANOSECOND_DIGITS = 9;
|
|
799
|
+
NANOSECOND_DIGITS_IN_MILLIS = 6;
|
|
800
|
+
MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS);
|
|
801
|
+
SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS);
|
|
802
|
+
}
|
|
803
|
+
});
|
|
804
|
+
|
|
805
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/ExportResult.js
|
|
806
|
+
var ExportResultCode;
|
|
807
|
+
var init_ExportResult = __esm({
|
|
808
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/ExportResult.js"() {
|
|
809
|
+
(function(ExportResultCode2) {
|
|
810
|
+
ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS";
|
|
811
|
+
ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED";
|
|
812
|
+
})(ExportResultCode || (ExportResultCode = {}));
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
|
|
816
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/trace/rpc-metadata.js
|
|
817
|
+
function setRPCMetadata(context2, meta) {
|
|
818
|
+
return context2.setValue(RPC_METADATA_KEY, meta);
|
|
819
|
+
}
|
|
820
|
+
function deleteRPCMetadata(context2) {
|
|
821
|
+
return context2.deleteValue(RPC_METADATA_KEY);
|
|
822
|
+
}
|
|
823
|
+
function getRPCMetadata(context2) {
|
|
824
|
+
return context2.getValue(RPC_METADATA_KEY);
|
|
825
|
+
}
|
|
826
|
+
var RPC_METADATA_KEY, RPCType;
|
|
827
|
+
var init_rpc_metadata = __esm({
|
|
828
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/trace/rpc-metadata.js"() {
|
|
829
|
+
init_esm();
|
|
830
|
+
RPC_METADATA_KEY = createContextKey("OpenTelemetry SDK Context Key RPC_METADATA");
|
|
831
|
+
(function(RPCType2) {
|
|
832
|
+
RPCType2["HTTP"] = "http";
|
|
833
|
+
})(RPCType || (RPCType = {}));
|
|
834
|
+
}
|
|
835
|
+
});
|
|
836
|
+
|
|
837
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/lodash.merge.js
|
|
838
|
+
function isPlainObject(value) {
|
|
839
|
+
if (!isObjectLike(value) || baseGetTag(value) !== objectTag) {
|
|
840
|
+
return false;
|
|
841
|
+
}
|
|
842
|
+
const proto = getPrototypeOf(value);
|
|
843
|
+
if (proto === null) {
|
|
844
|
+
return true;
|
|
845
|
+
}
|
|
846
|
+
const Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
847
|
+
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString;
|
|
848
|
+
}
|
|
849
|
+
function isObjectLike(value) {
|
|
850
|
+
return value != null && typeof value == "object";
|
|
851
|
+
}
|
|
852
|
+
function baseGetTag(value) {
|
|
853
|
+
if (value == null) {
|
|
854
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
855
|
+
}
|
|
856
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
857
|
+
}
|
|
858
|
+
function getRawTag(value) {
|
|
859
|
+
const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
860
|
+
let unmasked = false;
|
|
861
|
+
try {
|
|
862
|
+
value[symToStringTag] = void 0;
|
|
863
|
+
unmasked = true;
|
|
864
|
+
} catch (e2) {
|
|
865
|
+
}
|
|
866
|
+
const result = nativeObjectToString.call(value);
|
|
867
|
+
if (unmasked) {
|
|
868
|
+
if (isOwn) {
|
|
869
|
+
value[symToStringTag] = tag;
|
|
870
|
+
} else {
|
|
871
|
+
delete value[symToStringTag];
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
return result;
|
|
875
|
+
}
|
|
876
|
+
function objectToString(value) {
|
|
877
|
+
return nativeObjectToString.call(value);
|
|
878
|
+
}
|
|
879
|
+
var objectTag, nullTag, undefinedTag, funcProto, funcToString, objectCtorString, getPrototypeOf, objectProto, hasOwnProperty, symToStringTag, nativeObjectToString;
|
|
880
|
+
var init_lodash_merge = __esm({
|
|
881
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/lodash.merge.js"() {
|
|
882
|
+
objectTag = "[object Object]";
|
|
883
|
+
nullTag = "[object Null]";
|
|
884
|
+
undefinedTag = "[object Undefined]";
|
|
885
|
+
funcProto = Function.prototype;
|
|
886
|
+
funcToString = funcProto.toString;
|
|
887
|
+
objectCtorString = funcToString.call(Object);
|
|
888
|
+
getPrototypeOf = Object.getPrototypeOf;
|
|
889
|
+
objectProto = Object.prototype;
|
|
890
|
+
hasOwnProperty = objectProto.hasOwnProperty;
|
|
891
|
+
symToStringTag = Symbol ? Symbol.toStringTag : void 0;
|
|
892
|
+
nativeObjectToString = objectProto.toString;
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
|
|
896
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/merge.js
|
|
897
|
+
function merge(...args) {
|
|
898
|
+
let result = args.shift();
|
|
899
|
+
const objects = /* @__PURE__ */ new WeakMap();
|
|
900
|
+
while (args.length > 0) {
|
|
901
|
+
result = mergeTwoObjects(result, args.shift(), 0, objects);
|
|
902
|
+
}
|
|
903
|
+
return result;
|
|
904
|
+
}
|
|
905
|
+
function takeValue(value) {
|
|
906
|
+
if (isArray(value)) {
|
|
907
|
+
return value.slice();
|
|
908
|
+
}
|
|
909
|
+
return value;
|
|
910
|
+
}
|
|
911
|
+
function mergeTwoObjects(one, two, level = 0, objects) {
|
|
912
|
+
let result;
|
|
913
|
+
if (level > MAX_LEVEL) {
|
|
914
|
+
return void 0;
|
|
915
|
+
}
|
|
916
|
+
level++;
|
|
917
|
+
if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) {
|
|
918
|
+
result = takeValue(two);
|
|
919
|
+
} else if (isArray(one)) {
|
|
920
|
+
result = one.slice();
|
|
921
|
+
if (isArray(two)) {
|
|
922
|
+
for (let i = 0, j = two.length; i < j; i++) {
|
|
923
|
+
result.push(takeValue(two[i]));
|
|
924
|
+
}
|
|
925
|
+
} else if (isObject(two)) {
|
|
926
|
+
const keys = Object.keys(two);
|
|
927
|
+
for (let i = 0, j = keys.length; i < j; i++) {
|
|
928
|
+
const key = keys[i];
|
|
929
|
+
result[key] = takeValue(two[key]);
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
} else if (isObject(one)) {
|
|
933
|
+
if (isObject(two)) {
|
|
934
|
+
if (!shouldMerge(one, two)) {
|
|
935
|
+
return two;
|
|
936
|
+
}
|
|
937
|
+
result = Object.assign({}, one);
|
|
938
|
+
const keys = Object.keys(two);
|
|
939
|
+
for (let i = 0, j = keys.length; i < j; i++) {
|
|
940
|
+
const key = keys[i];
|
|
941
|
+
const twoValue = two[key];
|
|
942
|
+
if (isPrimitive(twoValue)) {
|
|
943
|
+
if (typeof twoValue === "undefined") {
|
|
944
|
+
delete result[key];
|
|
945
|
+
} else {
|
|
946
|
+
result[key] = twoValue;
|
|
947
|
+
}
|
|
948
|
+
} else {
|
|
949
|
+
const obj1 = result[key];
|
|
950
|
+
const obj2 = twoValue;
|
|
951
|
+
if (wasObjectReferenced(one, key, objects) || wasObjectReferenced(two, key, objects)) {
|
|
952
|
+
delete result[key];
|
|
953
|
+
} else {
|
|
954
|
+
if (isObject(obj1) && isObject(obj2)) {
|
|
955
|
+
const arr1 = objects.get(obj1) || [];
|
|
956
|
+
const arr2 = objects.get(obj2) || [];
|
|
957
|
+
arr1.push({ obj: one, key });
|
|
958
|
+
arr2.push({ obj: two, key });
|
|
959
|
+
objects.set(obj1, arr1);
|
|
960
|
+
objects.set(obj2, arr2);
|
|
961
|
+
}
|
|
962
|
+
result[key] = mergeTwoObjects(result[key], twoValue, level, objects);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
} else {
|
|
967
|
+
result = two;
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
return result;
|
|
971
|
+
}
|
|
972
|
+
function wasObjectReferenced(obj, key, objects) {
|
|
973
|
+
const arr = objects.get(obj[key]) || [];
|
|
974
|
+
for (let i = 0, j = arr.length; i < j; i++) {
|
|
975
|
+
const info = arr[i];
|
|
976
|
+
if (info.key === key && info.obj === obj) {
|
|
977
|
+
return true;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return false;
|
|
981
|
+
}
|
|
982
|
+
function isArray(value) {
|
|
983
|
+
return Array.isArray(value);
|
|
984
|
+
}
|
|
985
|
+
function isFunction(value) {
|
|
986
|
+
return typeof value === "function";
|
|
987
|
+
}
|
|
988
|
+
function isObject(value) {
|
|
989
|
+
return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === "object";
|
|
990
|
+
}
|
|
991
|
+
function isPrimitive(value) {
|
|
992
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || value instanceof Date || value instanceof RegExp || value === null;
|
|
993
|
+
}
|
|
994
|
+
function shouldMerge(one, two) {
|
|
995
|
+
if (!isPlainObject(one) || !isPlainObject(two)) {
|
|
996
|
+
return false;
|
|
997
|
+
}
|
|
998
|
+
return true;
|
|
999
|
+
}
|
|
1000
|
+
var MAX_LEVEL;
|
|
1001
|
+
var init_merge = __esm({
|
|
1002
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/merge.js"() {
|
|
1003
|
+
init_lodash_merge();
|
|
1004
|
+
MAX_LEVEL = 20;
|
|
1005
|
+
}
|
|
1006
|
+
});
|
|
1007
|
+
|
|
1008
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/timeout.js
|
|
1009
|
+
function callWithTimeout(promise, timeout) {
|
|
1010
|
+
let timeoutHandle;
|
|
1011
|
+
const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) {
|
|
1012
|
+
timeoutHandle = setTimeout(function timeoutHandler() {
|
|
1013
|
+
reject(new TimeoutError("Operation timed out."));
|
|
1014
|
+
}, timeout);
|
|
1015
|
+
});
|
|
1016
|
+
return Promise.race([promise, timeoutPromise]).then((result) => {
|
|
1017
|
+
clearTimeout(timeoutHandle);
|
|
1018
|
+
return result;
|
|
1019
|
+
}, (reason) => {
|
|
1020
|
+
clearTimeout(timeoutHandle);
|
|
1021
|
+
throw reason;
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
var TimeoutError;
|
|
1025
|
+
var init_timeout = __esm({
|
|
1026
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/timeout.js"() {
|
|
1027
|
+
TimeoutError = class _TimeoutError extends Error {
|
|
1028
|
+
constructor(message) {
|
|
1029
|
+
super(message);
|
|
1030
|
+
Object.setPrototypeOf(this, _TimeoutError.prototype);
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
|
|
1036
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/url.js
|
|
1037
|
+
function urlMatches(url, urlToMatch) {
|
|
1038
|
+
if (typeof urlToMatch === "string") {
|
|
1039
|
+
return url === urlToMatch;
|
|
1040
|
+
} else {
|
|
1041
|
+
return !!url.match(urlToMatch);
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
function isUrlIgnored(url, ignoredUrls) {
|
|
1045
|
+
if (!ignoredUrls) {
|
|
1046
|
+
return false;
|
|
1047
|
+
}
|
|
1048
|
+
for (const ignoreUrl of ignoredUrls) {
|
|
1049
|
+
if (urlMatches(url, ignoreUrl)) {
|
|
1050
|
+
return true;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
return false;
|
|
1054
|
+
}
|
|
1055
|
+
var init_url = __esm({
|
|
1056
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/url.js"() {
|
|
1057
|
+
}
|
|
1058
|
+
});
|
|
1059
|
+
|
|
1060
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/promise.js
|
|
1061
|
+
var Deferred;
|
|
1062
|
+
var init_promise = __esm({
|
|
1063
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/promise.js"() {
|
|
1064
|
+
Deferred = class {
|
|
1065
|
+
_promise;
|
|
1066
|
+
_resolve;
|
|
1067
|
+
_reject;
|
|
1068
|
+
constructor() {
|
|
1069
|
+
this._promise = new Promise((resolve, reject) => {
|
|
1070
|
+
this._resolve = resolve;
|
|
1071
|
+
this._reject = reject;
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
get promise() {
|
|
1075
|
+
return this._promise;
|
|
1076
|
+
}
|
|
1077
|
+
resolve(val) {
|
|
1078
|
+
this._resolve(val);
|
|
1079
|
+
}
|
|
1080
|
+
reject(err) {
|
|
1081
|
+
this._reject(err);
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/callback.js
|
|
1088
|
+
var BindOnceFuture;
|
|
1089
|
+
var init_callback = __esm({
|
|
1090
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/callback.js"() {
|
|
1091
|
+
init_promise();
|
|
1092
|
+
BindOnceFuture = class {
|
|
1093
|
+
_callback;
|
|
1094
|
+
_that;
|
|
1095
|
+
_isCalled = false;
|
|
1096
|
+
_deferred = new Deferred();
|
|
1097
|
+
constructor(_callback, _that) {
|
|
1098
|
+
this._callback = _callback;
|
|
1099
|
+
this._that = _that;
|
|
1100
|
+
}
|
|
1101
|
+
get isCalled() {
|
|
1102
|
+
return this._isCalled;
|
|
1103
|
+
}
|
|
1104
|
+
get promise() {
|
|
1105
|
+
return this._deferred.promise;
|
|
1106
|
+
}
|
|
1107
|
+
call(...args) {
|
|
1108
|
+
if (!this._isCalled) {
|
|
1109
|
+
this._isCalled = true;
|
|
1110
|
+
try {
|
|
1111
|
+
Promise.resolve(this._callback.call(this._that, ...args)).then((val) => this._deferred.resolve(val), (err) => this._deferred.reject(err));
|
|
1112
|
+
} catch (err) {
|
|
1113
|
+
this._deferred.reject(err);
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
return this._deferred.promise;
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
});
|
|
1121
|
+
|
|
1122
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/configuration.js
|
|
1123
|
+
function diagLogLevelFromString(value) {
|
|
1124
|
+
if (value == null) {
|
|
1125
|
+
return void 0;
|
|
1126
|
+
}
|
|
1127
|
+
const resolvedLogLevel = logLevelMap[value.toUpperCase()];
|
|
1128
|
+
if (resolvedLogLevel == null) {
|
|
1129
|
+
diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`);
|
|
1130
|
+
return DiagLogLevel.INFO;
|
|
1131
|
+
}
|
|
1132
|
+
return resolvedLogLevel;
|
|
1133
|
+
}
|
|
1134
|
+
var logLevelMap;
|
|
1135
|
+
var init_configuration = __esm({
|
|
1136
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/utils/configuration.js"() {
|
|
1137
|
+
init_esm();
|
|
1138
|
+
logLevelMap = {
|
|
1139
|
+
ALL: DiagLogLevel.ALL,
|
|
1140
|
+
VERBOSE: DiagLogLevel.VERBOSE,
|
|
1141
|
+
DEBUG: DiagLogLevel.DEBUG,
|
|
1142
|
+
INFO: DiagLogLevel.INFO,
|
|
1143
|
+
WARN: DiagLogLevel.WARN,
|
|
1144
|
+
ERROR: DiagLogLevel.ERROR,
|
|
1145
|
+
NONE: DiagLogLevel.NONE
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
});
|
|
1149
|
+
|
|
1150
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/internal/exporter.js
|
|
1151
|
+
function _export(exporter, arg) {
|
|
1152
|
+
return new Promise((resolve) => {
|
|
1153
|
+
context.with(suppressTracing(context.active()), () => {
|
|
1154
|
+
exporter.export(arg, (result) => {
|
|
1155
|
+
resolve(result);
|
|
1156
|
+
});
|
|
1157
|
+
});
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
var init_exporter = __esm({
|
|
1161
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/internal/exporter.js"() {
|
|
1162
|
+
init_esm();
|
|
1163
|
+
init_suppress_tracing();
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
|
|
1167
|
+
// ../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/index.js
|
|
1168
|
+
var esm_exports = {};
|
|
1169
|
+
__export(esm_exports, {
|
|
1170
|
+
AnchoredClock: () => AnchoredClock,
|
|
1171
|
+
BindOnceFuture: () => BindOnceFuture,
|
|
1172
|
+
CompositePropagator: () => CompositePropagator,
|
|
1173
|
+
ExportResultCode: () => ExportResultCode,
|
|
1174
|
+
RPCType: () => RPCType,
|
|
1175
|
+
SDK_INFO: () => SDK_INFO,
|
|
1176
|
+
TRACE_PARENT_HEADER: () => TRACE_PARENT_HEADER,
|
|
1177
|
+
TRACE_STATE_HEADER: () => TRACE_STATE_HEADER,
|
|
1178
|
+
TimeoutError: () => TimeoutError,
|
|
1179
|
+
TraceState: () => TraceState,
|
|
1180
|
+
W3CBaggagePropagator: () => W3CBaggagePropagator,
|
|
1181
|
+
W3CTraceContextPropagator: () => W3CTraceContextPropagator,
|
|
1182
|
+
_globalThis: () => _globalThis,
|
|
1183
|
+
addHrTimes: () => addHrTimes,
|
|
1184
|
+
callWithTimeout: () => callWithTimeout,
|
|
1185
|
+
deleteRPCMetadata: () => deleteRPCMetadata,
|
|
1186
|
+
diagLogLevelFromString: () => diagLogLevelFromString,
|
|
1187
|
+
getBooleanFromEnv: () => getBooleanFromEnv,
|
|
1188
|
+
getNumberFromEnv: () => getNumberFromEnv,
|
|
1189
|
+
getRPCMetadata: () => getRPCMetadata,
|
|
1190
|
+
getStringFromEnv: () => getStringFromEnv,
|
|
1191
|
+
getStringListFromEnv: () => getStringListFromEnv,
|
|
1192
|
+
getTimeOrigin: () => getTimeOrigin,
|
|
1193
|
+
globalErrorHandler: () => globalErrorHandler,
|
|
1194
|
+
hrTime: () => hrTime,
|
|
1195
|
+
hrTimeDuration: () => hrTimeDuration,
|
|
1196
|
+
hrTimeToMicroseconds: () => hrTimeToMicroseconds,
|
|
1197
|
+
hrTimeToMilliseconds: () => hrTimeToMilliseconds,
|
|
1198
|
+
hrTimeToNanoseconds: () => hrTimeToNanoseconds,
|
|
1199
|
+
hrTimeToTimeStamp: () => hrTimeToTimeStamp,
|
|
1200
|
+
internal: () => internal,
|
|
1201
|
+
isAttributeValue: () => isAttributeValue,
|
|
1202
|
+
isTimeInput: () => isTimeInput,
|
|
1203
|
+
isTimeInputHrTime: () => isTimeInputHrTime,
|
|
1204
|
+
isTracingSuppressed: () => isTracingSuppressed,
|
|
1205
|
+
isUrlIgnored: () => isUrlIgnored,
|
|
1206
|
+
loggingErrorHandler: () => loggingErrorHandler,
|
|
1207
|
+
merge: () => merge,
|
|
1208
|
+
millisToHrTime: () => millisToHrTime,
|
|
1209
|
+
otperformance: () => otperformance,
|
|
1210
|
+
parseKeyPairsIntoRecord: () => parseKeyPairsIntoRecord,
|
|
1211
|
+
parseTraceParent: () => parseTraceParent,
|
|
1212
|
+
sanitizeAttributes: () => sanitizeAttributes,
|
|
1213
|
+
setGlobalErrorHandler: () => setGlobalErrorHandler,
|
|
1214
|
+
setRPCMetadata: () => setRPCMetadata,
|
|
1215
|
+
suppressTracing: () => suppressTracing,
|
|
1216
|
+
timeInputToHrTime: () => timeInputToHrTime,
|
|
1217
|
+
unrefTimer: () => unrefTimer,
|
|
1218
|
+
unsuppressTracing: () => unsuppressTracing,
|
|
1219
|
+
urlMatches: () => urlMatches
|
|
1220
|
+
});
|
|
1221
|
+
var internal;
|
|
1222
|
+
var init_esm3 = __esm({
|
|
1223
|
+
"../../node_modules/.pnpm/@opentelemetry+core@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/core/build/esm/index.js"() {
|
|
1224
|
+
init_W3CBaggagePropagator();
|
|
1225
|
+
init_anchored_clock();
|
|
1226
|
+
init_attributes();
|
|
1227
|
+
init_global_error_handler();
|
|
1228
|
+
init_logging_error_handler();
|
|
1229
|
+
init_time();
|
|
1230
|
+
init_ExportResult();
|
|
1231
|
+
init_utils();
|
|
1232
|
+
init_platform();
|
|
1233
|
+
init_composite();
|
|
1234
|
+
init_W3CTraceContextPropagator();
|
|
1235
|
+
init_rpc_metadata();
|
|
1236
|
+
init_suppress_tracing();
|
|
1237
|
+
init_TraceState();
|
|
1238
|
+
init_merge();
|
|
1239
|
+
init_timeout();
|
|
1240
|
+
init_url();
|
|
1241
|
+
init_callback();
|
|
1242
|
+
init_configuration();
|
|
1243
|
+
init_exporter();
|
|
1244
|
+
internal = {
|
|
1245
|
+
_export
|
|
1246
|
+
};
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
|
|
1250
|
+
// ../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js
|
|
1251
|
+
function defaultServiceName() {
|
|
1252
|
+
return `unknown_service:${process.argv0}`;
|
|
1253
|
+
}
|
|
1254
|
+
var init_default_service_name = __esm({
|
|
1255
|
+
"../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js"() {
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
|
|
1259
|
+
// ../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/platform/node/index.js
|
|
1260
|
+
var init_node2 = __esm({
|
|
1261
|
+
"../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/platform/node/index.js"() {
|
|
1262
|
+
init_default_service_name();
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
|
|
1266
|
+
// ../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/platform/index.js
|
|
1267
|
+
var init_platform2 = __esm({
|
|
1268
|
+
"../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/platform/index.js"() {
|
|
1269
|
+
init_node2();
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
|
|
1273
|
+
// ../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/utils.js
|
|
1274
|
+
var isPromiseLike;
|
|
1275
|
+
var init_utils2 = __esm({
|
|
1276
|
+
"../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/utils.js"() {
|
|
1277
|
+
isPromiseLike = (val) => {
|
|
1278
|
+
return val !== null && typeof val === "object" && typeof val.then === "function";
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
|
|
1283
|
+
// ../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js
|
|
1284
|
+
function resourceFromAttributes(attributes) {
|
|
1285
|
+
return ResourceImpl.FromAttributeList(Object.entries(attributes));
|
|
1286
|
+
}
|
|
1287
|
+
function defaultResource() {
|
|
1288
|
+
return resourceFromAttributes({
|
|
1289
|
+
[ATTR_SERVICE_NAME]: defaultServiceName(),
|
|
1290
|
+
[ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],
|
|
1291
|
+
[ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],
|
|
1292
|
+
[ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION]
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
function guardedRawAttributes(attributes) {
|
|
1296
|
+
return attributes.map(([k, v]) => {
|
|
1297
|
+
if (isPromiseLike(v)) {
|
|
1298
|
+
return [
|
|
1299
|
+
k,
|
|
1300
|
+
v.catch((err) => {
|
|
1301
|
+
diag.debug("promise rejection for resource attribute: %s - %s", k, err);
|
|
1302
|
+
return void 0;
|
|
1303
|
+
})
|
|
1304
|
+
];
|
|
1305
|
+
}
|
|
1306
|
+
return [k, v];
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
var ResourceImpl;
|
|
1310
|
+
var init_ResourceImpl = __esm({
|
|
1311
|
+
"../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js"() {
|
|
1312
|
+
init_esm();
|
|
1313
|
+
init_esm3();
|
|
1314
|
+
init_esm2();
|
|
1315
|
+
init_platform2();
|
|
1316
|
+
init_utils2();
|
|
1317
|
+
ResourceImpl = class _ResourceImpl {
|
|
1318
|
+
_rawAttributes;
|
|
1319
|
+
_asyncAttributesPending = false;
|
|
1320
|
+
_memoizedAttributes;
|
|
1321
|
+
static FromAttributeList(attributes) {
|
|
1322
|
+
const res = new _ResourceImpl({});
|
|
1323
|
+
res._rawAttributes = guardedRawAttributes(attributes);
|
|
1324
|
+
res._asyncAttributesPending = attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;
|
|
1325
|
+
return res;
|
|
1326
|
+
}
|
|
1327
|
+
constructor(resource) {
|
|
1328
|
+
const attributes = resource.attributes ?? {};
|
|
1329
|
+
this._rawAttributes = Object.entries(attributes).map(([k, v]) => {
|
|
1330
|
+
if (isPromiseLike(v)) {
|
|
1331
|
+
this._asyncAttributesPending = true;
|
|
1332
|
+
}
|
|
1333
|
+
return [k, v];
|
|
1334
|
+
});
|
|
1335
|
+
this._rawAttributes = guardedRawAttributes(this._rawAttributes);
|
|
1336
|
+
}
|
|
1337
|
+
get asyncAttributesPending() {
|
|
1338
|
+
return this._asyncAttributesPending;
|
|
1339
|
+
}
|
|
1340
|
+
async waitForAsyncAttributes() {
|
|
1341
|
+
if (!this.asyncAttributesPending) {
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1344
|
+
for (let i = 0; i < this._rawAttributes.length; i++) {
|
|
1345
|
+
const [k, v] = this._rawAttributes[i];
|
|
1346
|
+
this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];
|
|
1347
|
+
}
|
|
1348
|
+
this._asyncAttributesPending = false;
|
|
1349
|
+
}
|
|
1350
|
+
get attributes() {
|
|
1351
|
+
if (this.asyncAttributesPending) {
|
|
1352
|
+
diag.error("Accessing resource attributes before async attributes settled");
|
|
1353
|
+
}
|
|
1354
|
+
if (this._memoizedAttributes) {
|
|
1355
|
+
return this._memoizedAttributes;
|
|
1356
|
+
}
|
|
1357
|
+
const attrs = {};
|
|
1358
|
+
for (const [k, v] of this._rawAttributes) {
|
|
1359
|
+
if (isPromiseLike(v)) {
|
|
1360
|
+
diag.debug(`Unsettled resource attribute ${k} skipped`);
|
|
1361
|
+
continue;
|
|
1362
|
+
}
|
|
1363
|
+
if (v != null) {
|
|
1364
|
+
attrs[k] ??= v;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
if (!this._asyncAttributesPending) {
|
|
1368
|
+
this._memoizedAttributes = attrs;
|
|
1369
|
+
}
|
|
1370
|
+
return attrs;
|
|
1371
|
+
}
|
|
1372
|
+
getRawAttributes() {
|
|
1373
|
+
return this._rawAttributes;
|
|
1374
|
+
}
|
|
1375
|
+
merge(resource) {
|
|
1376
|
+
if (resource == null)
|
|
1377
|
+
return this;
|
|
1378
|
+
return _ResourceImpl.FromAttributeList([
|
|
1379
|
+
...resource.getRawAttributes(),
|
|
1380
|
+
...this.getRawAttributes()
|
|
1381
|
+
]);
|
|
1382
|
+
}
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
});
|
|
1386
|
+
|
|
1387
|
+
// ../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/index.js
|
|
1388
|
+
var init_esm4 = __esm({
|
|
1389
|
+
"../../node_modules/.pnpm/@opentelemetry+resources@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/resources/build/esm/index.js"() {
|
|
1390
|
+
init_ResourceImpl();
|
|
1391
|
+
}
|
|
1392
|
+
});
|
|
1393
|
+
|
|
1394
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/BatchSpanProcessorBase.js
|
|
1395
|
+
var BatchSpanProcessorBase;
|
|
1396
|
+
var init_BatchSpanProcessorBase = __esm({
|
|
1397
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/BatchSpanProcessorBase.js"() {
|
|
1398
|
+
init_esm();
|
|
1399
|
+
init_esm3();
|
|
1400
|
+
BatchSpanProcessorBase = class {
|
|
1401
|
+
_exporter;
|
|
1402
|
+
_maxExportBatchSize;
|
|
1403
|
+
_maxQueueSize;
|
|
1404
|
+
_scheduledDelayMillis;
|
|
1405
|
+
_exportTimeoutMillis;
|
|
1406
|
+
_isExporting = false;
|
|
1407
|
+
_finishedSpans = [];
|
|
1408
|
+
_timer;
|
|
1409
|
+
_shutdownOnce;
|
|
1410
|
+
_droppedSpansCount = 0;
|
|
1411
|
+
constructor(_exporter, config) {
|
|
1412
|
+
this._exporter = _exporter;
|
|
1413
|
+
this._maxExportBatchSize = typeof config?.maxExportBatchSize === "number" ? config.maxExportBatchSize : getNumberFromEnv("OTEL_BSP_MAX_EXPORT_BATCH_SIZE") ?? 512;
|
|
1414
|
+
this._maxQueueSize = typeof config?.maxQueueSize === "number" ? config.maxQueueSize : getNumberFromEnv("OTEL_BSP_MAX_QUEUE_SIZE") ?? 2048;
|
|
1415
|
+
this._scheduledDelayMillis = typeof config?.scheduledDelayMillis === "number" ? config.scheduledDelayMillis : getNumberFromEnv("OTEL_BSP_SCHEDULE_DELAY") ?? 5e3;
|
|
1416
|
+
this._exportTimeoutMillis = typeof config?.exportTimeoutMillis === "number" ? config.exportTimeoutMillis : getNumberFromEnv("OTEL_BSP_EXPORT_TIMEOUT") ?? 3e4;
|
|
1417
|
+
this._shutdownOnce = new BindOnceFuture(this._shutdown, this);
|
|
1418
|
+
if (this._maxExportBatchSize > this._maxQueueSize) {
|
|
1419
|
+
diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize");
|
|
1420
|
+
this._maxExportBatchSize = this._maxQueueSize;
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
forceFlush() {
|
|
1424
|
+
if (this._shutdownOnce.isCalled) {
|
|
1425
|
+
return this._shutdownOnce.promise;
|
|
1426
|
+
}
|
|
1427
|
+
return this._flushAll();
|
|
1428
|
+
}
|
|
1429
|
+
// does nothing.
|
|
1430
|
+
onStart(_span, _parentContext) {
|
|
1431
|
+
}
|
|
1432
|
+
onEnd(span) {
|
|
1433
|
+
if (this._shutdownOnce.isCalled) {
|
|
1434
|
+
return;
|
|
1435
|
+
}
|
|
1436
|
+
if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) {
|
|
1437
|
+
return;
|
|
1438
|
+
}
|
|
1439
|
+
this._addToBuffer(span);
|
|
1440
|
+
}
|
|
1441
|
+
shutdown() {
|
|
1442
|
+
return this._shutdownOnce.call();
|
|
1443
|
+
}
|
|
1444
|
+
_shutdown() {
|
|
1445
|
+
return Promise.resolve().then(() => {
|
|
1446
|
+
return this.onShutdown();
|
|
1447
|
+
}).then(() => {
|
|
1448
|
+
return this._flushAll();
|
|
1449
|
+
}).then(() => {
|
|
1450
|
+
return this._exporter.shutdown();
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
/** Add a span in the buffer. */
|
|
1454
|
+
_addToBuffer(span) {
|
|
1455
|
+
if (this._finishedSpans.length >= this._maxQueueSize) {
|
|
1456
|
+
if (this._droppedSpansCount === 0) {
|
|
1457
|
+
diag.debug("maxQueueSize reached, dropping spans");
|
|
1458
|
+
}
|
|
1459
|
+
this._droppedSpansCount++;
|
|
1460
|
+
return;
|
|
1461
|
+
}
|
|
1462
|
+
if (this._droppedSpansCount > 0) {
|
|
1463
|
+
diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`);
|
|
1464
|
+
this._droppedSpansCount = 0;
|
|
1465
|
+
}
|
|
1466
|
+
this._finishedSpans.push(span);
|
|
1467
|
+
this._maybeStartTimer();
|
|
1468
|
+
}
|
|
1469
|
+
/**
|
|
1470
|
+
* Send all spans to the exporter respecting the batch size limit
|
|
1471
|
+
* This function is used only on forceFlush or shutdown,
|
|
1472
|
+
* for all other cases _flush should be used
|
|
1473
|
+
* */
|
|
1474
|
+
_flushAll() {
|
|
1475
|
+
return new Promise((resolve, reject) => {
|
|
1476
|
+
const promises = [];
|
|
1477
|
+
const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize);
|
|
1478
|
+
for (let i = 0, j = count; i < j; i++) {
|
|
1479
|
+
promises.push(this._flushOneBatch());
|
|
1480
|
+
}
|
|
1481
|
+
Promise.all(promises).then(() => {
|
|
1482
|
+
resolve();
|
|
1483
|
+
}).catch(reject);
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
_flushOneBatch() {
|
|
1487
|
+
this._clearTimer();
|
|
1488
|
+
if (this._finishedSpans.length === 0) {
|
|
1489
|
+
return Promise.resolve();
|
|
1490
|
+
}
|
|
1491
|
+
return new Promise((resolve, reject) => {
|
|
1492
|
+
const timer = setTimeout(() => {
|
|
1493
|
+
reject(new Error("Timeout"));
|
|
1494
|
+
}, this._exportTimeoutMillis);
|
|
1495
|
+
context.with(suppressTracing(context.active()), () => {
|
|
1496
|
+
let spans;
|
|
1497
|
+
if (this._finishedSpans.length <= this._maxExportBatchSize) {
|
|
1498
|
+
spans = this._finishedSpans;
|
|
1499
|
+
this._finishedSpans = [];
|
|
1500
|
+
} else {
|
|
1501
|
+
spans = this._finishedSpans.splice(0, this._maxExportBatchSize);
|
|
1502
|
+
}
|
|
1503
|
+
const doExport = () => this._exporter.export(spans, (result) => {
|
|
1504
|
+
clearTimeout(timer);
|
|
1505
|
+
if (result.code === ExportResultCode.SUCCESS) {
|
|
1506
|
+
resolve();
|
|
1507
|
+
} else {
|
|
1508
|
+
reject(result.error ?? new Error("BatchSpanProcessor: span export failed"));
|
|
1509
|
+
}
|
|
1510
|
+
});
|
|
1511
|
+
let pendingResources = null;
|
|
1512
|
+
for (let i = 0, len = spans.length; i < len; i++) {
|
|
1513
|
+
const span = spans[i];
|
|
1514
|
+
if (span.resource.asyncAttributesPending && span.resource.waitForAsyncAttributes) {
|
|
1515
|
+
pendingResources ??= [];
|
|
1516
|
+
pendingResources.push(span.resource.waitForAsyncAttributes());
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
if (pendingResources === null) {
|
|
1520
|
+
doExport();
|
|
1521
|
+
} else {
|
|
1522
|
+
Promise.all(pendingResources).then(doExport, (err) => {
|
|
1523
|
+
globalErrorHandler(err);
|
|
1524
|
+
reject(err);
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
});
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
_maybeStartTimer() {
|
|
1531
|
+
if (this._isExporting)
|
|
1532
|
+
return;
|
|
1533
|
+
const flush = () => {
|
|
1534
|
+
this._isExporting = true;
|
|
1535
|
+
this._flushOneBatch().finally(() => {
|
|
1536
|
+
this._isExporting = false;
|
|
1537
|
+
if (this._finishedSpans.length > 0) {
|
|
1538
|
+
this._clearTimer();
|
|
1539
|
+
this._maybeStartTimer();
|
|
1540
|
+
}
|
|
1541
|
+
}).catch((e2) => {
|
|
1542
|
+
this._isExporting = false;
|
|
1543
|
+
globalErrorHandler(e2);
|
|
1544
|
+
});
|
|
1545
|
+
};
|
|
1546
|
+
if (this._finishedSpans.length >= this._maxExportBatchSize) {
|
|
1547
|
+
return flush();
|
|
1548
|
+
}
|
|
1549
|
+
if (this._timer !== void 0)
|
|
1550
|
+
return;
|
|
1551
|
+
this._timer = setTimeout(() => flush(), this._scheduledDelayMillis);
|
|
1552
|
+
unrefTimer(this._timer);
|
|
1553
|
+
}
|
|
1554
|
+
_clearTimer() {
|
|
1555
|
+
if (this._timer !== void 0) {
|
|
1556
|
+
clearTimeout(this._timer);
|
|
1557
|
+
this._timer = void 0;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
};
|
|
1561
|
+
}
|
|
1562
|
+
});
|
|
1563
|
+
|
|
1564
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/export/BatchSpanProcessor.js
|
|
1565
|
+
var BatchSpanProcessor;
|
|
1566
|
+
var init_BatchSpanProcessor = __esm({
|
|
1567
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/export/BatchSpanProcessor.js"() {
|
|
1568
|
+
init_BatchSpanProcessorBase();
|
|
1569
|
+
BatchSpanProcessor = class extends BatchSpanProcessorBase {
|
|
1570
|
+
onShutdown() {
|
|
1571
|
+
}
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
});
|
|
1575
|
+
|
|
1576
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/RandomIdGenerator.js
|
|
1577
|
+
function getIdGenerator(bytes) {
|
|
1578
|
+
return function generateId() {
|
|
1579
|
+
for (let i = 0; i < bytes / 4; i++) {
|
|
1580
|
+
SHARED_BUFFER.writeUInt32BE(Math.random() * 2 ** 32 >>> 0, i * 4);
|
|
1581
|
+
}
|
|
1582
|
+
for (let i = 0; i < bytes; i++) {
|
|
1583
|
+
if (SHARED_BUFFER[i] > 0) {
|
|
1584
|
+
break;
|
|
1585
|
+
} else if (i === bytes - 1) {
|
|
1586
|
+
SHARED_BUFFER[bytes - 1] = 1;
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
return SHARED_BUFFER.toString("hex", 0, bytes);
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
var SPAN_ID_BYTES, TRACE_ID_BYTES, RandomIdGenerator, SHARED_BUFFER;
|
|
1593
|
+
var init_RandomIdGenerator = __esm({
|
|
1594
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/RandomIdGenerator.js"() {
|
|
1595
|
+
SPAN_ID_BYTES = 8;
|
|
1596
|
+
TRACE_ID_BYTES = 16;
|
|
1597
|
+
RandomIdGenerator = class {
|
|
1598
|
+
/**
|
|
1599
|
+
* Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex
|
|
1600
|
+
* characters corresponding to 128 bits.
|
|
1601
|
+
*/
|
|
1602
|
+
generateTraceId = getIdGenerator(TRACE_ID_BYTES);
|
|
1603
|
+
/**
|
|
1604
|
+
* Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex
|
|
1605
|
+
* characters corresponding to 64 bits.
|
|
1606
|
+
*/
|
|
1607
|
+
generateSpanId = getIdGenerator(SPAN_ID_BYTES);
|
|
1608
|
+
};
|
|
1609
|
+
SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES);
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/index.js
|
|
1614
|
+
var init_node3 = __esm({
|
|
1615
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/index.js"() {
|
|
1616
|
+
init_BatchSpanProcessor();
|
|
1617
|
+
init_RandomIdGenerator();
|
|
1618
|
+
}
|
|
1619
|
+
});
|
|
1620
|
+
|
|
1621
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/index.js
|
|
1622
|
+
var init_platform3 = __esm({
|
|
1623
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/index.js"() {
|
|
1624
|
+
init_node3();
|
|
1625
|
+
}
|
|
1626
|
+
});
|
|
1627
|
+
|
|
1628
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/enums.js
|
|
1629
|
+
var ExceptionEventName;
|
|
1630
|
+
var init_enums = __esm({
|
|
1631
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/enums.js"() {
|
|
1632
|
+
ExceptionEventName = "exception";
|
|
1633
|
+
}
|
|
1634
|
+
});
|
|
1635
|
+
|
|
1636
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/Span.js
|
|
1637
|
+
var SpanImpl;
|
|
1638
|
+
var init_Span = __esm({
|
|
1639
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/Span.js"() {
|
|
1640
|
+
init_esm();
|
|
1641
|
+
init_esm3();
|
|
1642
|
+
init_esm2();
|
|
1643
|
+
init_enums();
|
|
1644
|
+
SpanImpl = class {
|
|
1645
|
+
// Below properties are included to implement ReadableSpan for export
|
|
1646
|
+
// purposes but are not intended to be written-to directly.
|
|
1647
|
+
_spanContext;
|
|
1648
|
+
kind;
|
|
1649
|
+
parentSpanContext;
|
|
1650
|
+
attributes = {};
|
|
1651
|
+
links = [];
|
|
1652
|
+
events = [];
|
|
1653
|
+
startTime;
|
|
1654
|
+
resource;
|
|
1655
|
+
instrumentationScope;
|
|
1656
|
+
_droppedAttributesCount = 0;
|
|
1657
|
+
_droppedEventsCount = 0;
|
|
1658
|
+
_droppedLinksCount = 0;
|
|
1659
|
+
name;
|
|
1660
|
+
status = {
|
|
1661
|
+
code: SpanStatusCode.UNSET
|
|
1662
|
+
};
|
|
1663
|
+
endTime = [0, 0];
|
|
1664
|
+
_ended = false;
|
|
1665
|
+
_duration = [-1, -1];
|
|
1666
|
+
_spanProcessor;
|
|
1667
|
+
_spanLimits;
|
|
1668
|
+
_attributeValueLengthLimit;
|
|
1669
|
+
_performanceStartTime;
|
|
1670
|
+
_performanceOffset;
|
|
1671
|
+
_startTimeProvided;
|
|
1672
|
+
/**
|
|
1673
|
+
* Constructs a new SpanImpl instance.
|
|
1674
|
+
*/
|
|
1675
|
+
constructor(opts) {
|
|
1676
|
+
const now = Date.now();
|
|
1677
|
+
this._spanContext = opts.spanContext;
|
|
1678
|
+
this._performanceStartTime = otperformance.now();
|
|
1679
|
+
this._performanceOffset = now - (this._performanceStartTime + getTimeOrigin());
|
|
1680
|
+
this._startTimeProvided = opts.startTime != null;
|
|
1681
|
+
this._spanLimits = opts.spanLimits;
|
|
1682
|
+
this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit || 0;
|
|
1683
|
+
this._spanProcessor = opts.spanProcessor;
|
|
1684
|
+
this.name = opts.name;
|
|
1685
|
+
this.parentSpanContext = opts.parentSpanContext;
|
|
1686
|
+
this.kind = opts.kind;
|
|
1687
|
+
this.links = opts.links || [];
|
|
1688
|
+
this.startTime = this._getTime(opts.startTime ?? now);
|
|
1689
|
+
this.resource = opts.resource;
|
|
1690
|
+
this.instrumentationScope = opts.scope;
|
|
1691
|
+
if (opts.attributes != null) {
|
|
1692
|
+
this.setAttributes(opts.attributes);
|
|
1693
|
+
}
|
|
1694
|
+
this._spanProcessor.onStart(this, opts.context);
|
|
1695
|
+
}
|
|
1696
|
+
spanContext() {
|
|
1697
|
+
return this._spanContext;
|
|
1698
|
+
}
|
|
1699
|
+
setAttribute(key, value) {
|
|
1700
|
+
if (value == null || this._isSpanEnded())
|
|
1701
|
+
return this;
|
|
1702
|
+
if (key.length === 0) {
|
|
1703
|
+
diag.warn(`Invalid attribute key: ${key}`);
|
|
1704
|
+
return this;
|
|
1705
|
+
}
|
|
1706
|
+
if (!isAttributeValue(value)) {
|
|
1707
|
+
diag.warn(`Invalid attribute value set for key: ${key}`);
|
|
1708
|
+
return this;
|
|
1709
|
+
}
|
|
1710
|
+
const { attributeCountLimit } = this._spanLimits;
|
|
1711
|
+
if (attributeCountLimit !== void 0 && Object.keys(this.attributes).length >= attributeCountLimit && !Object.prototype.hasOwnProperty.call(this.attributes, key)) {
|
|
1712
|
+
this._droppedAttributesCount++;
|
|
1713
|
+
return this;
|
|
1714
|
+
}
|
|
1715
|
+
this.attributes[key] = this._truncateToSize(value);
|
|
1716
|
+
return this;
|
|
1717
|
+
}
|
|
1718
|
+
setAttributes(attributes) {
|
|
1719
|
+
for (const [k, v] of Object.entries(attributes)) {
|
|
1720
|
+
this.setAttribute(k, v);
|
|
1721
|
+
}
|
|
1722
|
+
return this;
|
|
1723
|
+
}
|
|
1724
|
+
/**
|
|
1725
|
+
*
|
|
1726
|
+
* @param name Span Name
|
|
1727
|
+
* @param [attributesOrStartTime] Span attributes or start time
|
|
1728
|
+
* if type is {@type TimeInput} and 3rd param is undefined
|
|
1729
|
+
* @param [timeStamp] Specified time stamp for the event
|
|
1730
|
+
*/
|
|
1731
|
+
addEvent(name, attributesOrStartTime, timeStamp) {
|
|
1732
|
+
if (this._isSpanEnded())
|
|
1733
|
+
return this;
|
|
1734
|
+
const { eventCountLimit } = this._spanLimits;
|
|
1735
|
+
if (eventCountLimit === 0) {
|
|
1736
|
+
diag.warn("No events allowed.");
|
|
1737
|
+
this._droppedEventsCount++;
|
|
1738
|
+
return this;
|
|
1739
|
+
}
|
|
1740
|
+
if (eventCountLimit !== void 0 && this.events.length >= eventCountLimit) {
|
|
1741
|
+
if (this._droppedEventsCount === 0) {
|
|
1742
|
+
diag.debug("Dropping extra events.");
|
|
1743
|
+
}
|
|
1744
|
+
this.events.shift();
|
|
1745
|
+
this._droppedEventsCount++;
|
|
1746
|
+
}
|
|
1747
|
+
if (isTimeInput(attributesOrStartTime)) {
|
|
1748
|
+
if (!isTimeInput(timeStamp)) {
|
|
1749
|
+
timeStamp = attributesOrStartTime;
|
|
1750
|
+
}
|
|
1751
|
+
attributesOrStartTime = void 0;
|
|
1752
|
+
}
|
|
1753
|
+
const attributes = sanitizeAttributes(attributesOrStartTime);
|
|
1754
|
+
this.events.push({
|
|
1755
|
+
name,
|
|
1756
|
+
attributes,
|
|
1757
|
+
time: this._getTime(timeStamp),
|
|
1758
|
+
droppedAttributesCount: 0
|
|
1759
|
+
});
|
|
1760
|
+
return this;
|
|
1761
|
+
}
|
|
1762
|
+
addLink(link) {
|
|
1763
|
+
this.links.push(link);
|
|
1764
|
+
return this;
|
|
1765
|
+
}
|
|
1766
|
+
addLinks(links) {
|
|
1767
|
+
this.links.push(...links);
|
|
1768
|
+
return this;
|
|
1769
|
+
}
|
|
1770
|
+
setStatus(status) {
|
|
1771
|
+
if (this._isSpanEnded())
|
|
1772
|
+
return this;
|
|
1773
|
+
this.status = { ...status };
|
|
1774
|
+
if (this.status.message != null && typeof status.message !== "string") {
|
|
1775
|
+
diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`);
|
|
1776
|
+
delete this.status.message;
|
|
1777
|
+
}
|
|
1778
|
+
return this;
|
|
1779
|
+
}
|
|
1780
|
+
updateName(name) {
|
|
1781
|
+
if (this._isSpanEnded())
|
|
1782
|
+
return this;
|
|
1783
|
+
this.name = name;
|
|
1784
|
+
return this;
|
|
1785
|
+
}
|
|
1786
|
+
end(endTime) {
|
|
1787
|
+
if (this._isSpanEnded()) {
|
|
1788
|
+
diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);
|
|
1789
|
+
return;
|
|
1790
|
+
}
|
|
1791
|
+
this._ended = true;
|
|
1792
|
+
this.endTime = this._getTime(endTime);
|
|
1793
|
+
this._duration = hrTimeDuration(this.startTime, this.endTime);
|
|
1794
|
+
if (this._duration[0] < 0) {
|
|
1795
|
+
diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.", this.startTime, this.endTime);
|
|
1796
|
+
this.endTime = this.startTime.slice();
|
|
1797
|
+
this._duration = [0, 0];
|
|
1798
|
+
}
|
|
1799
|
+
if (this._droppedEventsCount > 0) {
|
|
1800
|
+
diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);
|
|
1801
|
+
}
|
|
1802
|
+
this._spanProcessor.onEnd(this);
|
|
1803
|
+
}
|
|
1804
|
+
_getTime(inp) {
|
|
1805
|
+
if (typeof inp === "number" && inp <= otperformance.now()) {
|
|
1806
|
+
return hrTime(inp + this._performanceOffset);
|
|
1807
|
+
}
|
|
1808
|
+
if (typeof inp === "number") {
|
|
1809
|
+
return millisToHrTime(inp);
|
|
1810
|
+
}
|
|
1811
|
+
if (inp instanceof Date) {
|
|
1812
|
+
return millisToHrTime(inp.getTime());
|
|
1813
|
+
}
|
|
1814
|
+
if (isTimeInputHrTime(inp)) {
|
|
1815
|
+
return inp;
|
|
1816
|
+
}
|
|
1817
|
+
if (this._startTimeProvided) {
|
|
1818
|
+
return millisToHrTime(Date.now());
|
|
1819
|
+
}
|
|
1820
|
+
const msDuration = otperformance.now() - this._performanceStartTime;
|
|
1821
|
+
return addHrTimes(this.startTime, millisToHrTime(msDuration));
|
|
1822
|
+
}
|
|
1823
|
+
isRecording() {
|
|
1824
|
+
return this._ended === false;
|
|
1825
|
+
}
|
|
1826
|
+
recordException(exception, time) {
|
|
1827
|
+
const attributes = {};
|
|
1828
|
+
if (typeof exception === "string") {
|
|
1829
|
+
attributes[ATTR_EXCEPTION_MESSAGE] = exception;
|
|
1830
|
+
} else if (exception) {
|
|
1831
|
+
if (exception.code) {
|
|
1832
|
+
attributes[ATTR_EXCEPTION_TYPE] = exception.code.toString();
|
|
1833
|
+
} else if (exception.name) {
|
|
1834
|
+
attributes[ATTR_EXCEPTION_TYPE] = exception.name;
|
|
1835
|
+
}
|
|
1836
|
+
if (exception.message) {
|
|
1837
|
+
attributes[ATTR_EXCEPTION_MESSAGE] = exception.message;
|
|
1838
|
+
}
|
|
1839
|
+
if (exception.stack) {
|
|
1840
|
+
attributes[ATTR_EXCEPTION_STACKTRACE] = exception.stack;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
if (attributes[ATTR_EXCEPTION_TYPE] || attributes[ATTR_EXCEPTION_MESSAGE]) {
|
|
1844
|
+
this.addEvent(ExceptionEventName, attributes, time);
|
|
1845
|
+
} else {
|
|
1846
|
+
diag.warn(`Failed to record an exception ${exception}`);
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
get duration() {
|
|
1850
|
+
return this._duration;
|
|
1851
|
+
}
|
|
1852
|
+
get ended() {
|
|
1853
|
+
return this._ended;
|
|
1854
|
+
}
|
|
1855
|
+
get droppedAttributesCount() {
|
|
1856
|
+
return this._droppedAttributesCount;
|
|
1857
|
+
}
|
|
1858
|
+
get droppedEventsCount() {
|
|
1859
|
+
return this._droppedEventsCount;
|
|
1860
|
+
}
|
|
1861
|
+
get droppedLinksCount() {
|
|
1862
|
+
return this._droppedLinksCount;
|
|
1863
|
+
}
|
|
1864
|
+
_isSpanEnded() {
|
|
1865
|
+
if (this._ended) {
|
|
1866
|
+
const error = new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);
|
|
1867
|
+
diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`, error);
|
|
1868
|
+
}
|
|
1869
|
+
return this._ended;
|
|
1870
|
+
}
|
|
1871
|
+
// Utility function to truncate given value within size
|
|
1872
|
+
// for value type of string, will truncate to given limit
|
|
1873
|
+
// for type of non-string, will return same value
|
|
1874
|
+
_truncateToLimitUtil(value, limit) {
|
|
1875
|
+
if (value.length <= limit) {
|
|
1876
|
+
return value;
|
|
1877
|
+
}
|
|
1878
|
+
return value.substring(0, limit);
|
|
1879
|
+
}
|
|
1880
|
+
/**
|
|
1881
|
+
* If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then
|
|
1882
|
+
* return string with truncated to {@code attributeValueLengthLimit} characters
|
|
1883
|
+
*
|
|
1884
|
+
* If the given attribute value is array of strings then
|
|
1885
|
+
* return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters
|
|
1886
|
+
*
|
|
1887
|
+
* Otherwise return same Attribute {@code value}
|
|
1888
|
+
*
|
|
1889
|
+
* @param value Attribute value
|
|
1890
|
+
* @returns truncated attribute value if required, otherwise same value
|
|
1891
|
+
*/
|
|
1892
|
+
_truncateToSize(value) {
|
|
1893
|
+
const limit = this._attributeValueLengthLimit;
|
|
1894
|
+
if (limit <= 0) {
|
|
1895
|
+
diag.warn(`Attribute value limit must be positive, got ${limit}`);
|
|
1896
|
+
return value;
|
|
1897
|
+
}
|
|
1898
|
+
if (typeof value === "string") {
|
|
1899
|
+
return this._truncateToLimitUtil(value, limit);
|
|
1900
|
+
}
|
|
1901
|
+
if (Array.isArray(value)) {
|
|
1902
|
+
return value.map((val) => typeof val === "string" ? this._truncateToLimitUtil(val, limit) : val);
|
|
1903
|
+
}
|
|
1904
|
+
return value;
|
|
1905
|
+
}
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1908
|
+
});
|
|
1909
|
+
|
|
1910
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/Sampler.js
|
|
1911
|
+
var SamplingDecision2;
|
|
1912
|
+
var init_Sampler = __esm({
|
|
1913
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/Sampler.js"() {
|
|
1914
|
+
(function(SamplingDecision3) {
|
|
1915
|
+
SamplingDecision3[SamplingDecision3["NOT_RECORD"] = 0] = "NOT_RECORD";
|
|
1916
|
+
SamplingDecision3[SamplingDecision3["RECORD"] = 1] = "RECORD";
|
|
1917
|
+
SamplingDecision3[SamplingDecision3["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED";
|
|
1918
|
+
})(SamplingDecision2 || (SamplingDecision2 = {}));
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1921
|
+
|
|
1922
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOffSampler.js
|
|
1923
|
+
var AlwaysOffSampler;
|
|
1924
|
+
var init_AlwaysOffSampler = __esm({
|
|
1925
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOffSampler.js"() {
|
|
1926
|
+
init_Sampler();
|
|
1927
|
+
AlwaysOffSampler = class {
|
|
1928
|
+
shouldSample() {
|
|
1929
|
+
return {
|
|
1930
|
+
decision: SamplingDecision2.NOT_RECORD
|
|
1931
|
+
};
|
|
1932
|
+
}
|
|
1933
|
+
toString() {
|
|
1934
|
+
return "AlwaysOffSampler";
|
|
1935
|
+
}
|
|
1936
|
+
};
|
|
1937
|
+
}
|
|
1938
|
+
});
|
|
1939
|
+
|
|
1940
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOnSampler.js
|
|
1941
|
+
var AlwaysOnSampler;
|
|
1942
|
+
var init_AlwaysOnSampler = __esm({
|
|
1943
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOnSampler.js"() {
|
|
1944
|
+
init_Sampler();
|
|
1945
|
+
AlwaysOnSampler = class {
|
|
1946
|
+
shouldSample() {
|
|
1947
|
+
return {
|
|
1948
|
+
decision: SamplingDecision2.RECORD_AND_SAMPLED
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
1951
|
+
toString() {
|
|
1952
|
+
return "AlwaysOnSampler";
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
});
|
|
1957
|
+
|
|
1958
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/ParentBasedSampler.js
|
|
1959
|
+
var ParentBasedSampler;
|
|
1960
|
+
var init_ParentBasedSampler = __esm({
|
|
1961
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/ParentBasedSampler.js"() {
|
|
1962
|
+
init_esm();
|
|
1963
|
+
init_esm3();
|
|
1964
|
+
init_AlwaysOffSampler();
|
|
1965
|
+
init_AlwaysOnSampler();
|
|
1966
|
+
ParentBasedSampler = class {
|
|
1967
|
+
_root;
|
|
1968
|
+
_remoteParentSampled;
|
|
1969
|
+
_remoteParentNotSampled;
|
|
1970
|
+
_localParentSampled;
|
|
1971
|
+
_localParentNotSampled;
|
|
1972
|
+
constructor(config) {
|
|
1973
|
+
this._root = config.root;
|
|
1974
|
+
if (!this._root) {
|
|
1975
|
+
globalErrorHandler(new Error("ParentBasedSampler must have a root sampler configured"));
|
|
1976
|
+
this._root = new AlwaysOnSampler();
|
|
1977
|
+
}
|
|
1978
|
+
this._remoteParentSampled = config.remoteParentSampled ?? new AlwaysOnSampler();
|
|
1979
|
+
this._remoteParentNotSampled = config.remoteParentNotSampled ?? new AlwaysOffSampler();
|
|
1980
|
+
this._localParentSampled = config.localParentSampled ?? new AlwaysOnSampler();
|
|
1981
|
+
this._localParentNotSampled = config.localParentNotSampled ?? new AlwaysOffSampler();
|
|
1982
|
+
}
|
|
1983
|
+
shouldSample(context2, traceId, spanName, spanKind, attributes, links) {
|
|
1984
|
+
const parentContext = trace.getSpanContext(context2);
|
|
1985
|
+
if (!parentContext || !isSpanContextValid(parentContext)) {
|
|
1986
|
+
return this._root.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
1987
|
+
}
|
|
1988
|
+
if (parentContext.isRemote) {
|
|
1989
|
+
if (parentContext.traceFlags & TraceFlags.SAMPLED) {
|
|
1990
|
+
return this._remoteParentSampled.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
1991
|
+
}
|
|
1992
|
+
return this._remoteParentNotSampled.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
1993
|
+
}
|
|
1994
|
+
if (parentContext.traceFlags & TraceFlags.SAMPLED) {
|
|
1995
|
+
return this._localParentSampled.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
1996
|
+
}
|
|
1997
|
+
return this._localParentNotSampled.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
1998
|
+
}
|
|
1999
|
+
toString() {
|
|
2000
|
+
return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`;
|
|
2001
|
+
}
|
|
2002
|
+
};
|
|
2003
|
+
}
|
|
2004
|
+
});
|
|
2005
|
+
|
|
2006
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/TraceIdRatioBasedSampler.js
|
|
2007
|
+
var TraceIdRatioBasedSampler;
|
|
2008
|
+
var init_TraceIdRatioBasedSampler = __esm({
|
|
2009
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/TraceIdRatioBasedSampler.js"() {
|
|
2010
|
+
init_esm();
|
|
2011
|
+
init_Sampler();
|
|
2012
|
+
TraceIdRatioBasedSampler = class {
|
|
2013
|
+
_ratio;
|
|
2014
|
+
_upperBound;
|
|
2015
|
+
constructor(_ratio = 0) {
|
|
2016
|
+
this._ratio = _ratio;
|
|
2017
|
+
this._ratio = this._normalize(_ratio);
|
|
2018
|
+
this._upperBound = Math.floor(this._ratio * 4294967295);
|
|
2019
|
+
}
|
|
2020
|
+
shouldSample(context2, traceId) {
|
|
2021
|
+
return {
|
|
2022
|
+
decision: isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound ? SamplingDecision2.RECORD_AND_SAMPLED : SamplingDecision2.NOT_RECORD
|
|
2023
|
+
};
|
|
2024
|
+
}
|
|
2025
|
+
toString() {
|
|
2026
|
+
return `TraceIdRatioBased{${this._ratio}}`;
|
|
2027
|
+
}
|
|
2028
|
+
_normalize(ratio) {
|
|
2029
|
+
if (typeof ratio !== "number" || isNaN(ratio))
|
|
2030
|
+
return 0;
|
|
2031
|
+
return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;
|
|
2032
|
+
}
|
|
2033
|
+
_accumulate(traceId) {
|
|
2034
|
+
let accumulation = 0;
|
|
2035
|
+
for (let i = 0; i < traceId.length / 8; i++) {
|
|
2036
|
+
const pos = i * 8;
|
|
2037
|
+
const part = parseInt(traceId.slice(pos, pos + 8), 16);
|
|
2038
|
+
accumulation = (accumulation ^ part) >>> 0;
|
|
2039
|
+
}
|
|
2040
|
+
return accumulation;
|
|
2041
|
+
}
|
|
2042
|
+
};
|
|
2043
|
+
}
|
|
2044
|
+
});
|
|
2045
|
+
|
|
2046
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/config.js
|
|
2047
|
+
function loadDefaultConfig() {
|
|
2048
|
+
return {
|
|
2049
|
+
sampler: buildSamplerFromEnv(),
|
|
2050
|
+
forceFlushTimeoutMillis: 3e4,
|
|
2051
|
+
generalLimits: {
|
|
2052
|
+
attributeValueLengthLimit: getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity,
|
|
2053
|
+
attributeCountLimit: getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? 128
|
|
2054
|
+
},
|
|
2055
|
+
spanLimits: {
|
|
2056
|
+
attributeValueLengthLimit: getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? Infinity,
|
|
2057
|
+
attributeCountLimit: getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? 128,
|
|
2058
|
+
linkCountLimit: getNumberFromEnv("OTEL_SPAN_LINK_COUNT_LIMIT") ?? 128,
|
|
2059
|
+
eventCountLimit: getNumberFromEnv("OTEL_SPAN_EVENT_COUNT_LIMIT") ?? 128,
|
|
2060
|
+
attributePerEventCountLimit: getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT") ?? 128,
|
|
2061
|
+
attributePerLinkCountLimit: getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT") ?? 128
|
|
2062
|
+
}
|
|
2063
|
+
};
|
|
2064
|
+
}
|
|
2065
|
+
function buildSamplerFromEnv() {
|
|
2066
|
+
const sampler = getStringFromEnv("OTEL_TRACES_SAMPLER") ?? "parentbased_always_on";
|
|
2067
|
+
switch (sampler) {
|
|
2068
|
+
case "always_on":
|
|
2069
|
+
return new AlwaysOnSampler();
|
|
2070
|
+
case "always_off":
|
|
2071
|
+
return new AlwaysOffSampler();
|
|
2072
|
+
case "parentbased_always_on":
|
|
2073
|
+
return new ParentBasedSampler({
|
|
2074
|
+
root: new AlwaysOnSampler()
|
|
2075
|
+
});
|
|
2076
|
+
case "parentbased_always_off":
|
|
2077
|
+
return new ParentBasedSampler({
|
|
2078
|
+
root: new AlwaysOffSampler()
|
|
2079
|
+
});
|
|
2080
|
+
case "traceidratio":
|
|
2081
|
+
return new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv());
|
|
2082
|
+
case "parentbased_traceidratio":
|
|
2083
|
+
return new ParentBasedSampler({
|
|
2084
|
+
root: new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv())
|
|
2085
|
+
});
|
|
2086
|
+
default:
|
|
2087
|
+
diag.error(`OTEL_TRACES_SAMPLER value "${sampler}" invalid, defaulting to "${"parentbased_always_on"}".`);
|
|
2088
|
+
return new ParentBasedSampler({
|
|
2089
|
+
root: new AlwaysOnSampler()
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
function getSamplerProbabilityFromEnv() {
|
|
2094
|
+
const probability = getNumberFromEnv("OTEL_TRACES_SAMPLER_ARG");
|
|
2095
|
+
if (probability == null) {
|
|
2096
|
+
diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`);
|
|
2097
|
+
return DEFAULT_RATIO;
|
|
2098
|
+
}
|
|
2099
|
+
if (probability < 0 || probability > 1) {
|
|
2100
|
+
diag.error(`OTEL_TRACES_SAMPLER_ARG=${probability} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`);
|
|
2101
|
+
return DEFAULT_RATIO;
|
|
2102
|
+
}
|
|
2103
|
+
return probability;
|
|
2104
|
+
}
|
|
2105
|
+
var DEFAULT_RATIO;
|
|
2106
|
+
var init_config = __esm({
|
|
2107
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/config.js"() {
|
|
2108
|
+
init_esm();
|
|
2109
|
+
init_esm3();
|
|
2110
|
+
init_AlwaysOffSampler();
|
|
2111
|
+
init_AlwaysOnSampler();
|
|
2112
|
+
init_ParentBasedSampler();
|
|
2113
|
+
init_TraceIdRatioBasedSampler();
|
|
2114
|
+
DEFAULT_RATIO = 1;
|
|
2115
|
+
}
|
|
2116
|
+
});
|
|
2117
|
+
|
|
2118
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/utility.js
|
|
2119
|
+
function mergeConfig(userConfig) {
|
|
2120
|
+
const perInstanceDefaults = {
|
|
2121
|
+
sampler: buildSamplerFromEnv()
|
|
2122
|
+
};
|
|
2123
|
+
const DEFAULT_CONFIG = loadDefaultConfig();
|
|
2124
|
+
const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig);
|
|
2125
|
+
target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {});
|
|
2126
|
+
target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {});
|
|
2127
|
+
return target;
|
|
2128
|
+
}
|
|
2129
|
+
function reconfigureLimits(userConfig) {
|
|
2130
|
+
const spanLimits = Object.assign({}, userConfig.spanLimits);
|
|
2131
|
+
spanLimits.attributeCountLimit = userConfig.spanLimits?.attributeCountLimit ?? userConfig.generalLimits?.attributeCountLimit ?? getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT") ?? getNumberFromEnv("OTEL_ATTRIBUTE_COUNT_LIMIT") ?? DEFAULT_ATTRIBUTE_COUNT_LIMIT;
|
|
2132
|
+
spanLimits.attributeValueLengthLimit = userConfig.spanLimits?.attributeValueLengthLimit ?? userConfig.generalLimits?.attributeValueLengthLimit ?? getNumberFromEnv("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? getNumberFromEnv("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT") ?? DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT;
|
|
2133
|
+
return Object.assign({}, userConfig, { spanLimits });
|
|
2134
|
+
}
|
|
2135
|
+
var DEFAULT_ATTRIBUTE_COUNT_LIMIT, DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT;
|
|
2136
|
+
var init_utility = __esm({
|
|
2137
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/utility.js"() {
|
|
2138
|
+
init_config();
|
|
2139
|
+
init_esm3();
|
|
2140
|
+
DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128;
|
|
2141
|
+
DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity;
|
|
2142
|
+
}
|
|
2143
|
+
});
|
|
2144
|
+
|
|
2145
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/Tracer.js
|
|
2146
|
+
var Tracer;
|
|
2147
|
+
var init_Tracer = __esm({
|
|
2148
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/Tracer.js"() {
|
|
2149
|
+
init_esm();
|
|
2150
|
+
init_esm3();
|
|
2151
|
+
init_Span();
|
|
2152
|
+
init_utility();
|
|
2153
|
+
init_platform3();
|
|
2154
|
+
Tracer = class {
|
|
2155
|
+
_sampler;
|
|
2156
|
+
_generalLimits;
|
|
2157
|
+
_spanLimits;
|
|
2158
|
+
_idGenerator;
|
|
2159
|
+
instrumentationScope;
|
|
2160
|
+
_resource;
|
|
2161
|
+
_spanProcessor;
|
|
2162
|
+
/**
|
|
2163
|
+
* Constructs a new Tracer instance.
|
|
2164
|
+
*/
|
|
2165
|
+
constructor(instrumentationScope, config, resource, spanProcessor) {
|
|
2166
|
+
const localConfig = mergeConfig(config);
|
|
2167
|
+
this._sampler = localConfig.sampler;
|
|
2168
|
+
this._generalLimits = localConfig.generalLimits;
|
|
2169
|
+
this._spanLimits = localConfig.spanLimits;
|
|
2170
|
+
this._idGenerator = config.idGenerator || new RandomIdGenerator();
|
|
2171
|
+
this._resource = resource;
|
|
2172
|
+
this._spanProcessor = spanProcessor;
|
|
2173
|
+
this.instrumentationScope = instrumentationScope;
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* Starts a new Span or returns the default NoopSpan based on the sampling
|
|
2177
|
+
* decision.
|
|
2178
|
+
*/
|
|
2179
|
+
startSpan(name, options = {}, context2 = context.active()) {
|
|
2180
|
+
if (options.root) {
|
|
2181
|
+
context2 = trace.deleteSpan(context2);
|
|
2182
|
+
}
|
|
2183
|
+
const parentSpan = trace.getSpan(context2);
|
|
2184
|
+
if (isTracingSuppressed(context2)) {
|
|
2185
|
+
diag.debug("Instrumentation suppressed, returning Noop Span");
|
|
2186
|
+
const nonRecordingSpan = trace.wrapSpanContext(INVALID_SPAN_CONTEXT);
|
|
2187
|
+
return nonRecordingSpan;
|
|
2188
|
+
}
|
|
2189
|
+
const parentSpanContext = parentSpan?.spanContext();
|
|
2190
|
+
const spanId = this._idGenerator.generateSpanId();
|
|
2191
|
+
let validParentSpanContext;
|
|
2192
|
+
let traceId;
|
|
2193
|
+
let traceState;
|
|
2194
|
+
if (!parentSpanContext || !trace.isSpanContextValid(parentSpanContext)) {
|
|
2195
|
+
traceId = this._idGenerator.generateTraceId();
|
|
2196
|
+
} else {
|
|
2197
|
+
traceId = parentSpanContext.traceId;
|
|
2198
|
+
traceState = parentSpanContext.traceState;
|
|
2199
|
+
validParentSpanContext = parentSpanContext;
|
|
2200
|
+
}
|
|
2201
|
+
const spanKind = options.kind ?? SpanKind.INTERNAL;
|
|
2202
|
+
const links = (options.links ?? []).map((link) => {
|
|
2203
|
+
return {
|
|
2204
|
+
context: link.context,
|
|
2205
|
+
attributes: sanitizeAttributes(link.attributes)
|
|
2206
|
+
};
|
|
2207
|
+
});
|
|
2208
|
+
const attributes = sanitizeAttributes(options.attributes);
|
|
2209
|
+
const samplingResult = this._sampler.shouldSample(context2, traceId, name, spanKind, attributes, links);
|
|
2210
|
+
traceState = samplingResult.traceState ?? traceState;
|
|
2211
|
+
const traceFlags = samplingResult.decision === SamplingDecision.RECORD_AND_SAMPLED ? TraceFlags.SAMPLED : TraceFlags.NONE;
|
|
2212
|
+
const spanContext = { traceId, spanId, traceFlags, traceState };
|
|
2213
|
+
if (samplingResult.decision === SamplingDecision.NOT_RECORD) {
|
|
2214
|
+
diag.debug("Recording is off, propagating context in a non-recording span");
|
|
2215
|
+
const nonRecordingSpan = trace.wrapSpanContext(spanContext);
|
|
2216
|
+
return nonRecordingSpan;
|
|
2217
|
+
}
|
|
2218
|
+
const initAttributes = sanitizeAttributes(Object.assign(attributes, samplingResult.attributes));
|
|
2219
|
+
const span = new SpanImpl({
|
|
2220
|
+
resource: this._resource,
|
|
2221
|
+
scope: this.instrumentationScope,
|
|
2222
|
+
context: context2,
|
|
2223
|
+
spanContext,
|
|
2224
|
+
name,
|
|
2225
|
+
kind: spanKind,
|
|
2226
|
+
links,
|
|
2227
|
+
parentSpanContext: validParentSpanContext,
|
|
2228
|
+
attributes: initAttributes,
|
|
2229
|
+
startTime: options.startTime,
|
|
2230
|
+
spanProcessor: this._spanProcessor,
|
|
2231
|
+
spanLimits: this._spanLimits
|
|
2232
|
+
});
|
|
2233
|
+
return span;
|
|
2234
|
+
}
|
|
2235
|
+
startActiveSpan(name, arg2, arg3, arg4) {
|
|
2236
|
+
let opts;
|
|
2237
|
+
let ctx;
|
|
2238
|
+
let fn;
|
|
2239
|
+
if (arguments.length < 2) {
|
|
2240
|
+
return;
|
|
2241
|
+
} else if (arguments.length === 2) {
|
|
2242
|
+
fn = arg2;
|
|
2243
|
+
} else if (arguments.length === 3) {
|
|
2244
|
+
opts = arg2;
|
|
2245
|
+
fn = arg3;
|
|
2246
|
+
} else {
|
|
2247
|
+
opts = arg2;
|
|
2248
|
+
ctx = arg3;
|
|
2249
|
+
fn = arg4;
|
|
2250
|
+
}
|
|
2251
|
+
const parentContext = ctx ?? context.active();
|
|
2252
|
+
const span = this.startSpan(name, opts, parentContext);
|
|
2253
|
+
const contextWithSpanSet = trace.setSpan(parentContext, span);
|
|
2254
|
+
return context.with(contextWithSpanSet, fn, void 0, span);
|
|
2255
|
+
}
|
|
2256
|
+
/** Returns the active {@link GeneralLimits}. */
|
|
2257
|
+
getGeneralLimits() {
|
|
2258
|
+
return this._generalLimits;
|
|
2259
|
+
}
|
|
2260
|
+
/** Returns the active {@link SpanLimits}. */
|
|
2261
|
+
getSpanLimits() {
|
|
2262
|
+
return this._spanLimits;
|
|
2263
|
+
}
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
});
|
|
2267
|
+
|
|
2268
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/MultiSpanProcessor.js
|
|
2269
|
+
var MultiSpanProcessor;
|
|
2270
|
+
var init_MultiSpanProcessor = __esm({
|
|
2271
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/MultiSpanProcessor.js"() {
|
|
2272
|
+
init_esm3();
|
|
2273
|
+
MultiSpanProcessor = class {
|
|
2274
|
+
_spanProcessors;
|
|
2275
|
+
constructor(_spanProcessors) {
|
|
2276
|
+
this._spanProcessors = _spanProcessors;
|
|
2277
|
+
}
|
|
2278
|
+
forceFlush() {
|
|
2279
|
+
const promises = [];
|
|
2280
|
+
for (const spanProcessor of this._spanProcessors) {
|
|
2281
|
+
promises.push(spanProcessor.forceFlush());
|
|
2282
|
+
}
|
|
2283
|
+
return new Promise((resolve) => {
|
|
2284
|
+
Promise.all(promises).then(() => {
|
|
2285
|
+
resolve();
|
|
2286
|
+
}).catch((error) => {
|
|
2287
|
+
globalErrorHandler(error || new Error("MultiSpanProcessor: forceFlush failed"));
|
|
2288
|
+
resolve();
|
|
2289
|
+
});
|
|
2290
|
+
});
|
|
2291
|
+
}
|
|
2292
|
+
onStart(span, context2) {
|
|
2293
|
+
for (const spanProcessor of this._spanProcessors) {
|
|
2294
|
+
spanProcessor.onStart(span, context2);
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2297
|
+
onEnd(span) {
|
|
2298
|
+
for (const spanProcessor of this._spanProcessors) {
|
|
2299
|
+
spanProcessor.onEnd(span);
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
shutdown() {
|
|
2303
|
+
const promises = [];
|
|
2304
|
+
for (const spanProcessor of this._spanProcessors) {
|
|
2305
|
+
promises.push(spanProcessor.shutdown());
|
|
2306
|
+
}
|
|
2307
|
+
return new Promise((resolve, reject) => {
|
|
2308
|
+
Promise.all(promises).then(() => {
|
|
2309
|
+
resolve();
|
|
2310
|
+
}, reject);
|
|
2311
|
+
});
|
|
2312
|
+
}
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
});
|
|
2316
|
+
|
|
2317
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/BasicTracerProvider.js
|
|
2318
|
+
var ForceFlushState, BasicTracerProvider;
|
|
2319
|
+
var init_BasicTracerProvider = __esm({
|
|
2320
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/BasicTracerProvider.js"() {
|
|
2321
|
+
init_esm3();
|
|
2322
|
+
init_esm4();
|
|
2323
|
+
init_Tracer();
|
|
2324
|
+
init_config();
|
|
2325
|
+
init_MultiSpanProcessor();
|
|
2326
|
+
init_utility();
|
|
2327
|
+
(function(ForceFlushState2) {
|
|
2328
|
+
ForceFlushState2[ForceFlushState2["resolved"] = 0] = "resolved";
|
|
2329
|
+
ForceFlushState2[ForceFlushState2["timeout"] = 1] = "timeout";
|
|
2330
|
+
ForceFlushState2[ForceFlushState2["error"] = 2] = "error";
|
|
2331
|
+
ForceFlushState2[ForceFlushState2["unresolved"] = 3] = "unresolved";
|
|
2332
|
+
})(ForceFlushState || (ForceFlushState = {}));
|
|
2333
|
+
BasicTracerProvider = class {
|
|
2334
|
+
_config;
|
|
2335
|
+
_tracers = /* @__PURE__ */ new Map();
|
|
2336
|
+
_resource;
|
|
2337
|
+
_activeSpanProcessor;
|
|
2338
|
+
constructor(config = {}) {
|
|
2339
|
+
const mergedConfig = merge({}, loadDefaultConfig(), reconfigureLimits(config));
|
|
2340
|
+
this._resource = mergedConfig.resource ?? defaultResource();
|
|
2341
|
+
this._config = Object.assign({}, mergedConfig, {
|
|
2342
|
+
resource: this._resource
|
|
2343
|
+
});
|
|
2344
|
+
const spanProcessors = [];
|
|
2345
|
+
if (config.spanProcessors?.length) {
|
|
2346
|
+
spanProcessors.push(...config.spanProcessors);
|
|
2347
|
+
}
|
|
2348
|
+
this._activeSpanProcessor = new MultiSpanProcessor(spanProcessors);
|
|
2349
|
+
}
|
|
2350
|
+
getTracer(name, version, options) {
|
|
2351
|
+
const key = `${name}@${version || ""}:${options?.schemaUrl || ""}`;
|
|
2352
|
+
if (!this._tracers.has(key)) {
|
|
2353
|
+
this._tracers.set(key, new Tracer({ name, version, schemaUrl: options?.schemaUrl }, this._config, this._resource, this._activeSpanProcessor));
|
|
2354
|
+
}
|
|
2355
|
+
return this._tracers.get(key);
|
|
2356
|
+
}
|
|
2357
|
+
forceFlush() {
|
|
2358
|
+
const timeout = this._config.forceFlushTimeoutMillis;
|
|
2359
|
+
const promises = this._activeSpanProcessor["_spanProcessors"].map((spanProcessor) => {
|
|
2360
|
+
return new Promise((resolve) => {
|
|
2361
|
+
let state;
|
|
2362
|
+
const timeoutInterval = setTimeout(() => {
|
|
2363
|
+
resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`));
|
|
2364
|
+
state = ForceFlushState.timeout;
|
|
2365
|
+
}, timeout);
|
|
2366
|
+
spanProcessor.forceFlush().then(() => {
|
|
2367
|
+
clearTimeout(timeoutInterval);
|
|
2368
|
+
if (state !== ForceFlushState.timeout) {
|
|
2369
|
+
state = ForceFlushState.resolved;
|
|
2370
|
+
resolve(state);
|
|
2371
|
+
}
|
|
2372
|
+
}).catch((error) => {
|
|
2373
|
+
clearTimeout(timeoutInterval);
|
|
2374
|
+
state = ForceFlushState.error;
|
|
2375
|
+
resolve(error);
|
|
2376
|
+
});
|
|
2377
|
+
});
|
|
2378
|
+
});
|
|
2379
|
+
return new Promise((resolve, reject) => {
|
|
2380
|
+
Promise.all(promises).then((results) => {
|
|
2381
|
+
const errors = results.filter((result) => result !== ForceFlushState.resolved);
|
|
2382
|
+
if (errors.length > 0) {
|
|
2383
|
+
reject(errors);
|
|
2384
|
+
} else {
|
|
2385
|
+
resolve();
|
|
2386
|
+
}
|
|
2387
|
+
}).catch((error) => reject([error]));
|
|
2388
|
+
});
|
|
2389
|
+
}
|
|
2390
|
+
shutdown() {
|
|
2391
|
+
return this._activeSpanProcessor.shutdown();
|
|
2392
|
+
}
|
|
2393
|
+
};
|
|
2394
|
+
}
|
|
2395
|
+
});
|
|
2396
|
+
|
|
2397
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/ConsoleSpanExporter.js
|
|
2398
|
+
var ConsoleSpanExporter;
|
|
2399
|
+
var init_ConsoleSpanExporter = __esm({
|
|
2400
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/ConsoleSpanExporter.js"() {
|
|
2401
|
+
init_esm3();
|
|
2402
|
+
ConsoleSpanExporter = class {
|
|
2403
|
+
/**
|
|
2404
|
+
* Export spans.
|
|
2405
|
+
* @param spans
|
|
2406
|
+
* @param resultCallback
|
|
2407
|
+
*/
|
|
2408
|
+
export(spans, resultCallback) {
|
|
2409
|
+
return this._sendSpans(spans, resultCallback);
|
|
2410
|
+
}
|
|
2411
|
+
/**
|
|
2412
|
+
* Shutdown the exporter.
|
|
2413
|
+
*/
|
|
2414
|
+
shutdown() {
|
|
2415
|
+
this._sendSpans([]);
|
|
2416
|
+
return this.forceFlush();
|
|
2417
|
+
}
|
|
2418
|
+
/**
|
|
2419
|
+
* Exports any pending spans in exporter
|
|
2420
|
+
*/
|
|
2421
|
+
forceFlush() {
|
|
2422
|
+
return Promise.resolve();
|
|
2423
|
+
}
|
|
2424
|
+
/**
|
|
2425
|
+
* converts span info into more readable format
|
|
2426
|
+
* @param span
|
|
2427
|
+
*/
|
|
2428
|
+
_exportInfo(span) {
|
|
2429
|
+
return {
|
|
2430
|
+
resource: {
|
|
2431
|
+
attributes: span.resource.attributes
|
|
2432
|
+
},
|
|
2433
|
+
instrumentationScope: span.instrumentationScope,
|
|
2434
|
+
traceId: span.spanContext().traceId,
|
|
2435
|
+
parentSpanContext: span.parentSpanContext,
|
|
2436
|
+
traceState: span.spanContext().traceState?.serialize(),
|
|
2437
|
+
name: span.name,
|
|
2438
|
+
id: span.spanContext().spanId,
|
|
2439
|
+
kind: span.kind,
|
|
2440
|
+
timestamp: hrTimeToMicroseconds(span.startTime),
|
|
2441
|
+
duration: hrTimeToMicroseconds(span.duration),
|
|
2442
|
+
attributes: span.attributes,
|
|
2443
|
+
status: span.status,
|
|
2444
|
+
events: span.events,
|
|
2445
|
+
links: span.links
|
|
2446
|
+
};
|
|
2447
|
+
}
|
|
2448
|
+
/**
|
|
2449
|
+
* Showing spans in console
|
|
2450
|
+
* @param spans
|
|
2451
|
+
* @param done
|
|
2452
|
+
*/
|
|
2453
|
+
_sendSpans(spans, done) {
|
|
2454
|
+
for (const span of spans) {
|
|
2455
|
+
console.dir(this._exportInfo(span), { depth: 3 });
|
|
2456
|
+
}
|
|
2457
|
+
if (done) {
|
|
2458
|
+
return done({ code: ExportResultCode.SUCCESS });
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
};
|
|
2462
|
+
}
|
|
2463
|
+
});
|
|
2464
|
+
|
|
2465
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/InMemorySpanExporter.js
|
|
2466
|
+
var InMemorySpanExporter;
|
|
2467
|
+
var init_InMemorySpanExporter = __esm({
|
|
2468
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/InMemorySpanExporter.js"() {
|
|
2469
|
+
init_esm3();
|
|
2470
|
+
InMemorySpanExporter = class {
|
|
2471
|
+
_finishedSpans = [];
|
|
2472
|
+
/**
|
|
2473
|
+
* Indicates if the exporter has been "shutdown."
|
|
2474
|
+
* When false, exported spans will not be stored in-memory.
|
|
2475
|
+
*/
|
|
2476
|
+
_stopped = false;
|
|
2477
|
+
export(spans, resultCallback) {
|
|
2478
|
+
if (this._stopped)
|
|
2479
|
+
return resultCallback({
|
|
2480
|
+
code: ExportResultCode.FAILED,
|
|
2481
|
+
error: new Error("Exporter has been stopped")
|
|
2482
|
+
});
|
|
2483
|
+
this._finishedSpans.push(...spans);
|
|
2484
|
+
setTimeout(() => resultCallback({ code: ExportResultCode.SUCCESS }), 0);
|
|
2485
|
+
}
|
|
2486
|
+
shutdown() {
|
|
2487
|
+
this._stopped = true;
|
|
2488
|
+
this._finishedSpans = [];
|
|
2489
|
+
return this.forceFlush();
|
|
2490
|
+
}
|
|
2491
|
+
/**
|
|
2492
|
+
* Exports any pending spans in the exporter
|
|
2493
|
+
*/
|
|
2494
|
+
forceFlush() {
|
|
2495
|
+
return Promise.resolve();
|
|
2496
|
+
}
|
|
2497
|
+
reset() {
|
|
2498
|
+
this._finishedSpans = [];
|
|
2499
|
+
}
|
|
2500
|
+
getFinishedSpans() {
|
|
2501
|
+
return this._finishedSpans;
|
|
2502
|
+
}
|
|
2503
|
+
};
|
|
2504
|
+
}
|
|
2505
|
+
});
|
|
2506
|
+
|
|
2507
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/SimpleSpanProcessor.js
|
|
2508
|
+
var SimpleSpanProcessor;
|
|
2509
|
+
var init_SimpleSpanProcessor = __esm({
|
|
2510
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/SimpleSpanProcessor.js"() {
|
|
2511
|
+
init_esm();
|
|
2512
|
+
init_esm3();
|
|
2513
|
+
SimpleSpanProcessor = class {
|
|
2514
|
+
_exporter;
|
|
2515
|
+
_shutdownOnce;
|
|
2516
|
+
_pendingExports;
|
|
2517
|
+
constructor(_exporter) {
|
|
2518
|
+
this._exporter = _exporter;
|
|
2519
|
+
this._shutdownOnce = new BindOnceFuture(this._shutdown, this);
|
|
2520
|
+
this._pendingExports = /* @__PURE__ */ new Set();
|
|
2521
|
+
}
|
|
2522
|
+
async forceFlush() {
|
|
2523
|
+
await Promise.all(Array.from(this._pendingExports));
|
|
2524
|
+
if (this._exporter.forceFlush) {
|
|
2525
|
+
await this._exporter.forceFlush();
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
onStart(_span, _parentContext) {
|
|
2529
|
+
}
|
|
2530
|
+
onEnd(span) {
|
|
2531
|
+
if (this._shutdownOnce.isCalled) {
|
|
2532
|
+
return;
|
|
2533
|
+
}
|
|
2534
|
+
if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) {
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
const pendingExport = this._doExport(span).catch((err) => globalErrorHandler(err));
|
|
2538
|
+
this._pendingExports.add(pendingExport);
|
|
2539
|
+
pendingExport.finally(() => this._pendingExports.delete(pendingExport));
|
|
2540
|
+
}
|
|
2541
|
+
async _doExport(span) {
|
|
2542
|
+
if (span.resource.asyncAttributesPending) {
|
|
2543
|
+
await span.resource.waitForAsyncAttributes?.();
|
|
2544
|
+
}
|
|
2545
|
+
const result = await internal._export(this._exporter, [span]);
|
|
2546
|
+
if (result.code !== ExportResultCode.SUCCESS) {
|
|
2547
|
+
throw result.error ?? new Error(`SimpleSpanProcessor: span export failed (status ${result})`);
|
|
2548
|
+
}
|
|
2549
|
+
}
|
|
2550
|
+
shutdown() {
|
|
2551
|
+
return this._shutdownOnce.call();
|
|
2552
|
+
}
|
|
2553
|
+
_shutdown() {
|
|
2554
|
+
return this._exporter.shutdown();
|
|
2555
|
+
}
|
|
2556
|
+
};
|
|
2557
|
+
}
|
|
2558
|
+
});
|
|
2559
|
+
|
|
2560
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/NoopSpanProcessor.js
|
|
2561
|
+
var NoopSpanProcessor;
|
|
2562
|
+
var init_NoopSpanProcessor = __esm({
|
|
2563
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/NoopSpanProcessor.js"() {
|
|
2564
|
+
NoopSpanProcessor = class {
|
|
2565
|
+
onStart(_span, _context) {
|
|
2566
|
+
}
|
|
2567
|
+
onEnd(_span) {
|
|
2568
|
+
}
|
|
2569
|
+
shutdown() {
|
|
2570
|
+
return Promise.resolve();
|
|
2571
|
+
}
|
|
2572
|
+
forceFlush() {
|
|
2573
|
+
return Promise.resolve();
|
|
2574
|
+
}
|
|
2575
|
+
};
|
|
2576
|
+
}
|
|
2577
|
+
});
|
|
2578
|
+
|
|
2579
|
+
// ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/index.js
|
|
2580
|
+
var esm_exports3 = {};
|
|
2581
|
+
__export(esm_exports3, {
|
|
2582
|
+
AlwaysOffSampler: () => AlwaysOffSampler,
|
|
2583
|
+
AlwaysOnSampler: () => AlwaysOnSampler,
|
|
2584
|
+
BasicTracerProvider: () => BasicTracerProvider,
|
|
2585
|
+
BatchSpanProcessor: () => BatchSpanProcessor,
|
|
2586
|
+
ConsoleSpanExporter: () => ConsoleSpanExporter,
|
|
2587
|
+
InMemorySpanExporter: () => InMemorySpanExporter,
|
|
2588
|
+
NoopSpanProcessor: () => NoopSpanProcessor,
|
|
2589
|
+
ParentBasedSampler: () => ParentBasedSampler,
|
|
2590
|
+
RandomIdGenerator: () => RandomIdGenerator,
|
|
2591
|
+
SamplingDecision: () => SamplingDecision2,
|
|
2592
|
+
SimpleSpanProcessor: () => SimpleSpanProcessor,
|
|
2593
|
+
TraceIdRatioBasedSampler: () => TraceIdRatioBasedSampler
|
|
2594
|
+
});
|
|
2595
|
+
var init_esm5 = __esm({
|
|
2596
|
+
"../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.0.1_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-base/build/esm/index.js"() {
|
|
2597
|
+
init_BasicTracerProvider();
|
|
2598
|
+
init_platform3();
|
|
2599
|
+
init_ConsoleSpanExporter();
|
|
2600
|
+
init_InMemorySpanExporter();
|
|
2601
|
+
init_SimpleSpanProcessor();
|
|
2602
|
+
init_NoopSpanProcessor();
|
|
2603
|
+
init_AlwaysOffSampler();
|
|
2604
|
+
init_AlwaysOnSampler();
|
|
2605
|
+
init_ParentBasedSampler();
|
|
2606
|
+
init_TraceIdRatioBasedSampler();
|
|
2607
|
+
init_Sampler();
|
|
2608
|
+
}
|
|
2609
|
+
});
|
|
2610
|
+
|
|
2611
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js
|
|
2612
|
+
var OTLPExporterError;
|
|
2613
|
+
var init_types = __esm({
|
|
2614
|
+
"../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js"() {
|
|
2615
|
+
OTLPExporterError = class extends Error {
|
|
2616
|
+
code;
|
|
2617
|
+
name = "OTLPExporterError";
|
|
2618
|
+
data;
|
|
2619
|
+
constructor(message, code, data) {
|
|
2620
|
+
super(message);
|
|
2621
|
+
this.data = data;
|
|
2622
|
+
this.code = code;
|
|
2623
|
+
}
|
|
2624
|
+
};
|
|
2625
|
+
}
|
|
2626
|
+
});
|
|
2627
|
+
|
|
2628
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js
|
|
2629
|
+
function isExportRetryable(statusCode) {
|
|
2630
|
+
const retryCodes = [429, 502, 503, 504];
|
|
2631
|
+
return retryCodes.includes(statusCode);
|
|
2632
|
+
}
|
|
2633
|
+
function parseRetryAfterToMills(retryAfter) {
|
|
2634
|
+
if (retryAfter == null) {
|
|
2635
|
+
return void 0;
|
|
2636
|
+
}
|
|
2637
|
+
const seconds = Number.parseInt(retryAfter, 10);
|
|
2638
|
+
if (Number.isInteger(seconds)) {
|
|
2639
|
+
return seconds > 0 ? seconds * 1e3 : -1;
|
|
2640
|
+
}
|
|
2641
|
+
const delay = new Date(retryAfter).getTime() - Date.now();
|
|
2642
|
+
if (delay >= 0) {
|
|
2643
|
+
return delay;
|
|
2644
|
+
}
|
|
2645
|
+
return 0;
|
|
2646
|
+
}
|
|
2647
|
+
var init_is_export_retryable = __esm({
|
|
2648
|
+
"../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js"() {
|
|
2649
|
+
}
|
|
2650
|
+
});
|
|
2651
|
+
|
|
2652
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js
|
|
2653
|
+
var http_transport_utils_exports = {};
|
|
2654
|
+
__export(http_transport_utils_exports, {
|
|
2655
|
+
compressAndSend: () => compressAndSend,
|
|
2656
|
+
createHttpAgent: () => createHttpAgent,
|
|
2657
|
+
sendWithHttp: () => sendWithHttp
|
|
2658
|
+
});
|
|
2659
|
+
import * as http from "http";
|
|
2660
|
+
import * as https from "https";
|
|
2661
|
+
import * as zlib from "zlib";
|
|
2662
|
+
import { Readable } from "stream";
|
|
2663
|
+
function sendWithHttp(params, agent, data, onDone, timeoutMillis) {
|
|
2664
|
+
const parsedUrl = new URL(params.url);
|
|
2665
|
+
const nodeVersion = Number(process.versions.node.split(".")[0]);
|
|
2666
|
+
const options = {
|
|
2667
|
+
hostname: parsedUrl.hostname,
|
|
2668
|
+
port: parsedUrl.port,
|
|
2669
|
+
path: parsedUrl.pathname,
|
|
2670
|
+
method: "POST",
|
|
2671
|
+
headers: {
|
|
2672
|
+
...params.headers()
|
|
2673
|
+
},
|
|
2674
|
+
agent
|
|
2675
|
+
};
|
|
2676
|
+
const request3 = parsedUrl.protocol === "http:" ? http.request : https.request;
|
|
2677
|
+
const req = request3(options, (res) => {
|
|
2678
|
+
const responseData = [];
|
|
2679
|
+
res.on("data", (chunk) => responseData.push(chunk));
|
|
2680
|
+
res.on("end", () => {
|
|
2681
|
+
if (res.statusCode && res.statusCode < 299) {
|
|
2682
|
+
onDone({
|
|
2683
|
+
status: "success",
|
|
2684
|
+
data: Buffer.concat(responseData)
|
|
2685
|
+
});
|
|
2686
|
+
} else if (res.statusCode && isExportRetryable(res.statusCode)) {
|
|
2687
|
+
onDone({
|
|
2688
|
+
status: "retryable",
|
|
2689
|
+
retryInMillis: parseRetryAfterToMills(res.headers["retry-after"])
|
|
2690
|
+
});
|
|
2691
|
+
} else {
|
|
2692
|
+
const error = new OTLPExporterError(res.statusMessage, res.statusCode, Buffer.concat(responseData).toString());
|
|
2693
|
+
onDone({
|
|
2694
|
+
status: "failure",
|
|
2695
|
+
error
|
|
2696
|
+
});
|
|
2697
|
+
}
|
|
2698
|
+
});
|
|
2699
|
+
});
|
|
2700
|
+
req.setTimeout(timeoutMillis, () => {
|
|
2701
|
+
req.destroy();
|
|
2702
|
+
onDone({
|
|
2703
|
+
status: "failure",
|
|
2704
|
+
error: new Error("Request Timeout")
|
|
2705
|
+
});
|
|
2706
|
+
});
|
|
2707
|
+
req.on("error", (error) => {
|
|
2708
|
+
onDone({
|
|
2709
|
+
status: "failure",
|
|
2710
|
+
error
|
|
2711
|
+
});
|
|
2712
|
+
});
|
|
2713
|
+
const reportTimeoutErrorEvent = nodeVersion >= 14 ? "close" : "abort";
|
|
2714
|
+
req.on(reportTimeoutErrorEvent, () => {
|
|
2715
|
+
onDone({
|
|
2716
|
+
status: "failure",
|
|
2717
|
+
error: new Error("Request timed out")
|
|
2718
|
+
});
|
|
2719
|
+
});
|
|
2720
|
+
compressAndSend(req, params.compression, data, (error) => {
|
|
2721
|
+
onDone({
|
|
2722
|
+
status: "failure",
|
|
2723
|
+
error
|
|
2724
|
+
});
|
|
2725
|
+
});
|
|
2726
|
+
}
|
|
2727
|
+
function compressAndSend(req, compression, data, onError) {
|
|
2728
|
+
let dataStream = readableFromUint8Array(data);
|
|
2729
|
+
if (compression === "gzip") {
|
|
2730
|
+
req.setHeader("Content-Encoding", "gzip");
|
|
2731
|
+
dataStream = dataStream.on("error", onError).pipe(zlib.createGzip()).on("error", onError);
|
|
2732
|
+
}
|
|
2733
|
+
dataStream.pipe(req).on("error", onError);
|
|
2734
|
+
}
|
|
2735
|
+
function readableFromUint8Array(buff) {
|
|
2736
|
+
const readable = new Readable();
|
|
2737
|
+
readable.push(buff);
|
|
2738
|
+
readable.push(null);
|
|
2739
|
+
return readable;
|
|
2740
|
+
}
|
|
2741
|
+
function createHttpAgent(rawUrl, agentOptions) {
|
|
2742
|
+
const parsedUrl = new URL(rawUrl);
|
|
2743
|
+
const Agent3 = parsedUrl.protocol === "http:" ? http.Agent : https.Agent;
|
|
2744
|
+
return new Agent3(agentOptions);
|
|
2745
|
+
}
|
|
2746
|
+
var init_http_transport_utils = __esm({
|
|
2747
|
+
"../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js"() {
|
|
2748
|
+
init_is_export_retryable();
|
|
2749
|
+
init_types();
|
|
2750
|
+
}
|
|
2751
|
+
});
|
|
2752
|
+
|
|
2753
|
+
// ../../node_modules/.pnpm/ulid@2.3.0/node_modules/ulid/dist/index.esm.js
|
|
2754
|
+
function createError(message) {
|
|
2755
|
+
var err = new Error(message);
|
|
2756
|
+
err.source = "ulid";
|
|
2757
|
+
return err;
|
|
2758
|
+
}
|
|
2759
|
+
var ENCODING = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
2760
|
+
var ENCODING_LEN = ENCODING.length;
|
|
2761
|
+
var TIME_MAX = Math.pow(2, 48) - 1;
|
|
2762
|
+
var TIME_LEN = 10;
|
|
2763
|
+
var RANDOM_LEN = 16;
|
|
2764
|
+
function randomChar(prng) {
|
|
2765
|
+
var rand = Math.floor(prng() * ENCODING_LEN);
|
|
2766
|
+
if (rand === ENCODING_LEN) {
|
|
2767
|
+
rand = ENCODING_LEN - 1;
|
|
2768
|
+
}
|
|
2769
|
+
return ENCODING.charAt(rand);
|
|
2770
|
+
}
|
|
2771
|
+
function encodeTime(now, len) {
|
|
2772
|
+
if (isNaN(now)) {
|
|
2773
|
+
throw new Error(now + " must be a number");
|
|
2774
|
+
}
|
|
2775
|
+
if (now > TIME_MAX) {
|
|
2776
|
+
throw createError("cannot encode time greater than " + TIME_MAX);
|
|
2777
|
+
}
|
|
2778
|
+
if (now < 0) {
|
|
2779
|
+
throw createError("time must be positive");
|
|
2780
|
+
}
|
|
2781
|
+
if (Number.isInteger(now) === false) {
|
|
2782
|
+
throw createError("time must be an integer");
|
|
2783
|
+
}
|
|
2784
|
+
var mod = void 0;
|
|
2785
|
+
var str = "";
|
|
2786
|
+
for (; len > 0; len--) {
|
|
2787
|
+
mod = now % ENCODING_LEN;
|
|
2788
|
+
str = ENCODING.charAt(mod) + str;
|
|
2789
|
+
now = (now - mod) / ENCODING_LEN;
|
|
2790
|
+
}
|
|
2791
|
+
return str;
|
|
2792
|
+
}
|
|
2793
|
+
function encodeRandom(len, prng) {
|
|
2794
|
+
var str = "";
|
|
2795
|
+
for (; len > 0; len--) {
|
|
2796
|
+
str = randomChar(prng) + str;
|
|
2797
|
+
}
|
|
2798
|
+
return str;
|
|
2799
|
+
}
|
|
2800
|
+
function detectPrng() {
|
|
2801
|
+
var allowInsecure = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2802
|
+
var root = arguments[1];
|
|
2803
|
+
if (!root) {
|
|
2804
|
+
root = typeof window !== "undefined" ? window : null;
|
|
2805
|
+
}
|
|
2806
|
+
var browserCrypto = root && (root.crypto || root.msCrypto);
|
|
2807
|
+
if (browserCrypto) {
|
|
2808
|
+
return function() {
|
|
2809
|
+
var buffer = new Uint8Array(1);
|
|
2810
|
+
browserCrypto.getRandomValues(buffer);
|
|
2811
|
+
return buffer[0] / 255;
|
|
2812
|
+
};
|
|
2813
|
+
} else {
|
|
2814
|
+
try {
|
|
2815
|
+
var nodeCrypto = __require("crypto");
|
|
2816
|
+
return function() {
|
|
2817
|
+
return nodeCrypto.randomBytes(1).readUInt8() / 255;
|
|
2818
|
+
};
|
|
2819
|
+
} catch (e2) {
|
|
2820
|
+
}
|
|
2821
|
+
}
|
|
2822
|
+
if (allowInsecure) {
|
|
2823
|
+
try {
|
|
2824
|
+
console.error("secure crypto unusable, falling back to insecure Math.random()!");
|
|
2825
|
+
} catch (e2) {
|
|
2826
|
+
}
|
|
2827
|
+
return function() {
|
|
2828
|
+
return Math.random();
|
|
2829
|
+
};
|
|
2830
|
+
}
|
|
2831
|
+
throw createError("secure crypto unusable, insecure Math.random not allowed");
|
|
2832
|
+
}
|
|
2833
|
+
function factory(currPrng) {
|
|
2834
|
+
if (!currPrng) {
|
|
2835
|
+
currPrng = detectPrng();
|
|
2836
|
+
}
|
|
2837
|
+
return function ulid2(seedTime) {
|
|
2838
|
+
if (isNaN(seedTime)) {
|
|
2839
|
+
seedTime = Date.now();
|
|
2840
|
+
}
|
|
2841
|
+
return encodeTime(seedTime, TIME_LEN) + encodeRandom(RANDOM_LEN, currPrng);
|
|
2842
|
+
};
|
|
2843
|
+
}
|
|
2844
|
+
var ulid = factory();
|
|
2845
|
+
|
|
2846
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js
|
|
2847
|
+
var OTLPExporterBase = class {
|
|
2848
|
+
_delegate;
|
|
2849
|
+
constructor(_delegate) {
|
|
2850
|
+
this._delegate = _delegate;
|
|
2851
|
+
}
|
|
2852
|
+
/**
|
|
2853
|
+
* Export items.
|
|
2854
|
+
* @param items
|
|
2855
|
+
* @param resultCallback
|
|
2856
|
+
*/
|
|
2857
|
+
export(items, resultCallback) {
|
|
2858
|
+
this._delegate.export(items, resultCallback);
|
|
2859
|
+
}
|
|
2860
|
+
forceFlush() {
|
|
2861
|
+
return this._delegate.forceFlush();
|
|
2862
|
+
}
|
|
2863
|
+
shutdown() {
|
|
2864
|
+
return this._delegate.shutdown();
|
|
2865
|
+
}
|
|
2866
|
+
};
|
|
2867
|
+
|
|
2868
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js
|
|
2869
|
+
function validateTimeoutMillis(timeoutMillis) {
|
|
2870
|
+
if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {
|
|
2871
|
+
return timeoutMillis;
|
|
2872
|
+
}
|
|
2873
|
+
throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`);
|
|
2874
|
+
}
|
|
2875
|
+
function wrapStaticHeadersInFunction(headers) {
|
|
2876
|
+
if (headers == null) {
|
|
2877
|
+
return void 0;
|
|
2878
|
+
}
|
|
2879
|
+
return () => headers;
|
|
2880
|
+
}
|
|
2881
|
+
function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
2882
|
+
return {
|
|
2883
|
+
timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ?? fallbackConfiguration.timeoutMillis ?? defaultConfiguration.timeoutMillis),
|
|
2884
|
+
concurrencyLimit: userProvidedConfiguration.concurrencyLimit ?? fallbackConfiguration.concurrencyLimit ?? defaultConfiguration.concurrencyLimit,
|
|
2885
|
+
compression: userProvidedConfiguration.compression ?? fallbackConfiguration.compression ?? defaultConfiguration.compression
|
|
2886
|
+
};
|
|
2887
|
+
}
|
|
2888
|
+
function getSharedConfigurationDefaults() {
|
|
2889
|
+
return {
|
|
2890
|
+
timeoutMillis: 1e4,
|
|
2891
|
+
concurrencyLimit: 30,
|
|
2892
|
+
compression: "none"
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2895
|
+
|
|
2896
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js
|
|
2897
|
+
var BoundedQueueExportPromiseHandler = class {
|
|
2898
|
+
_concurrencyLimit;
|
|
2899
|
+
_sendingPromises = [];
|
|
2900
|
+
/**
|
|
2901
|
+
* @param concurrencyLimit maximum promises allowed in a queue at the same time.
|
|
2902
|
+
*/
|
|
2903
|
+
constructor(concurrencyLimit) {
|
|
2904
|
+
this._concurrencyLimit = concurrencyLimit;
|
|
2905
|
+
}
|
|
2906
|
+
pushPromise(promise) {
|
|
2907
|
+
if (this.hasReachedLimit()) {
|
|
2908
|
+
throw new Error("Concurrency Limit reached");
|
|
2909
|
+
}
|
|
2910
|
+
this._sendingPromises.push(promise);
|
|
2911
|
+
const popPromise = () => {
|
|
2912
|
+
const index = this._sendingPromises.indexOf(promise);
|
|
2913
|
+
this._sendingPromises.splice(index, 1);
|
|
2914
|
+
};
|
|
2915
|
+
promise.then(popPromise, popPromise);
|
|
2916
|
+
}
|
|
2917
|
+
hasReachedLimit() {
|
|
2918
|
+
return this._sendingPromises.length >= this._concurrencyLimit;
|
|
2919
|
+
}
|
|
2920
|
+
async awaitAll() {
|
|
2921
|
+
await Promise.all(this._sendingPromises);
|
|
2922
|
+
}
|
|
2923
|
+
};
|
|
2924
|
+
function createBoundedQueueExportPromiseHandler(options) {
|
|
2925
|
+
return new BoundedQueueExportPromiseHandler(options.concurrencyLimit);
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js
|
|
2929
|
+
init_esm3();
|
|
2930
|
+
init_types();
|
|
2931
|
+
|
|
2932
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js
|
|
2933
|
+
init_esm();
|
|
2934
|
+
function isPartialSuccessResponse(response) {
|
|
2935
|
+
return Object.prototype.hasOwnProperty.call(response, "partialSuccess");
|
|
2936
|
+
}
|
|
2937
|
+
function createLoggingPartialSuccessResponseHandler() {
|
|
2938
|
+
return {
|
|
2939
|
+
handleResponse(response) {
|
|
2940
|
+
if (response == null || !isPartialSuccessResponse(response) || response.partialSuccess == null || Object.keys(response.partialSuccess).length === 0) {
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
diag.warn("Received Partial Success response:", JSON.stringify(response.partialSuccess));
|
|
2944
|
+
}
|
|
2945
|
+
};
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js
|
|
2949
|
+
init_esm();
|
|
2950
|
+
var OTLPExportDelegate = class {
|
|
2951
|
+
_transport;
|
|
2952
|
+
_serializer;
|
|
2953
|
+
_responseHandler;
|
|
2954
|
+
_promiseQueue;
|
|
2955
|
+
_timeout;
|
|
2956
|
+
_diagLogger;
|
|
2957
|
+
constructor(_transport, _serializer, _responseHandler, _promiseQueue, _timeout) {
|
|
2958
|
+
this._transport = _transport;
|
|
2959
|
+
this._serializer = _serializer;
|
|
2960
|
+
this._responseHandler = _responseHandler;
|
|
2961
|
+
this._promiseQueue = _promiseQueue;
|
|
2962
|
+
this._timeout = _timeout;
|
|
2963
|
+
this._diagLogger = diag.createComponentLogger({
|
|
2964
|
+
namespace: "OTLPExportDelegate"
|
|
2965
|
+
});
|
|
2966
|
+
}
|
|
2967
|
+
export(internalRepresentation, resultCallback) {
|
|
2968
|
+
this._diagLogger.debug("items to be sent", internalRepresentation);
|
|
2969
|
+
if (this._promiseQueue.hasReachedLimit()) {
|
|
2970
|
+
resultCallback({
|
|
2971
|
+
code: ExportResultCode.FAILED,
|
|
2972
|
+
error: new Error("Concurrent export limit reached")
|
|
2973
|
+
});
|
|
2974
|
+
return;
|
|
2975
|
+
}
|
|
2976
|
+
const serializedRequest = this._serializer.serializeRequest(internalRepresentation);
|
|
2977
|
+
if (serializedRequest == null) {
|
|
2978
|
+
resultCallback({
|
|
2979
|
+
code: ExportResultCode.FAILED,
|
|
2980
|
+
error: new Error("Nothing to send")
|
|
2981
|
+
});
|
|
2982
|
+
return;
|
|
2983
|
+
}
|
|
2984
|
+
this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then((response) => {
|
|
2985
|
+
if (response.status === "success") {
|
|
2986
|
+
if (response.data != null) {
|
|
2987
|
+
try {
|
|
2988
|
+
this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data));
|
|
2989
|
+
} catch (e2) {
|
|
2990
|
+
this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", e2, response.data);
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
resultCallback({
|
|
2994
|
+
code: ExportResultCode.SUCCESS
|
|
2995
|
+
});
|
|
2996
|
+
return;
|
|
2997
|
+
} else if (response.status === "failure" && response.error) {
|
|
2998
|
+
resultCallback({
|
|
2999
|
+
code: ExportResultCode.FAILED,
|
|
3000
|
+
error: response.error
|
|
3001
|
+
});
|
|
3002
|
+
return;
|
|
3003
|
+
} else if (response.status === "retryable") {
|
|
3004
|
+
resultCallback({
|
|
3005
|
+
code: ExportResultCode.FAILED,
|
|
3006
|
+
error: new OTLPExporterError("Export failed with retryable status")
|
|
3007
|
+
});
|
|
3008
|
+
} else {
|
|
3009
|
+
resultCallback({
|
|
3010
|
+
code: ExportResultCode.FAILED,
|
|
3011
|
+
error: new OTLPExporterError("Export failed with unknown error")
|
|
3012
|
+
});
|
|
3013
|
+
}
|
|
3014
|
+
}, (reason) => resultCallback({
|
|
3015
|
+
code: ExportResultCode.FAILED,
|
|
3016
|
+
error: reason
|
|
3017
|
+
})));
|
|
3018
|
+
}
|
|
3019
|
+
forceFlush() {
|
|
3020
|
+
return this._promiseQueue.awaitAll();
|
|
3021
|
+
}
|
|
3022
|
+
async shutdown() {
|
|
3023
|
+
this._diagLogger.debug("shutdown started");
|
|
3024
|
+
await this.forceFlush();
|
|
3025
|
+
this._transport.shutdown();
|
|
3026
|
+
}
|
|
3027
|
+
};
|
|
3028
|
+
function createOtlpExportDelegate(components, settings) {
|
|
3029
|
+
return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout);
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
// ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/exporter-trace-otlp-http/build/esm/version.js
|
|
3033
|
+
var VERSION3 = "0.202.0";
|
|
3034
|
+
|
|
3035
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js
|
|
3036
|
+
init_esm3();
|
|
3037
|
+
|
|
3038
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-transformer/build/esm/common/hex-to-binary.js
|
|
3039
|
+
function intValue(charCode) {
|
|
3040
|
+
if (charCode >= 48 && charCode <= 57) {
|
|
3041
|
+
return charCode - 48;
|
|
3042
|
+
}
|
|
3043
|
+
if (charCode >= 97 && charCode <= 102) {
|
|
3044
|
+
return charCode - 87;
|
|
3045
|
+
}
|
|
3046
|
+
return charCode - 55;
|
|
3047
|
+
}
|
|
3048
|
+
function hexToBinary(hexStr) {
|
|
3049
|
+
const buf = new Uint8Array(hexStr.length / 2);
|
|
3050
|
+
let offset = 0;
|
|
3051
|
+
for (let i = 0; i < hexStr.length; i += 2) {
|
|
3052
|
+
const hi = intValue(hexStr.charCodeAt(i));
|
|
3053
|
+
const lo = intValue(hexStr.charCodeAt(i + 1));
|
|
3054
|
+
buf[offset++] = hi << 4 | lo;
|
|
3055
|
+
}
|
|
3056
|
+
return buf;
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js
|
|
3060
|
+
function hrTimeToNanos(hrTime2) {
|
|
3061
|
+
const NANOSECONDS = BigInt(1e9);
|
|
3062
|
+
return BigInt(hrTime2[0]) * NANOSECONDS + BigInt(hrTime2[1]);
|
|
3063
|
+
}
|
|
3064
|
+
function toLongBits(value) {
|
|
3065
|
+
const low = Number(BigInt.asUintN(32, value));
|
|
3066
|
+
const high = Number(BigInt.asUintN(32, value >> BigInt(32)));
|
|
3067
|
+
return { low, high };
|
|
3068
|
+
}
|
|
3069
|
+
function encodeAsLongBits(hrTime2) {
|
|
3070
|
+
const nanos = hrTimeToNanos(hrTime2);
|
|
3071
|
+
return toLongBits(nanos);
|
|
3072
|
+
}
|
|
3073
|
+
function encodeAsString(hrTime2) {
|
|
3074
|
+
const nanos = hrTimeToNanos(hrTime2);
|
|
3075
|
+
return nanos.toString();
|
|
3076
|
+
}
|
|
3077
|
+
var encodeTimestamp = typeof BigInt !== "undefined" ? encodeAsString : hrTimeToNanoseconds;
|
|
3078
|
+
function identity(value) {
|
|
3079
|
+
return value;
|
|
3080
|
+
}
|
|
3081
|
+
function optionalHexToBinary(str) {
|
|
3082
|
+
if (str === void 0)
|
|
3083
|
+
return void 0;
|
|
3084
|
+
return hexToBinary(str);
|
|
3085
|
+
}
|
|
3086
|
+
var DEFAULT_ENCODER = {
|
|
3087
|
+
encodeHrTime: encodeAsLongBits,
|
|
3088
|
+
encodeSpanContext: hexToBinary,
|
|
3089
|
+
encodeOptionalSpanContext: optionalHexToBinary
|
|
3090
|
+
};
|
|
3091
|
+
function getOtlpEncoder(options) {
|
|
3092
|
+
if (options === void 0) {
|
|
3093
|
+
return DEFAULT_ENCODER;
|
|
3094
|
+
}
|
|
3095
|
+
const useLongBits = options.useLongBits ?? true;
|
|
3096
|
+
const useHex = options.useHex ?? false;
|
|
3097
|
+
return {
|
|
3098
|
+
encodeHrTime: useLongBits ? encodeAsLongBits : encodeTimestamp,
|
|
3099
|
+
encodeSpanContext: useHex ? identity : hexToBinary,
|
|
3100
|
+
encodeOptionalSpanContext: useHex ? identity : optionalHexToBinary
|
|
3101
|
+
};
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-transformer/build/esm/common/internal.js
|
|
3105
|
+
function createResource(resource) {
|
|
3106
|
+
return {
|
|
3107
|
+
attributes: toAttributes(resource.attributes),
|
|
3108
|
+
droppedAttributesCount: 0
|
|
3109
|
+
};
|
|
3110
|
+
}
|
|
3111
|
+
function createInstrumentationScope(scope) {
|
|
3112
|
+
return {
|
|
3113
|
+
name: scope.name,
|
|
3114
|
+
version: scope.version
|
|
3115
|
+
};
|
|
3116
|
+
}
|
|
3117
|
+
function toAttributes(attributes) {
|
|
3118
|
+
return Object.keys(attributes).map((key) => toKeyValue(key, attributes[key]));
|
|
3119
|
+
}
|
|
3120
|
+
function toKeyValue(key, value) {
|
|
3121
|
+
return {
|
|
3122
|
+
key,
|
|
3123
|
+
value: toAnyValue(value)
|
|
3124
|
+
};
|
|
3125
|
+
}
|
|
3126
|
+
function toAnyValue(value) {
|
|
3127
|
+
const t = typeof value;
|
|
3128
|
+
if (t === "string")
|
|
3129
|
+
return { stringValue: value };
|
|
3130
|
+
if (t === "number") {
|
|
3131
|
+
if (!Number.isInteger(value))
|
|
3132
|
+
return { doubleValue: value };
|
|
3133
|
+
return { intValue: value };
|
|
3134
|
+
}
|
|
3135
|
+
if (t === "boolean")
|
|
3136
|
+
return { boolValue: value };
|
|
3137
|
+
if (value instanceof Uint8Array)
|
|
3138
|
+
return { bytesValue: value };
|
|
3139
|
+
if (Array.isArray(value))
|
|
3140
|
+
return { arrayValue: { values: value.map(toAnyValue) } };
|
|
3141
|
+
if (t === "object" && value != null)
|
|
3142
|
+
return {
|
|
3143
|
+
kvlistValue: {
|
|
3144
|
+
values: Object.entries(value).map(([k, v]) => toKeyValue(k, v))
|
|
3145
|
+
}
|
|
3146
|
+
};
|
|
3147
|
+
return {};
|
|
3148
|
+
}
|
|
3149
|
+
|
|
3150
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js
|
|
3151
|
+
function sdkSpanToOtlpSpan(span, encoder) {
|
|
3152
|
+
const ctx = span.spanContext();
|
|
3153
|
+
const status = span.status;
|
|
3154
|
+
const parentSpanId = span.parentSpanContext?.spanId ? encoder.encodeSpanContext(span.parentSpanContext?.spanId) : void 0;
|
|
3155
|
+
return {
|
|
3156
|
+
traceId: encoder.encodeSpanContext(ctx.traceId),
|
|
3157
|
+
spanId: encoder.encodeSpanContext(ctx.spanId),
|
|
3158
|
+
parentSpanId,
|
|
3159
|
+
traceState: ctx.traceState?.serialize(),
|
|
3160
|
+
name: span.name,
|
|
3161
|
+
// Span kind is offset by 1 because the API does not define a value for unset
|
|
3162
|
+
kind: span.kind == null ? 0 : span.kind + 1,
|
|
3163
|
+
startTimeUnixNano: encoder.encodeHrTime(span.startTime),
|
|
3164
|
+
endTimeUnixNano: encoder.encodeHrTime(span.endTime),
|
|
3165
|
+
attributes: toAttributes(span.attributes),
|
|
3166
|
+
droppedAttributesCount: span.droppedAttributesCount,
|
|
3167
|
+
events: span.events.map((event) => toOtlpSpanEvent(event, encoder)),
|
|
3168
|
+
droppedEventsCount: span.droppedEventsCount,
|
|
3169
|
+
status: {
|
|
3170
|
+
// API and proto enums share the same values
|
|
3171
|
+
code: status.code,
|
|
3172
|
+
message: status.message
|
|
3173
|
+
},
|
|
3174
|
+
links: span.links.map((link) => toOtlpLink(link, encoder)),
|
|
3175
|
+
droppedLinksCount: span.droppedLinksCount
|
|
3176
|
+
};
|
|
3177
|
+
}
|
|
3178
|
+
function toOtlpLink(link, encoder) {
|
|
3179
|
+
return {
|
|
3180
|
+
attributes: link.attributes ? toAttributes(link.attributes) : [],
|
|
3181
|
+
spanId: encoder.encodeSpanContext(link.context.spanId),
|
|
3182
|
+
traceId: encoder.encodeSpanContext(link.context.traceId),
|
|
3183
|
+
traceState: link.context.traceState?.serialize(),
|
|
3184
|
+
droppedAttributesCount: link.droppedAttributesCount || 0
|
|
3185
|
+
};
|
|
3186
|
+
}
|
|
3187
|
+
function toOtlpSpanEvent(timedEvent, encoder) {
|
|
3188
|
+
return {
|
|
3189
|
+
attributes: timedEvent.attributes ? toAttributes(timedEvent.attributes) : [],
|
|
3190
|
+
name: timedEvent.name,
|
|
3191
|
+
timeUnixNano: encoder.encodeHrTime(timedEvent.time),
|
|
3192
|
+
droppedAttributesCount: timedEvent.droppedAttributesCount || 0
|
|
3193
|
+
};
|
|
3194
|
+
}
|
|
3195
|
+
function createExportTraceServiceRequest(spans, options) {
|
|
3196
|
+
const encoder = getOtlpEncoder(options);
|
|
3197
|
+
return {
|
|
3198
|
+
resourceSpans: spanRecordsToResourceSpans(spans, encoder)
|
|
3199
|
+
};
|
|
3200
|
+
}
|
|
3201
|
+
function createResourceMap(readableSpans) {
|
|
3202
|
+
const resourceMap = /* @__PURE__ */ new Map();
|
|
3203
|
+
for (const record of readableSpans) {
|
|
3204
|
+
let ilsMap = resourceMap.get(record.resource);
|
|
3205
|
+
if (!ilsMap) {
|
|
3206
|
+
ilsMap = /* @__PURE__ */ new Map();
|
|
3207
|
+
resourceMap.set(record.resource, ilsMap);
|
|
3208
|
+
}
|
|
3209
|
+
const instrumentationScopeKey = `${record.instrumentationScope.name}@${record.instrumentationScope.version || ""}:${record.instrumentationScope.schemaUrl || ""}`;
|
|
3210
|
+
let records = ilsMap.get(instrumentationScopeKey);
|
|
3211
|
+
if (!records) {
|
|
3212
|
+
records = [];
|
|
3213
|
+
ilsMap.set(instrumentationScopeKey, records);
|
|
3214
|
+
}
|
|
3215
|
+
records.push(record);
|
|
3216
|
+
}
|
|
3217
|
+
return resourceMap;
|
|
3218
|
+
}
|
|
3219
|
+
function spanRecordsToResourceSpans(readableSpans, encoder) {
|
|
3220
|
+
const resourceMap = createResourceMap(readableSpans);
|
|
3221
|
+
const out = [];
|
|
3222
|
+
const entryIterator = resourceMap.entries();
|
|
3223
|
+
let entry = entryIterator.next();
|
|
3224
|
+
while (!entry.done) {
|
|
3225
|
+
const [resource, ilmMap] = entry.value;
|
|
3226
|
+
const scopeResourceSpans = [];
|
|
3227
|
+
const ilmIterator = ilmMap.values();
|
|
3228
|
+
let ilmEntry = ilmIterator.next();
|
|
3229
|
+
while (!ilmEntry.done) {
|
|
3230
|
+
const scopeSpans = ilmEntry.value;
|
|
3231
|
+
if (scopeSpans.length > 0) {
|
|
3232
|
+
const spans = scopeSpans.map((readableSpan) => sdkSpanToOtlpSpan(readableSpan, encoder));
|
|
3233
|
+
scopeResourceSpans.push({
|
|
3234
|
+
scope: createInstrumentationScope(scopeSpans[0].instrumentationScope),
|
|
3235
|
+
spans,
|
|
3236
|
+
schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl
|
|
3237
|
+
});
|
|
3238
|
+
}
|
|
3239
|
+
ilmEntry = ilmIterator.next();
|
|
3240
|
+
}
|
|
3241
|
+
const transformedSpans = {
|
|
3242
|
+
resource: createResource(resource),
|
|
3243
|
+
scopeSpans: scopeResourceSpans,
|
|
3244
|
+
schemaUrl: void 0
|
|
3245
|
+
};
|
|
3246
|
+
out.push(transformedSpans);
|
|
3247
|
+
entry = entryIterator.next();
|
|
3248
|
+
}
|
|
3249
|
+
return out;
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3252
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/json/trace.js
|
|
3253
|
+
var JsonTraceSerializer = {
|
|
3254
|
+
serializeRequest: (arg) => {
|
|
3255
|
+
const request3 = createExportTraceServiceRequest(arg, {
|
|
3256
|
+
useHex: true,
|
|
3257
|
+
useLongBits: false
|
|
3258
|
+
});
|
|
3259
|
+
const encoder = new TextEncoder();
|
|
3260
|
+
return encoder.encode(JSON.stringify(request3));
|
|
3261
|
+
},
|
|
3262
|
+
deserializeResponse: (arg) => {
|
|
3263
|
+
if (arg.length === 0) {
|
|
3264
|
+
return {};
|
|
3265
|
+
}
|
|
3266
|
+
const decoder = new TextDecoder();
|
|
3267
|
+
return JSON.parse(decoder.decode(arg));
|
|
3268
|
+
}
|
|
3269
|
+
};
|
|
3270
|
+
|
|
3271
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-exporter-transport.js
|
|
3272
|
+
var HttpExporterTransport = class {
|
|
3273
|
+
_parameters;
|
|
3274
|
+
_utils = null;
|
|
3275
|
+
constructor(_parameters) {
|
|
3276
|
+
this._parameters = _parameters;
|
|
3277
|
+
}
|
|
3278
|
+
async send(data, timeoutMillis) {
|
|
3279
|
+
const { agent, send } = this._loadUtils();
|
|
3280
|
+
return new Promise((resolve) => {
|
|
3281
|
+
send(this._parameters, agent, data, (result) => {
|
|
3282
|
+
resolve(result);
|
|
3283
|
+
}, timeoutMillis);
|
|
3284
|
+
});
|
|
3285
|
+
}
|
|
3286
|
+
shutdown() {
|
|
3287
|
+
}
|
|
3288
|
+
_loadUtils() {
|
|
3289
|
+
let utils = this._utils;
|
|
3290
|
+
if (utils === null) {
|
|
3291
|
+
const {
|
|
3292
|
+
sendWithHttp: sendWithHttp2,
|
|
3293
|
+
createHttpAgent: createHttpAgent2
|
|
3294
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
3295
|
+
} = (init_http_transport_utils(), __toCommonJS(http_transport_utils_exports));
|
|
3296
|
+
utils = this._utils = {
|
|
3297
|
+
agent: createHttpAgent2(this._parameters.url, this._parameters.agentOptions),
|
|
3298
|
+
send: sendWithHttp2
|
|
3299
|
+
};
|
|
3300
|
+
}
|
|
3301
|
+
return utils;
|
|
3302
|
+
}
|
|
3303
|
+
};
|
|
3304
|
+
function createHttpExporterTransport(parameters) {
|
|
3305
|
+
return new HttpExporterTransport(parameters);
|
|
3306
|
+
}
|
|
3307
|
+
|
|
3308
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/retrying-transport.js
|
|
3309
|
+
var MAX_ATTEMPTS = 5;
|
|
3310
|
+
var INITIAL_BACKOFF = 1e3;
|
|
3311
|
+
var MAX_BACKOFF = 5e3;
|
|
3312
|
+
var BACKOFF_MULTIPLIER = 1.5;
|
|
3313
|
+
var JITTER = 0.2;
|
|
3314
|
+
function getJitter() {
|
|
3315
|
+
return Math.random() * (2 * JITTER) - JITTER;
|
|
3316
|
+
}
|
|
3317
|
+
var RetryingTransport = class {
|
|
3318
|
+
_transport;
|
|
3319
|
+
constructor(_transport) {
|
|
3320
|
+
this._transport = _transport;
|
|
3321
|
+
}
|
|
3322
|
+
retry(data, timeoutMillis, inMillis) {
|
|
3323
|
+
return new Promise((resolve, reject) => {
|
|
3324
|
+
setTimeout(() => {
|
|
3325
|
+
this._transport.send(data, timeoutMillis).then(resolve, reject);
|
|
3326
|
+
}, inMillis);
|
|
3327
|
+
});
|
|
3328
|
+
}
|
|
3329
|
+
async send(data, timeoutMillis) {
|
|
3330
|
+
const deadline = Date.now() + timeoutMillis;
|
|
3331
|
+
let result = await this._transport.send(data, timeoutMillis);
|
|
3332
|
+
let attempts = MAX_ATTEMPTS;
|
|
3333
|
+
let nextBackoff = INITIAL_BACKOFF;
|
|
3334
|
+
while (result.status === "retryable" && attempts > 0) {
|
|
3335
|
+
attempts--;
|
|
3336
|
+
const backoff = Math.max(Math.min(nextBackoff, MAX_BACKOFF) + getJitter(), 0);
|
|
3337
|
+
nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;
|
|
3338
|
+
const retryInMillis = result.retryInMillis ?? backoff;
|
|
3339
|
+
const remainingTimeoutMillis = deadline - Date.now();
|
|
3340
|
+
if (retryInMillis > remainingTimeoutMillis) {
|
|
3341
|
+
return result;
|
|
3342
|
+
}
|
|
3343
|
+
result = await this.retry(data, remainingTimeoutMillis, retryInMillis);
|
|
3344
|
+
}
|
|
3345
|
+
return result;
|
|
3346
|
+
}
|
|
3347
|
+
shutdown() {
|
|
3348
|
+
return this._transport.shutdown();
|
|
3349
|
+
}
|
|
3350
|
+
};
|
|
3351
|
+
function createRetryingTransport(options) {
|
|
3352
|
+
return new RetryingTransport(options.transport);
|
|
3353
|
+
}
|
|
3354
|
+
|
|
3355
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-http-export-delegate.js
|
|
3356
|
+
function createOtlpHttpExportDelegate(options, serializer) {
|
|
3357
|
+
return createOtlpExportDelegate({
|
|
3358
|
+
transport: createRetryingTransport({
|
|
3359
|
+
transport: createHttpExporterTransport(options)
|
|
3360
|
+
}),
|
|
3361
|
+
serializer,
|
|
3362
|
+
promiseHandler: createBoundedQueueExportPromiseHandler(options)
|
|
3363
|
+
}, { timeout: options.timeoutMillis });
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3366
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-env-configuration.js
|
|
3367
|
+
init_esm();
|
|
3368
|
+
function parseAndValidateTimeoutFromEnv(timeoutEnvVar) {
|
|
3369
|
+
const envTimeout = process.env[timeoutEnvVar]?.trim();
|
|
3370
|
+
if (envTimeout != null && envTimeout !== "") {
|
|
3371
|
+
const definedTimeout = Number(envTimeout);
|
|
3372
|
+
if (Number.isFinite(definedTimeout) && definedTimeout > 0) {
|
|
3373
|
+
return definedTimeout;
|
|
3374
|
+
}
|
|
3375
|
+
diag.warn(`Configuration: ${timeoutEnvVar} is invalid, expected number greater than 0 (actual: ${envTimeout})`);
|
|
3376
|
+
}
|
|
3377
|
+
return void 0;
|
|
3378
|
+
}
|
|
3379
|
+
function getTimeoutFromEnv(signalIdentifier) {
|
|
3380
|
+
const specificTimeout = parseAndValidateTimeoutFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_TIMEOUT`);
|
|
3381
|
+
const nonSpecificTimeout = parseAndValidateTimeoutFromEnv("OTEL_EXPORTER_OTLP_TIMEOUT");
|
|
3382
|
+
return specificTimeout ?? nonSpecificTimeout;
|
|
3383
|
+
}
|
|
3384
|
+
function parseAndValidateCompressionFromEnv(compressionEnvVar) {
|
|
3385
|
+
const compression = process.env[compressionEnvVar]?.trim();
|
|
3386
|
+
if (compression === "") {
|
|
3387
|
+
return void 0;
|
|
3388
|
+
}
|
|
3389
|
+
if (compression == null || compression === "none" || compression === "gzip") {
|
|
3390
|
+
return compression;
|
|
3391
|
+
}
|
|
3392
|
+
diag.warn(`Configuration: ${compressionEnvVar} is invalid, expected 'none' or 'gzip' (actual: '${compression}')`);
|
|
3393
|
+
return void 0;
|
|
3394
|
+
}
|
|
3395
|
+
function getCompressionFromEnv(signalIdentifier) {
|
|
3396
|
+
const specificCompression = parseAndValidateCompressionFromEnv(`OTEL_EXPORTER_OTLP_${signalIdentifier}_COMPRESSION`);
|
|
3397
|
+
const nonSpecificCompression = parseAndValidateCompressionFromEnv("OTEL_EXPORTER_OTLP_COMPRESSION");
|
|
3398
|
+
return specificCompression ?? nonSpecificCompression;
|
|
3399
|
+
}
|
|
3400
|
+
function getSharedConfigurationFromEnvironment(signalIdentifier) {
|
|
3401
|
+
return {
|
|
3402
|
+
timeoutMillis: getTimeoutFromEnv(signalIdentifier),
|
|
3403
|
+
compression: getCompressionFromEnv(signalIdentifier)
|
|
3404
|
+
};
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js
|
|
3408
|
+
init_esm();
|
|
3409
|
+
function validateAndNormalizeHeaders(partialHeaders) {
|
|
3410
|
+
return () => {
|
|
3411
|
+
const headers = {};
|
|
3412
|
+
Object.entries(partialHeaders?.() ?? {}).forEach(([key, value]) => {
|
|
3413
|
+
if (typeof value !== "undefined") {
|
|
3414
|
+
headers[key] = String(value);
|
|
3415
|
+
} else {
|
|
3416
|
+
diag.warn(`Header "${key}" has invalid value (${value}) and will be ignored`);
|
|
3417
|
+
}
|
|
3418
|
+
});
|
|
3419
|
+
return headers;
|
|
3420
|
+
};
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js
|
|
3424
|
+
function mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) {
|
|
3425
|
+
const requiredHeaders = {
|
|
3426
|
+
...defaultHeaders()
|
|
3427
|
+
};
|
|
3428
|
+
const headers = {};
|
|
3429
|
+
return () => {
|
|
3430
|
+
if (fallbackHeaders != null) {
|
|
3431
|
+
Object.assign(headers, fallbackHeaders());
|
|
3432
|
+
}
|
|
3433
|
+
if (userProvidedHeaders != null) {
|
|
3434
|
+
Object.assign(headers, userProvidedHeaders());
|
|
3435
|
+
}
|
|
3436
|
+
return Object.assign(headers, requiredHeaders);
|
|
3437
|
+
};
|
|
3438
|
+
}
|
|
3439
|
+
function validateUserProvidedUrl(url) {
|
|
3440
|
+
if (url == null) {
|
|
3441
|
+
return void 0;
|
|
3442
|
+
}
|
|
3443
|
+
try {
|
|
3444
|
+
new URL(url);
|
|
3445
|
+
return url;
|
|
3446
|
+
} catch (e2) {
|
|
3447
|
+
throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`);
|
|
3448
|
+
}
|
|
3449
|
+
}
|
|
3450
|
+
function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {
|
|
3451
|
+
return {
|
|
3452
|
+
...mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),
|
|
3453
|
+
headers: mergeHeaders(validateAndNormalizeHeaders(userProvidedConfiguration.headers), fallbackConfiguration.headers, defaultConfiguration.headers),
|
|
3454
|
+
url: validateUserProvidedUrl(userProvidedConfiguration.url) ?? fallbackConfiguration.url ?? defaultConfiguration.url,
|
|
3455
|
+
agentOptions: userProvidedConfiguration.agentOptions ?? fallbackConfiguration.agentOptions ?? defaultConfiguration.agentOptions
|
|
3456
|
+
};
|
|
3457
|
+
}
|
|
3458
|
+
function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
|
|
3459
|
+
return {
|
|
3460
|
+
...getSharedConfigurationDefaults(),
|
|
3461
|
+
headers: () => requiredHeaders,
|
|
3462
|
+
url: "http://localhost:4318/" + signalResourcePath,
|
|
3463
|
+
agentOptions: { keepAlive: true }
|
|
3464
|
+
};
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-env-configuration.js
|
|
3468
|
+
init_esm3();
|
|
3469
|
+
init_esm();
|
|
3470
|
+
function getStaticHeadersFromEnv(signalIdentifier) {
|
|
3471
|
+
const signalSpecificRawHeaders = process.env[`OTEL_EXPORTER_OTLP_${signalIdentifier}_HEADERS`]?.trim();
|
|
3472
|
+
const nonSignalSpecificRawHeaders = process.env["OTEL_EXPORTER_OTLP_HEADERS"]?.trim();
|
|
3473
|
+
const signalSpecificHeaders = parseKeyPairsIntoRecord(signalSpecificRawHeaders);
|
|
3474
|
+
const nonSignalSpecificHeaders = parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders);
|
|
3475
|
+
if (Object.keys(signalSpecificHeaders).length === 0 && Object.keys(nonSignalSpecificHeaders).length === 0) {
|
|
3476
|
+
return void 0;
|
|
3477
|
+
}
|
|
3478
|
+
return Object.assign({}, parseKeyPairsIntoRecord(nonSignalSpecificRawHeaders), parseKeyPairsIntoRecord(signalSpecificRawHeaders));
|
|
3479
|
+
}
|
|
3480
|
+
function appendRootPathToUrlIfNeeded(url) {
|
|
3481
|
+
try {
|
|
3482
|
+
const parsedUrl = new URL(url);
|
|
3483
|
+
return parsedUrl.toString();
|
|
3484
|
+
} catch {
|
|
3485
|
+
diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`);
|
|
3486
|
+
return void 0;
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3489
|
+
function appendResourcePathToUrl(url, path) {
|
|
3490
|
+
try {
|
|
3491
|
+
new URL(url);
|
|
3492
|
+
} catch {
|
|
3493
|
+
diag.warn(`Configuration: Could not parse environment-provided export URL: '${url}', falling back to undefined`);
|
|
3494
|
+
return void 0;
|
|
3495
|
+
}
|
|
3496
|
+
if (!url.endsWith("/")) {
|
|
3497
|
+
url = url + "/";
|
|
3498
|
+
}
|
|
3499
|
+
url += path;
|
|
3500
|
+
try {
|
|
3501
|
+
new URL(url);
|
|
3502
|
+
} catch {
|
|
3503
|
+
diag.warn(`Configuration: Provided URL appended with '${path}' is not a valid URL, using 'undefined' instead of '${url}'`);
|
|
3504
|
+
return void 0;
|
|
3505
|
+
}
|
|
3506
|
+
return url;
|
|
3507
|
+
}
|
|
3508
|
+
function getNonSpecificUrlFromEnv(signalResourcePath) {
|
|
3509
|
+
const envUrl = process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();
|
|
3510
|
+
if (envUrl == null || envUrl === "") {
|
|
3511
|
+
return void 0;
|
|
3512
|
+
}
|
|
3513
|
+
return appendResourcePathToUrl(envUrl, signalResourcePath);
|
|
3514
|
+
}
|
|
3515
|
+
function getSpecificUrlFromEnv(signalIdentifier) {
|
|
3516
|
+
const envUrl = process.env[`OTEL_EXPORTER_OTLP_${signalIdentifier}_ENDPOINT`]?.trim();
|
|
3517
|
+
if (envUrl == null || envUrl === "") {
|
|
3518
|
+
return void 0;
|
|
3519
|
+
}
|
|
3520
|
+
return appendRootPathToUrlIfNeeded(envUrl);
|
|
3521
|
+
}
|
|
3522
|
+
function getHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath) {
|
|
3523
|
+
return {
|
|
3524
|
+
...getSharedConfigurationFromEnvironment(signalIdentifier),
|
|
3525
|
+
url: getSpecificUrlFromEnv(signalIdentifier) ?? getNonSpecificUrlFromEnv(signalResourcePath),
|
|
3526
|
+
headers: wrapStaticHeadersInFunction(getStaticHeadersFromEnv(signalIdentifier))
|
|
3527
|
+
};
|
|
3528
|
+
}
|
|
3529
|
+
|
|
3530
|
+
// ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-node-http-options.js
|
|
3531
|
+
init_esm();
|
|
3532
|
+
function convertLegacyAgentOptions(config) {
|
|
3533
|
+
if (config?.keepAlive != null) {
|
|
3534
|
+
if (config.httpAgentOptions != null) {
|
|
3535
|
+
if (config.httpAgentOptions.keepAlive == null) {
|
|
3536
|
+
config.httpAgentOptions.keepAlive = config.keepAlive;
|
|
3537
|
+
}
|
|
3538
|
+
} else {
|
|
3539
|
+
config.httpAgentOptions = {
|
|
3540
|
+
keepAlive: config.keepAlive
|
|
3541
|
+
};
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
return config.httpAgentOptions;
|
|
3545
|
+
}
|
|
3546
|
+
function convertLegacyHttpOptions(config, signalIdentifier, signalResourcePath, requiredHeaders) {
|
|
3547
|
+
if (config.metadata) {
|
|
3548
|
+
diag.warn("Metadata cannot be set when using http");
|
|
3549
|
+
}
|
|
3550
|
+
return mergeOtlpHttpConfigurationWithDefaults({
|
|
3551
|
+
url: config.url,
|
|
3552
|
+
headers: wrapStaticHeadersInFunction(config.headers),
|
|
3553
|
+
concurrencyLimit: config.concurrencyLimit,
|
|
3554
|
+
timeoutMillis: config.timeoutMillis,
|
|
3555
|
+
compression: config.compression,
|
|
3556
|
+
agentOptions: convertLegacyAgentOptions(config)
|
|
3557
|
+
}, getHttpConfigurationFromEnvironment(signalIdentifier, signalResourcePath), getHttpConfigurationDefaults(requiredHeaders, signalResourcePath));
|
|
3558
|
+
}
|
|
3559
|
+
|
|
3560
|
+
// ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.202.0_@opentelemetry+api@1.9.0/node_modules/@opentelemetry/exporter-trace-otlp-http/build/esm/platform/node/OTLPTraceExporter.js
|
|
3561
|
+
var OTLPTraceExporter = class extends OTLPExporterBase {
|
|
3562
|
+
constructor(config = {}) {
|
|
3563
|
+
super(createOtlpHttpExportDelegate(convertLegacyHttpOptions(config, "TRACES", "v1/traces", {
|
|
3564
|
+
"User-Agent": `OTel-OTLP-Exporter-JavaScript/${VERSION3}`,
|
|
3565
|
+
"Content-Type": "application/json"
|
|
3566
|
+
}), JsonTraceSerializer));
|
|
3567
|
+
}
|
|
3568
|
+
};
|
|
3569
|
+
|
|
3570
|
+
// ../../packages/portal/products/realm/dist/config/product-gates.js
|
|
3571
|
+
var e = "@redocly/realm";
|
|
3572
|
+
|
|
3573
|
+
export {
|
|
3574
|
+
ulid,
|
|
3575
|
+
W3CBaggagePropagator,
|
|
3576
|
+
getStringListFromEnv,
|
|
3577
|
+
_globalThis,
|
|
3578
|
+
otperformance,
|
|
3579
|
+
SEMATTRS_HTTP_URL,
|
|
3580
|
+
SEMATTRS_HTTP_USER_AGENT,
|
|
3581
|
+
ATTR_ERROR_TYPE,
|
|
3582
|
+
ATTR_HTTP_REQUEST_METHOD,
|
|
3583
|
+
ATTR_HTTP_REQUEST_METHOD_ORIGINAL,
|
|
3584
|
+
ATTR_HTTP_RESPONSE_STATUS_CODE,
|
|
3585
|
+
ATTR_SERVER_ADDRESS,
|
|
3586
|
+
ATTR_SERVER_PORT,
|
|
3587
|
+
ATTR_SERVICE_NAME,
|
|
3588
|
+
ATTR_SERVICE_VERSION,
|
|
3589
|
+
ATTR_URL_FULL,
|
|
3590
|
+
init_esm2 as init_esm,
|
|
3591
|
+
millisToHrTime,
|
|
3592
|
+
hrTime,
|
|
3593
|
+
timeInputToHrTime,
|
|
3594
|
+
hrTimeToNanoseconds,
|
|
3595
|
+
CompositePropagator,
|
|
3596
|
+
TRACE_PARENT_HEADER,
|
|
3597
|
+
W3CTraceContextPropagator,
|
|
3598
|
+
urlMatches,
|
|
3599
|
+
isUrlIgnored,
|
|
3600
|
+
esm_exports,
|
|
3601
|
+
init_esm3 as init_esm2,
|
|
3602
|
+
resourceFromAttributes,
|
|
3603
|
+
init_esm4 as init_esm3,
|
|
3604
|
+
BatchSpanProcessor,
|
|
3605
|
+
BasicTracerProvider,
|
|
3606
|
+
esm_exports3 as esm_exports2,
|
|
3607
|
+
init_esm5 as init_esm4,
|
|
3608
|
+
OTLPTraceExporter,
|
|
3609
|
+
e
|
|
3610
|
+
};
|