@sailfish-ai/sf-veritas 0.2.19 → 0.2.21
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/dist/contextManager-0D8uHQ1_.cjs +1 -0
- package/dist/contextManager-RxrMXs5c.js +292 -0
- package/dist/plugins/funcspanEsbuildPlugin.cjs +1 -1
- package/dist/plugins/funcspanEsbuildPlugin.mjs +1 -1
- package/dist/plugins/funcspanRollupPlugin.cjs +1 -1
- package/dist/plugins/funcspanRollupPlugin.mjs +1 -1
- package/dist/plugins/funcspanTscPlugin.cjs +1 -1
- package/dist/plugins/funcspanTscPlugin.mjs +1 -1
- package/dist/plugins/funcspanVitePlugin.cjs +1 -1
- package/dist/plugins/funcspanVitePlugin.mjs +1 -1
- package/dist/plugins/funcspanWebpackPlugin.cjs +1 -1
- package/dist/plugins/funcspanWebpackPlugin.mjs +1 -1
- package/dist/{runtimeConfig--MlBo3_L.js → runtimeConfig-CB57auSb.js} +57 -57
- package/dist/runtimeConfig-sm_7bnKx.cjs +9 -0
- package/dist/sf-veritas.cjs +25 -13
- package/dist/sf-veritas.mjs +377 -347
- package/dist/types/frameworkDetection.d.ts +18 -0
- package/dist/types/setupConfig.d.ts +3 -0
- package/dist/worker-pool-capture.cjs +1 -1
- package/dist/worker-pool-capture.mjs +1 -1
- package/dist/{workerPoolSpanCapture-B3yge78T.cjs → workerPoolSpanCapture-DFnbcpkU.cjs} +1 -1
- package/dist/{workerPoolSpanCapture-DqBbNQLv.js → workerPoolSpanCapture-DVYmzgbN.js} +1 -1
- package/package.json +1 -1
- package/dist/contextManager-C-sqFxpi.js +0 -267
- package/dist/contextManager-wMuxqwl9.cjs +0 -1
- package/dist/runtimeConfig-paQOMT6f.cjs +0 -9
package/dist/sf-veritas.mjs
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
var he = Object.defineProperty;
|
|
2
2
|
var me = (r, t, e) => t in r ? he(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
3
|
var y = (r, t, e) => me(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
-
import { g
|
|
5
|
-
import { r as
|
|
6
|
-
import { B as T, n as
|
|
7
|
-
import { h as
|
|
8
|
-
import { a as Fe, C as Ne, i as
|
|
9
|
-
import { f as
|
|
4
|
+
import { g, C as V, D as ye, v as W, b as H, c as Se, d as ve, a as de } from "./contextManager-RxrMXs5c.js";
|
|
5
|
+
import { r as It } from "./contextManager-RxrMXs5c.js";
|
|
6
|
+
import { B as T, n as w, f as Ie, g as B, p as j, a as le, b as $e, m as R, c as A, i as Y, d as _e, e as U, t as M, F as be } from "./workerPoolSpanCapture-DVYmzgbN.js";
|
|
7
|
+
import { h as _t, s as bt } from "./workerPoolSpanCapture-DVYmzgbN.js";
|
|
8
|
+
import { a as Fe, C as Ne, i as b, b as De, c as ue, d as we, e as Pe } from "./runtimeConfig-CB57auSb.js";
|
|
9
|
+
import { f as Nt, g as Dt, s as wt } from "./runtimeConfig-CB57auSb.js";
|
|
10
10
|
import { createRequire as Ee } from "node:module";
|
|
11
11
|
import * as Te from "fs";
|
|
12
|
-
import { readFileSync as Ce, appendFileSync as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
12
|
+
import { readFileSync as Ce, appendFileSync as Re } from "fs";
|
|
13
|
+
import E from "http";
|
|
14
|
+
import O from "https";
|
|
15
|
+
import { s as Ue } from "./source-map-Cr6YkjTd.js";
|
|
16
|
+
import * as Z from "fs/promises";
|
|
17
|
+
import * as D from "path";
|
|
18
|
+
import { glob as Oe } from "glob";
|
|
19
|
+
import { threadId as k } from "worker_threads";
|
|
20
|
+
import { s as Et, t as Tt, a as Ct } from "./funcSpanTransformer-S_WeAt_m.js";
|
|
19
21
|
class C extends T {
|
|
20
22
|
constructor() {
|
|
21
23
|
super(), this.setOperationName("IdentifyServiceDetails");
|
|
22
24
|
}
|
|
23
25
|
async doSend(t) {
|
|
24
|
-
if (!
|
|
26
|
+
if (!g().serviceIdentificationReceived) try {
|
|
25
27
|
this.send();
|
|
26
28
|
} catch (e) {
|
|
27
|
-
|
|
29
|
+
g().sfDebug && console.error(" Error during service identification:", e);
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
async send() {
|
|
@@ -43,6 +45,9 @@ class C extends T {
|
|
|
43
45
|
$gitRepo: String,
|
|
44
46
|
$gitProvider: String,
|
|
45
47
|
$serviceDisplayName: String,
|
|
48
|
+
$framework: String,
|
|
49
|
+
$additionalFrameworks: JSON,
|
|
50
|
+
$serviceRole: String,
|
|
46
51
|
) {
|
|
47
52
|
${this.queryName}(
|
|
48
53
|
apiKey: $apiKey,
|
|
@@ -58,13 +63,16 @@ class C extends T {
|
|
|
58
63
|
gitRepo: $gitRepo,
|
|
59
64
|
gitProvider: $gitProvider,
|
|
60
65
|
serviceDisplayName: $serviceDisplayName,
|
|
66
|
+
framework: $framework,
|
|
67
|
+
additionalFrameworks: $additionalFrameworks,
|
|
68
|
+
serviceRole: $serviceRole,
|
|
61
69
|
)
|
|
62
70
|
}
|
|
63
|
-
`, e = this.getVariables({ serviceIdentifier:
|
|
64
|
-
|
|
71
|
+
`, e = g(), i = this.getVariables({ serviceIdentifier: e.serviceIdentifier, serviceVersion: e.serviceVersion, library: e.packageLibraryType, version: e.version, serviceAdditionalMetadata: e.serviceAdditionalMetadata, gitSha: e.gitSha || "", gitOrg: e.gitOrg || void 0, gitRepo: e.gitRepo || void 0, gitProvider: e.gitProvider || void 0, serviceDisplayName: e.serviceDisplayName || void 0, framework: e.framework || void 0, additionalFrameworks: e.additionalFrameworks.length > 0 ? e.additionalFrameworks : void 0, serviceRole: e.serviceRole || void 0 });
|
|
72
|
+
w(this.endpoint, this.operationName, t, i);
|
|
65
73
|
}
|
|
66
74
|
}
|
|
67
|
-
class
|
|
75
|
+
class ke extends T {
|
|
68
76
|
constructor() {
|
|
69
77
|
super();
|
|
70
78
|
y(this, "serviceIdentifier", new C());
|
|
@@ -73,18 +81,18 @@ class Oe extends T {
|
|
|
73
81
|
async sendAppIdentifier() {
|
|
74
82
|
this.serviceIdentifier.doSend({});
|
|
75
83
|
}
|
|
76
|
-
async doSend(e, i, n,
|
|
77
|
-
this.sendAppIdentifier(), this.send(e, i, n,
|
|
84
|
+
async doSend(e, i, n, s) {
|
|
85
|
+
this.sendAppIdentifier(), this.send(e, i, n, s);
|
|
78
86
|
}
|
|
79
|
-
async send(e, i, n,
|
|
80
|
-
if (!i && !
|
|
81
|
-
let
|
|
82
|
-
if (!
|
|
83
|
-
const
|
|
84
|
-
|
|
87
|
+
async send(e, i, n, s) {
|
|
88
|
+
if (!i && !s) throw new Error('Must pass in either traits or traits_json to "add_or_update_traits"');
|
|
89
|
+
let l = [];
|
|
90
|
+
if (!s) {
|
|
91
|
+
const o = Fe(i);
|
|
92
|
+
s = o.traitsJson, l = o.excludedFields;
|
|
85
93
|
}
|
|
86
|
-
const
|
|
87
|
-
|
|
94
|
+
const a = this.getVariables({ userId: e, traitsJson: s, excludedFields: l, override: n, library: g().packageLibraryType, version: g().version });
|
|
95
|
+
w(this.endpoint, this.operationName, this.getQuery(), a);
|
|
88
96
|
}
|
|
89
97
|
getQuery() {
|
|
90
98
|
return `
|
|
@@ -97,17 +105,17 @@ class Oe extends T {
|
|
|
97
105
|
class pe {
|
|
98
106
|
constructor(t) {
|
|
99
107
|
y(this, "metadataTransmitter");
|
|
100
|
-
this.apiKey = t, this.metadataTransmitter = new
|
|
108
|
+
this.apiKey = t, this.metadataTransmitter = new ke();
|
|
101
109
|
}
|
|
102
110
|
identify(t, e, i, n = !1) {
|
|
103
111
|
e || i ? this.addOrUpdateMetadata(t, e, i, n) : this.addOrUpdateMetadata(t, {}, void 0, n);
|
|
104
112
|
}
|
|
105
113
|
addOrUpdateMetadata(t, e = {}, i, n = !1) {
|
|
106
114
|
if (!e && !i) throw new Error('Must pass in either traits or traitsJson to "addOrUpdateMetadata"');
|
|
107
|
-
|
|
115
|
+
g().sfDebug && console.log(" [[DEBUG - addOrUpdateMetadata]] Starting operation"), g().sfDebug && console.log(" addOrUpdateMetadata...SENDING DATA...", t, e, i), this.metadataTransmitter.doSend(t, e, n, i);
|
|
108
116
|
}
|
|
109
117
|
}
|
|
110
|
-
class
|
|
118
|
+
class Q extends T {
|
|
111
119
|
constructor() {
|
|
112
120
|
super();
|
|
113
121
|
y(this, "serviceIdentifier", new C());
|
|
@@ -121,9 +129,9 @@ class J extends T {
|
|
|
121
129
|
async send(e) {
|
|
122
130
|
try {
|
|
123
131
|
const i = Array.isArray(e) ? e : [e, "default", null, null], n = this.getVariables({ contents: i[0], level: i[1], sourceFile: i[2] || void 0, sourceLine: i[3] || void 0 });
|
|
124
|
-
|
|
132
|
+
w(this.endpoint, this.operationName, this.getQuery(), n);
|
|
125
133
|
} catch (i) {
|
|
126
|
-
|
|
134
|
+
g().sfDebug && console.error("🚨 Error in send():", i);
|
|
127
135
|
}
|
|
128
136
|
}
|
|
129
137
|
getQuery() {
|
|
@@ -154,7 +162,7 @@ class J extends T {
|
|
|
154
162
|
`;
|
|
155
163
|
}
|
|
156
164
|
}
|
|
157
|
-
class
|
|
165
|
+
class Le extends T {
|
|
158
166
|
constructor() {
|
|
159
167
|
super();
|
|
160
168
|
y(this, "serviceIdentifier", new C());
|
|
@@ -175,9 +183,9 @@ class Ae extends T {
|
|
|
175
183
|
this.sendAppIdentifier(), this.send(e, i);
|
|
176
184
|
}
|
|
177
185
|
async send(e, i) {
|
|
178
|
-
|
|
179
|
-
const n = JSON.stringify(Ne.encode(i)),
|
|
180
|
-
|
|
186
|
+
g().sfDebug && console.log(" SENDING EXCEPTION...");
|
|
187
|
+
const n = JSON.stringify(Ne.encode(i)), s = this.normalizedSupplementalForGraphQL(), l = this.getVariables({ exceptionMessage: e, traceJson: n, reentrancyGuardPreactive: !1, library: g().packageLibraryType, version: g().version, ...s });
|
|
188
|
+
w(this.endpoint, this.operationName, this.getQuery(), l);
|
|
181
189
|
}
|
|
182
190
|
getQuery() {
|
|
183
191
|
return `
|
|
@@ -211,51 +219,51 @@ class Ae extends T {
|
|
|
211
219
|
`;
|
|
212
220
|
}
|
|
213
221
|
}
|
|
214
|
-
const
|
|
215
|
-
var
|
|
216
|
-
const
|
|
217
|
-
let
|
|
222
|
+
const ee = "getting request source code";
|
|
223
|
+
var q = ((r) => (r.UNKNOWN = "unknown", r.ANONYMOUS = "anonymous", r.NOT_CAPTURED = "not captured", r))(q || {});
|
|
224
|
+
const te = "http:", Ae = Ee(import.meta.url);
|
|
225
|
+
let ne = !1;
|
|
218
226
|
function qe() {
|
|
219
|
-
const r =
|
|
220
|
-
if (
|
|
227
|
+
const r = g().sfDebug;
|
|
228
|
+
if (ne) return void (r && b("[patchNodeHttpInbound] Already installed, skipping."));
|
|
221
229
|
let t;
|
|
222
|
-
|
|
230
|
+
ne = !0;
|
|
223
231
|
try {
|
|
224
|
-
t =
|
|
232
|
+
t = Ae("node:http"), r && b("[patchNodeHttpInbound] node:http required successfully.");
|
|
225
233
|
} catch (n) {
|
|
226
234
|
return void De("Failed to require node:http:", n);
|
|
227
235
|
}
|
|
228
|
-
if (!t?.Server?.prototype) return void (r &&
|
|
236
|
+
if (!t?.Server?.prototype) return void (r && b("[patchNodeHttpInbound] http.Server.prototype not found."));
|
|
229
237
|
const e = t.Server.prototype, i = e.emit;
|
|
230
|
-
i && !e.__sf_inbound_patched__ ? (Object.defineProperty(e, "__sf_inbound_patched__", { value: !0, enumerable: !1, configurable: !1, writable: !1 }), r &&
|
|
231
|
-
if (n !== "request") return r &&
|
|
232
|
-
const
|
|
233
|
-
const
|
|
234
|
-
if (!
|
|
235
|
-
for (const [
|
|
236
|
-
return
|
|
237
|
-
})(
|
|
238
|
-
r && (
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
const
|
|
242
|
-
r &&
|
|
243
|
-
const m = () =>
|
|
244
|
-
|
|
245
|
-
const
|
|
246
|
-
r &&
|
|
238
|
+
i && !e.__sf_inbound_patched__ ? (Object.defineProperty(e, "__sf_inbound_patched__", { value: !0, enumerable: !1, configurable: !1, writable: !1 }), r && b("[patchNodeHttpInbound] Patching http.Server.prototype.emit."), e.emit = function(n, ...s) {
|
|
239
|
+
if (n !== "request") return r && b(`[patchNodeHttpInbound] Passing through event: ${n}`), i.call(this, n, ...s);
|
|
240
|
+
const l = s[0], a = s[1], o = (function(u) {
|
|
241
|
+
const h = {};
|
|
242
|
+
if (!u) return h;
|
|
243
|
+
for (const [v, I] of Object.entries(u)) I != null && (Array.isArray(I) ? h[v.toLowerCase()] = I.join(", ") : h[v.toLowerCase()] = String(I));
|
|
244
|
+
return h;
|
|
245
|
+
})(l?.headers), d = o["x-sf3-rid"], p = o["x-sf3-functionspancaptureoverride"];
|
|
246
|
+
r && (b("[patchNodeHttpInbound] Intercepted request event."), b("[patchNodeHttpInbound] Inbound headers:", o), b("[patchNodeHttpInbound] Trace header:", d), b("[patchNodeHttpInbound] FuncSpan override header:", p));
|
|
247
|
+
const c = V.getInstance();
|
|
248
|
+
c.setTraceId(d);
|
|
249
|
+
const f = c.getTraceId();
|
|
250
|
+
r && b("[patchNodeHttpInbound] Context traceId set:", f);
|
|
251
|
+
const m = () => c.runWith({ inboundHeaders: o, ...d ? { traceId: d } : {} }, () => {
|
|
252
|
+
d && c.setTraceId(d), r && b("[patchNodeHttpInbound] Running request handler in context.");
|
|
253
|
+
const u = () => {
|
|
254
|
+
r && b("[patchNodeHttpInbound] Response finished/closed for traceId:", c.getTraceId());
|
|
247
255
|
};
|
|
248
|
-
return
|
|
256
|
+
return a.on("finish", u), a.on("close", u), i.call(this, n, l, a);
|
|
249
257
|
});
|
|
250
|
-
if (!
|
|
258
|
+
if (!p) return m();
|
|
251
259
|
try {
|
|
252
|
-
return
|
|
260
|
+
return Ie.run(p, () => m());
|
|
253
261
|
} catch {
|
|
254
262
|
return m();
|
|
255
263
|
}
|
|
256
|
-
}) : r &&
|
|
264
|
+
}) : r && b("[patchNodeHttpInbound] Already patched, skipping.");
|
|
257
265
|
}
|
|
258
|
-
class He extends
|
|
266
|
+
class He extends Q {
|
|
259
267
|
constructor() {
|
|
260
268
|
super(), this.setOperationName("DomainsToNotPassHeaderTo");
|
|
261
269
|
}
|
|
@@ -276,7 +284,7 @@ class He extends J {
|
|
|
276
284
|
)
|
|
277
285
|
}
|
|
278
286
|
`, i = { apiKey: this.apiKey, serviceUuid: this.serviceUUID, domains: t };
|
|
279
|
-
|
|
287
|
+
w(this.endpoint, this.operationName, e, i);
|
|
280
288
|
}
|
|
281
289
|
}
|
|
282
290
|
class Me extends T {
|
|
@@ -292,8 +300,8 @@ class Me extends T {
|
|
|
292
300
|
this.sendAppIdentifier(), this.send(e);
|
|
293
301
|
}
|
|
294
302
|
async send(e) {
|
|
295
|
-
const { name: i, column: n, line:
|
|
296
|
-
|
|
303
|
+
const { name: i, column: n, line: s, entrypoint: l, retryWithoutTraceId: a } = e, o = this.getVariables({ name: i, column: n, line: s, entrypoint: l, retryWithoutTraceId: a });
|
|
304
|
+
w(this.endpoint, this.operationName, this.getQuery(), o);
|
|
297
305
|
}
|
|
298
306
|
getQuery() {
|
|
299
307
|
return `
|
|
@@ -347,10 +355,10 @@ class xe extends T {
|
|
|
347
355
|
}
|
|
348
356
|
async send(e) {
|
|
349
357
|
const i = { data: { ...e } };
|
|
350
|
-
await
|
|
358
|
+
await w(this.endpoint, this.operationName, this.getQuery(), i);
|
|
351
359
|
}
|
|
352
360
|
}
|
|
353
|
-
const
|
|
361
|
+
const x = [400, 403];
|
|
354
362
|
class Ge {
|
|
355
363
|
constructor(t = []) {
|
|
356
364
|
y(this, "HEADER_TRACING", "X-Sf3-Rid");
|
|
@@ -358,17 +366,17 @@ class Ge {
|
|
|
358
366
|
y(this, "HEADER_PRINT_GUARD", "reentrancy_guard_print_preactive");
|
|
359
367
|
y(this, "HEADER_EXCEPTION_GUARD", "reentrancy_guard_exception_preactive");
|
|
360
368
|
y(this, "contextManager");
|
|
361
|
-
this.contextManager =
|
|
369
|
+
this.contextManager = V.getInstance(), t?.forEach((e) => {
|
|
362
370
|
typeof e == "string" && e.trim() && this.contextManager.getExcludedDomains().add(e);
|
|
363
|
-
}),
|
|
371
|
+
}), g().sfDebug && console.log("[RequestInterceptor] Initialized with static excluded domains.");
|
|
364
372
|
}
|
|
365
373
|
extractIdsFromTraceHeader(t, e = this.HEADER_TRACING) {
|
|
366
374
|
let i;
|
|
367
375
|
if (t instanceof Headers) i = t.get(e) ?? void 0;
|
|
368
376
|
else {
|
|
369
|
-
const
|
|
370
|
-
for (const [
|
|
371
|
-
i =
|
|
377
|
+
const s = e.toLowerCase();
|
|
378
|
+
for (const [l, a] of Object.entries(t)) if (l.toLowerCase() === s) {
|
|
379
|
+
i = a;
|
|
372
380
|
break;
|
|
373
381
|
}
|
|
374
382
|
}
|
|
@@ -379,43 +387,43 @@ class Ge {
|
|
|
379
387
|
parseStackFrame(t) {
|
|
380
388
|
const e = /\((.*):(\d+):(\d+)\)$/.exec(t.trim());
|
|
381
389
|
if (!e) return null;
|
|
382
|
-
const [, i, n,
|
|
383
|
-
return { filePath: i, line: parseInt(n, 10), column: parseInt(
|
|
390
|
+
const [, i, n, s] = e;
|
|
391
|
+
return { filePath: i, line: parseInt(n, 10), column: parseInt(s, 10) };
|
|
384
392
|
}
|
|
385
393
|
async getOriginalPosition(t, e, i) {
|
|
386
394
|
let n = { source: t, line: e, column: i, name: null };
|
|
387
395
|
if (t.includes("://")) return { originalPos: n };
|
|
388
|
-
const
|
|
396
|
+
const s = t + ".map";
|
|
389
397
|
try {
|
|
390
|
-
const
|
|
391
|
-
let
|
|
392
|
-
|
|
393
|
-
} catch (
|
|
394
|
-
|
|
398
|
+
const l = JSON.parse(Ce(s, "utf-8"));
|
|
399
|
+
let a = (await new Ue.SourceMapConsumer(l)).originalPositionFor({ line: e, column: i });
|
|
400
|
+
a.source && (n = a);
|
|
401
|
+
} catch (l) {
|
|
402
|
+
g().sfDebug && console.error(`Could not read/parse map file at ${s}:`, l);
|
|
395
403
|
}
|
|
396
404
|
return { originalPos: n };
|
|
397
405
|
}
|
|
398
406
|
captureFirstUserLines(t, e = 10, i = !1) {
|
|
399
|
-
const n =
|
|
400
|
-
Error.stackTraceLimit = Math.max(
|
|
401
|
-
const
|
|
402
|
-
|
|
403
|
-
const
|
|
404
|
-
Error.stackTraceLimit =
|
|
405
|
-
const
|
|
406
|
-
`).slice(1),
|
|
407
|
-
for (const
|
|
408
|
-
if (!(
|
|
409
|
-
for (const
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
const { originalPos:
|
|
413
|
-
if (
|
|
414
|
-
|
|
415
|
-
const m = { line:
|
|
407
|
+
const n = g().sfDebug ? 10 : e, s = Error.stackTraceLimit;
|
|
408
|
+
Error.stackTraceLimit = Math.max(s, n);
|
|
409
|
+
const l = new Error(ee);
|
|
410
|
+
ee in Error && Error.captureStackTrace(l, this.captureFirstUserLines);
|
|
411
|
+
const a = ue(l.stack);
|
|
412
|
+
Error.stackTraceLimit = s;
|
|
413
|
+
const o = a.split(`
|
|
414
|
+
`).slice(1), d = [];
|
|
415
|
+
for (const p of o)
|
|
416
|
+
if (!(p.includes("node:internal") || p.includes("internal/modules") || p.includes("internal/process") || p.includes("node_modules") || p.includes(".next/server/chunks") || p.includes("RequestInterceptor") || p.includes("contextManager") || p.includes("setupConfig")) && (d.push(p.trim()), d.length >= e)) break;
|
|
417
|
+
for (const p of d) {
|
|
418
|
+
const c = this.parseStackFrame(p);
|
|
419
|
+
c ? (async () => {
|
|
420
|
+
const { originalPos: f } = await this.getOriginalPosition(c.filePath, c.line, c.column);
|
|
421
|
+
if (f) {
|
|
422
|
+
g().sfDebug && console.log("[RequestInterceptor] First user code line:", f);
|
|
423
|
+
const m = { line: f.line?.toString() || q.UNKNOWN, column: f.column?.toString() || q.NOT_CAPTURED, name: f.name || q.NOT_CAPTURED, entrypoint: f.source, retryWithoutTraceId: i };
|
|
416
424
|
t.doSend(m);
|
|
417
425
|
}
|
|
418
|
-
})() :
|
|
426
|
+
})() : g().sfDebug && console.error("Could not parse stack line:", p);
|
|
419
427
|
}
|
|
420
428
|
}
|
|
421
429
|
addReentrancyGuardHeaders(t) {
|
|
@@ -426,118 +434,134 @@ class Ge {
|
|
|
426
434
|
}
|
|
427
435
|
addTracingHeaders(t, e) {
|
|
428
436
|
const i = new URL(e).hostname, n = this.shouldPropagateHeaders(i);
|
|
429
|
-
return n ? this.addTracingHeader(t, e) :
|
|
437
|
+
return n ? this.addTracingHeader(t, e) : g().sfDebug && console.error(`[RequestInterceptor] Excluded domain: ${i}`), n;
|
|
430
438
|
}
|
|
431
439
|
addTracingHeader(t, e) {
|
|
432
|
-
const i =
|
|
440
|
+
const i = B();
|
|
433
441
|
if (i) {
|
|
434
|
-
const
|
|
435
|
-
if (
|
|
442
|
+
const a = j(i);
|
|
443
|
+
if (a && a.sample_rate === 0) return void (g().sfDebug && console.log(`[RequestInterceptor] Function span tracking disabled (sample_rate=0), skipping tracing header for ${e}`));
|
|
436
444
|
}
|
|
437
|
-
const n = this.contextManager.getOrSetSfTraceId(),
|
|
438
|
-
t.set(this.HEADER_TRACING, `${n}/${
|
|
445
|
+
const n = this.contextManager.getOrSetSfTraceId(), s = this.contextManager.getOrSetPageVisitUUID(), l = W();
|
|
446
|
+
t.set(this.HEADER_TRACING, `${n}/${s}/${l}`), g().sfDebug && console.log(`[RequestInterceptor] Added tracing header for ${e}`);
|
|
439
447
|
}
|
|
440
448
|
patchFetch(t, e) {
|
|
441
449
|
const i = globalThis.fetch;
|
|
442
|
-
typeof i == "function" ? globalThis.fetch = async (n,
|
|
443
|
-
const
|
|
444
|
-
if (
|
|
450
|
+
typeof i == "function" ? globalThis.fetch = async (n, s) => {
|
|
451
|
+
const l = new Headers(s?.headers);
|
|
452
|
+
if (l.get(this.HEADER_LOG_GUARD) === "true" || l.get(this.HEADER_PRINT_GUARD) === "true" || l.get(this.HEADER_EXCEPTION_GUARD) === "true") return i(n, s);
|
|
445
453
|
this.captureFirstUserLines(t);
|
|
446
|
-
const
|
|
447
|
-
let
|
|
448
|
-
typeof n == "string" || n instanceof URL ?
|
|
449
|
-
|
|
450
|
-
})) :
|
|
451
|
-
const
|
|
454
|
+
const a = Date.now();
|
|
455
|
+
let o;
|
|
456
|
+
typeof n == "string" || n instanceof URL ? o = n.toString() : n instanceof Request ? (o = n.url, n.headers.forEach((u, h) => {
|
|
457
|
+
l.set(h, u);
|
|
458
|
+
})) : g().sfDebug && console.error("[Sailfish RequestInterceptor] Invalid fetch input."), g().sfDebug && console.log("[RequestInterceptor] Fetching request to:", o);
|
|
459
|
+
const d = new URL(o).hostname, p = new Headers(l), c = this.addTracingHeaders(l, o), f = { ...s, headers: l };
|
|
452
460
|
let m;
|
|
453
461
|
try {
|
|
454
|
-
let
|
|
455
|
-
this.addTracingHeaders(
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
const { sessionId:
|
|
459
|
-
if (
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}),
|
|
462
|
+
let u = !1;
|
|
463
|
+
this.addTracingHeaders(p, o), m = await i(o, f), c && x.includes(m.status) ? (m = await i(o, { ...s, headers: p }), u = !0, this.captureFirstUserLines(t, 10, u)) : this.contextManager.addSupportedDomains(d);
|
|
464
|
+
const h = Date.now();
|
|
465
|
+
g().sfDebug && console.log(`[RequestInterceptor] Fetch completed: ${o}, Status: ${m.status}, Duration: ${h - a}ms`);
|
|
466
|
+
const { sessionId: v, pageVisitId: I, requestId: _ } = this.extractIdsFromTraceHeader(l), S = g(), F = { apiKey: S.apiKey, requestId: _, pageVisitId: I, recordingSessionId: v, serviceUuid: S.serviceUUID, timestampStart: a.toString(), timestampEnd: h.toString(), responseCode: m.status, success: !0, error: null, url: o, method: f.method || "GET", retryWithoutTraceId: u, parentSpanId: H() };
|
|
467
|
+
if (S.captureRequestHeaders) {
|
|
468
|
+
const $ = {};
|
|
469
|
+
l.forEach((N, P) => {
|
|
470
|
+
$[P] = N;
|
|
471
|
+
}), F.requestHeaders = $;
|
|
464
472
|
}
|
|
465
|
-
if (
|
|
466
|
-
const
|
|
467
|
-
m.headers.forEach((
|
|
468
|
-
|
|
469
|
-
}),
|
|
473
|
+
if (S.captureResponseHeaders) {
|
|
474
|
+
const $ = {};
|
|
475
|
+
m.headers.forEach((N, P) => {
|
|
476
|
+
$[P] = N;
|
|
477
|
+
}), F.responseHeaders = $;
|
|
470
478
|
}
|
|
471
|
-
if (
|
|
472
|
-
const
|
|
473
|
-
|
|
479
|
+
if (S.captureRequestBody && s?.body) try {
|
|
480
|
+
const $ = typeof s.body == "string" ? s.body : JSON.stringify(s.body);
|
|
481
|
+
F.requestBody = $.length > S.requestBodyLimitBytes ? $.substring(0, S.requestBodyLimitBytes) + "...[truncated]" : $;
|
|
474
482
|
} catch {
|
|
475
483
|
}
|
|
476
|
-
if (
|
|
477
|
-
const
|
|
478
|
-
|
|
484
|
+
if (S.captureResponseBody) try {
|
|
485
|
+
const $ = m.clone(), N = await $.text();
|
|
486
|
+
F.responseBody = N.length > S.responseBodyLimitBytes ? N.substring(0, S.responseBodyLimitBytes) + "...[truncated]" : N;
|
|
479
487
|
} catch {
|
|
480
488
|
}
|
|
481
|
-
return e.doSend(
|
|
482
|
-
} catch (
|
|
483
|
-
const
|
|
484
|
-
|
|
489
|
+
return e.doSend(F), m;
|
|
490
|
+
} catch (u) {
|
|
491
|
+
const h = Date.now();
|
|
492
|
+
g().sfDebug && console.error(`[RequestInterceptor] Fetch failed: ${o}, Error: ${u}, Duration: ${h - a}ms`);
|
|
493
|
+
}
|
|
494
|
+
} : g().sfDebug && console.error("[RequestInterceptor] Fetch not available.");
|
|
495
|
+
}
|
|
496
|
+
setHeader(t, e, i) {
|
|
497
|
+
t instanceof Headers ? t.set(e, i) : t[e] = i;
|
|
498
|
+
}
|
|
499
|
+
addTracingHeadersToPlainObject(t, e) {
|
|
500
|
+
const i = new URL(e).hostname, n = this.shouldPropagateHeaders(i);
|
|
501
|
+
if (n) {
|
|
502
|
+
const s = B();
|
|
503
|
+
if (s) {
|
|
504
|
+
const d = j(s);
|
|
505
|
+
if (d && d.sample_rate === 0) return g().sfDebug && console.log(`[RequestInterceptor] Function span tracking disabled (sample_rate=0), skipping tracing header for ${e}`), !1;
|
|
485
506
|
}
|
|
486
|
-
|
|
507
|
+
const l = this.contextManager.getOrSetSfTraceId(), a = this.contextManager.getOrSetPageVisitUUID(), o = W();
|
|
508
|
+
t[this.HEADER_TRACING] = `${l}/${a}/${o}`, g().sfDebug && console.log(`[RequestInterceptor] Added tracing header for ${e}`);
|
|
509
|
+
} else g().sfDebug && console.error(`[RequestInterceptor] Excluded domain: ${i}`);
|
|
510
|
+
return n;
|
|
487
511
|
}
|
|
488
512
|
patchHttp(t, e) {
|
|
489
|
-
if (
|
|
490
|
-
const i =
|
|
491
|
-
|
|
492
|
-
|
|
513
|
+
if (g().sfDebug && console.log("[RequestInterceptor] Initializing HTTP/HTTPS request patch..."), !E || typeof E.request != "function") return void (g().sfDebug && console.log("[RequestInterceptor] HTTP/HTTPS not available."));
|
|
514
|
+
const i = E.request.bind(E), n = O.request.bind(O), s = (o, d, p, c = te) => {
|
|
515
|
+
let f, m;
|
|
516
|
+
if (typeof o == "string" || o instanceof URL) {
|
|
517
|
+
const u = typeof o == "string" ? new URL(o) : o;
|
|
518
|
+
f = { ...typeof d == "object" && d !== null ? d : {}, protocol: u.protocol || c, hostname: u.hostname, port: u.port || void 0, path: u.pathname + u.search }, m = typeof d == "function" ? d : p;
|
|
519
|
+
} else f = { ...o }, f.protocol || (f.protocol = c), m = typeof d == "function" ? d : void 0;
|
|
520
|
+
return f.headers || (f.headers = {}), [f, m];
|
|
521
|
+
}, l = (o, d, p) => {
|
|
522
|
+
const [c, f] = s(o, d, p, te);
|
|
493
523
|
try {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
if (s.headers) {
|
|
499
|
-
const c = `${s.protocol}//${s.hostname}`;
|
|
500
|
-
this.addTracingHeaders(s.headers, c), this.captureFirstUserLines(t);
|
|
501
|
-
} else u().sfDebug && console.warn("[RequestInterceptor] No headers found in HTTP request options. Skipping header addition.");
|
|
502
|
-
} catch (c) {
|
|
503
|
-
throw u().sfDebug && console.error("[RequestInterceptor] Error while processing HTTP request options:", c), c;
|
|
524
|
+
const u = `${c.protocol}//${c.hostname}`;
|
|
525
|
+
this.addTracingHeadersToPlainObject(c.headers, u), this.captureFirstUserLines(t);
|
|
526
|
+
} catch (u) {
|
|
527
|
+
g().sfDebug && console.error("[RequestInterceptor] Error while processing HTTP request options:", u);
|
|
504
528
|
}
|
|
505
|
-
let
|
|
506
|
-
return i(
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
delete p.headers[this.HEADER_TRACING], i(p, d), a = !0, this.captureFirstUserLines(t, 10, a);
|
|
529
|
+
let m = !1;
|
|
530
|
+
return i(c, (u) => {
|
|
531
|
+
const h = `${c.protocol}//${c.hostname}`;
|
|
532
|
+
if (this.shouldPropagateHeaders(new URL(h).hostname) && x.includes(u.statusCode || 0)) {
|
|
533
|
+
const S = { ...c, headers: { ...c.headers } };
|
|
534
|
+
delete S.headers[this.HEADER_TRACING], i(S, f), m = !0, this.captureFirstUserLines(t, 10, m);
|
|
512
535
|
}
|
|
513
|
-
const { sessionId:
|
|
514
|
-
e.doSend({ apiKey:
|
|
536
|
+
const { sessionId: v, pageVisitId: I, requestId: _ } = this.extractIdsFromTraceHeader(c.headers);
|
|
537
|
+
e.doSend({ apiKey: g().apiKey, requestId: _, pageVisitId: I, recordingSessionId: v, serviceUuid: g().serviceUUID, timestampStart: Date.now().toString(), timestampEnd: Date.now().toString(), responseCode: u.statusCode || 0, success: !!u.statusCode && u.statusCode < 400, error: null, url: h, method: c.method || "GET", retryWithoutTraceId: m, parentSpanId: H() }), f?.(u);
|
|
515
538
|
});
|
|
516
|
-
},
|
|
517
|
-
|
|
539
|
+
}, a = (o, d, p) => {
|
|
540
|
+
const [c, f] = s(o, d, p, "https:");
|
|
518
541
|
try {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
if (s.headers) {
|
|
524
|
-
const c = `${s.protocol}//${s.hostname}`;
|
|
525
|
-
this.addTracingHeaders(s.headers, c);
|
|
526
|
-
} else u().sfDebug && console.warn("[RequestInterceptor] No headers found in HTTPS request options. Skipping header addition.");
|
|
527
|
-
} catch (c) {
|
|
528
|
-
throw u().sfDebug && console.error("[RequestInterceptor] Error while processing HTTPS request options:", c), c;
|
|
542
|
+
const u = `${c.protocol}//${c.hostname}`;
|
|
543
|
+
this.addTracingHeadersToPlainObject(c.headers, u), this.captureFirstUserLines(t);
|
|
544
|
+
} catch (u) {
|
|
545
|
+
g().sfDebug && console.error("[RequestInterceptor] Error while processing HTTPS request options:", u);
|
|
529
546
|
}
|
|
530
|
-
let
|
|
531
|
-
return n(
|
|
532
|
-
const
|
|
533
|
-
if (
|
|
534
|
-
const
|
|
535
|
-
delete
|
|
547
|
+
let m = !1;
|
|
548
|
+
return n(c, (u) => {
|
|
549
|
+
const h = `${c.protocol}//${c.hostname}`;
|
|
550
|
+
if (this.shouldPropagateHeaders(new URL(h).hostname) && x.includes(u.statusCode || 0)) {
|
|
551
|
+
const S = { ...c, headers: { ...c.headers } };
|
|
552
|
+
delete S.headers[this.HEADER_TRACING], n(S, f), m = !0, this.captureFirstUserLines(t, 10, m);
|
|
536
553
|
}
|
|
537
|
-
const { sessionId:
|
|
538
|
-
e.doSend({ apiKey:
|
|
554
|
+
const { sessionId: v, pageVisitId: I, requestId: _ } = this.extractIdsFromTraceHeader(c.headers);
|
|
555
|
+
e.doSend({ apiKey: g().apiKey, requestId: _, pageVisitId: I, recordingSessionId: v, serviceUuid: g().serviceUUID, timestampStart: Date.now().toString(), timestampEnd: Date.now().toString(), responseCode: u.statusCode || 0, success: !!u.statusCode && u.statusCode < 400, error: null, url: h, method: c.method || "GET", retryWithoutTraceId: m, parentSpanId: H() }), f?.(u);
|
|
539
556
|
});
|
|
540
|
-
}
|
|
557
|
+
};
|
|
558
|
+
E.request = l, O.request = a, E.get = (o, d, p) => {
|
|
559
|
+
const c = l(o, d, p);
|
|
560
|
+
return c.end(), c;
|
|
561
|
+
}, O.get = (o, d, p) => {
|
|
562
|
+
const c = a(o, d, p);
|
|
563
|
+
return c.end(), c;
|
|
564
|
+
}, g().sfDebug && console.log("✅ HTTP and HTTPS request/get methods patched globally.");
|
|
541
565
|
}
|
|
542
566
|
tryPatch(t, e) {
|
|
543
567
|
try {
|
|
@@ -549,7 +573,7 @@ class Ge {
|
|
|
549
573
|
return [...this.contextManager.getExcludedDomains()];
|
|
550
574
|
}
|
|
551
575
|
}
|
|
552
|
-
class Ke extends
|
|
576
|
+
class Ke extends Q {
|
|
553
577
|
constructor() {
|
|
554
578
|
super(), this.setOperationName("UpdateServiceDetails");
|
|
555
579
|
}
|
|
@@ -574,6 +598,9 @@ class Ke extends J {
|
|
|
574
598
|
$infrastructureDetails: JSON,
|
|
575
599
|
$setupInterceptorsFile: String,
|
|
576
600
|
$setupInterceptorsLine: Int,
|
|
601
|
+
$framework: String,
|
|
602
|
+
$additionalFrameworks: JSON,
|
|
603
|
+
$serviceRole: String,
|
|
577
604
|
) {
|
|
578
605
|
${this.queryName}(
|
|
579
606
|
apiKey: $apiKey,
|
|
@@ -591,10 +618,13 @@ class Ke extends J {
|
|
|
591
618
|
infrastructureDetails: $infrastructureDetails,
|
|
592
619
|
setupInterceptorsFile: $setupInterceptorsFile,
|
|
593
620
|
setupInterceptorsLine: $setupInterceptorsLine,
|
|
621
|
+
framework: $framework,
|
|
622
|
+
additionalFrameworks: $additionalFrameworks,
|
|
623
|
+
serviceRole: $serviceRole,
|
|
594
624
|
)
|
|
595
625
|
}
|
|
596
|
-
`, e =
|
|
597
|
-
|
|
626
|
+
`, e = g(), i = this.getVariables({ serviceIdentifier: e.serviceIdentifier, serviceVersion: e.serviceVersion, serviceAdditionalMetadata: e.serviceAdditionalMetadata, gitSha: e.gitSha || "", gitOrg: e.gitOrg || void 0, gitRepo: e.gitRepo || void 0, gitProvider: e.gitProvider || void 0, serviceDisplayName: e.serviceDisplayName || void 0, infrastructureType: e.infrastructureType || void 0, infrastructureDetails: e.infrastructureDetails || void 0, setupInterceptorsFile: e.setupInterceptorsFile || void 0, setupInterceptorsLine: e.setupInterceptorsLine || void 0, framework: e.framework || void 0, additionalFrameworks: e.additionalFrameworks?.length > 0 ? e.additionalFrameworks : void 0, serviceRole: e.serviceRole || void 0 });
|
|
627
|
+
w(this.endpoint, this.operationName, t, i);
|
|
598
628
|
}
|
|
599
629
|
}
|
|
600
630
|
class We {
|
|
@@ -617,23 +647,23 @@ class We {
|
|
|
617
647
|
await this._resolveInheritance(), this.debug && console.log(`[FuncSpan ConfigLoader] Loaded ${this.fileConfigs.size} file configs, ${this.functionConfigs.size} function configs`);
|
|
618
648
|
}
|
|
619
649
|
getConfig(t, e) {
|
|
620
|
-
const i = this.hasSailfishFiles ? $e() :
|
|
621
|
-
let
|
|
650
|
+
const i = this.hasSailfishFiles ? $e() : le(), n = this._getDirectoryConfig(t), s = D.normalize(t), l = this.fileConfigs.get(s) || {};
|
|
651
|
+
let a = {};
|
|
622
652
|
if (e) {
|
|
623
|
-
const
|
|
624
|
-
|
|
653
|
+
const o = this.functionConfigs.get(s);
|
|
654
|
+
o && (a = o.get(e) || {});
|
|
625
655
|
}
|
|
626
|
-
return
|
|
656
|
+
return R(i, n, l, a);
|
|
627
657
|
}
|
|
628
658
|
hasRuntimeMode() {
|
|
629
659
|
return this.runtimeModeEnabled;
|
|
630
660
|
}
|
|
631
661
|
async _walkDirectory(t, e) {
|
|
632
662
|
try {
|
|
633
|
-
const i = await
|
|
663
|
+
const i = await Z.readdir(t, { withFileTypes: !0 });
|
|
634
664
|
for (const n of i) {
|
|
635
|
-
const
|
|
636
|
-
n.isFile() && n.name === ".sailfish" ? e.push(
|
|
665
|
+
const s = D.join(t, n.name);
|
|
666
|
+
n.isFile() && n.name === ".sailfish" ? e.push(s) : n.name === "node_modules" || n.isDirectory() && n.name.startsWith(".") && n.name !== ".sailfish" || n.isDirectory() && await this._walkDirectory(s, e);
|
|
637
667
|
}
|
|
638
668
|
} catch (i) {
|
|
639
669
|
this.debug && console.error(`[FuncSpan ConfigLoader] Error walking directory ${t}:`, i);
|
|
@@ -641,7 +671,7 @@ class We {
|
|
|
641
671
|
}
|
|
642
672
|
async _loadConfigFile(t) {
|
|
643
673
|
try {
|
|
644
|
-
const e = await
|
|
674
|
+
const e = await Z.readFile(t, "utf-8"), i = D.dirname(t);
|
|
645
675
|
let n = null;
|
|
646
676
|
try {
|
|
647
677
|
n = JSON.parse(e);
|
|
@@ -651,8 +681,8 @@ class We {
|
|
|
651
681
|
} catch {
|
|
652
682
|
try {
|
|
653
683
|
n = require("js-yaml").load(e);
|
|
654
|
-
} catch (
|
|
655
|
-
return void (this.debug && console.error(`[FuncSpan ConfigLoader] Failed to parse ${t} as JSON, TOML, or YAML:`,
|
|
684
|
+
} catch (s) {
|
|
685
|
+
return void (this.debug && console.error(`[FuncSpan ConfigLoader] Failed to parse ${t} as JSON, TOML, or YAML:`, s));
|
|
656
686
|
}
|
|
657
687
|
}
|
|
658
688
|
}
|
|
@@ -663,40 +693,40 @@ class We {
|
|
|
663
693
|
}
|
|
664
694
|
}
|
|
665
695
|
async _expandFileGlobs(t, e, i) {
|
|
666
|
-
for (const [n,
|
|
667
|
-
const
|
|
668
|
-
this.debug && console.log(`[FuncSpan ConfigLoader] Pattern '${n}' matched ${
|
|
669
|
-
for (const
|
|
670
|
-
const
|
|
671
|
-
this.fileConfigs.set(
|
|
696
|
+
for (const [n, s] of Object.entries(e)) try {
|
|
697
|
+
const l = D.join(t, n), a = await Oe(l, { absolute: !0, nodir: !0, ignore: ["**/node_modules/**", "**/.git/**"] });
|
|
698
|
+
this.debug && console.log(`[FuncSpan ConfigLoader] Pattern '${n}' matched ${a.length} files`);
|
|
699
|
+
for (const o of a) {
|
|
700
|
+
const d = D.normalize(o), p = R(i, s);
|
|
701
|
+
this.fileConfigs.set(d, p), this.debug && a.length <= 5 && console.log(`[FuncSpan ConfigLoader] - ${o}`);
|
|
672
702
|
}
|
|
673
|
-
} catch (
|
|
674
|
-
this.debug && console.error(`[FuncSpan ConfigLoader] Error expanding glob '${n}':`,
|
|
703
|
+
} catch (l) {
|
|
704
|
+
this.debug && console.error(`[FuncSpan ConfigLoader] Error expanding glob '${n}':`, l);
|
|
675
705
|
}
|
|
676
706
|
}
|
|
677
707
|
_storeFunctionConfigs(t, e, i) {
|
|
678
|
-
for (const [n,
|
|
679
|
-
const
|
|
680
|
-
if (
|
|
708
|
+
for (const [n, s] of Object.entries(e)) {
|
|
709
|
+
const l = n.split("::");
|
|
710
|
+
if (l.length !== 2) {
|
|
681
711
|
this.debug && console.warn(`[FuncSpan ConfigLoader] Invalid function pattern '${n}' (expected format: 'file.ts::functionName')`);
|
|
682
712
|
continue;
|
|
683
713
|
}
|
|
684
|
-
const [
|
|
685
|
-
this.functionConfigs.has(
|
|
686
|
-
const
|
|
687
|
-
|
|
714
|
+
const [a, o] = l, d = D.normalize(D.join(t, a));
|
|
715
|
+
this.functionConfigs.has(d) || this.functionConfigs.set(d, /* @__PURE__ */ new Map());
|
|
716
|
+
const p = this.functionConfigs.get(d), c = R(i, s);
|
|
717
|
+
p.set(o, c), this.debug && console.log(`[FuncSpan ConfigLoader] Function config: ${d}::${o}`);
|
|
688
718
|
}
|
|
689
719
|
}
|
|
690
720
|
async _resolveInheritance() {
|
|
691
721
|
}
|
|
692
722
|
_getDirectoryConfig(t) {
|
|
693
|
-
let e =
|
|
723
|
+
let e = D.dirname(D.normalize(t));
|
|
694
724
|
const i = [];
|
|
695
|
-
for (; e && e !==
|
|
725
|
+
for (; e && e !== D.dirname(e); ) {
|
|
696
726
|
const n = this.directoryConfigs.get(e);
|
|
697
|
-
n && i.unshift(n), e =
|
|
727
|
+
n && i.unshift(n), e = D.dirname(e);
|
|
698
728
|
}
|
|
699
|
-
return i.reduce((n,
|
|
729
|
+
return i.reduce((n, s) => R(n, s), {});
|
|
700
730
|
}
|
|
701
731
|
}
|
|
702
732
|
const ge = "__sf_globalConfigLoader";
|
|
@@ -709,15 +739,15 @@ async function Be(r, t) {
|
|
|
709
739
|
globalThis[ge] = i;
|
|
710
740
|
})(e), await e.loadAllConfigs();
|
|
711
741
|
}
|
|
712
|
-
function
|
|
742
|
+
function je(r, t) {
|
|
713
743
|
const e = fe();
|
|
714
|
-
return e ? e.getConfig(r, t) : (process.env.SF_DEBUG === "true" && console.log("[FuncSpan ConfigLoader] Config loader not initialized, using default config (disabled)"),
|
|
744
|
+
return e ? e.getConfig(r, t) : (process.env.SF_DEBUG === "true" && console.log("[FuncSpan ConfigLoader] Config loader not initialized, using default config (disabled)"), le());
|
|
715
745
|
}
|
|
716
|
-
function
|
|
746
|
+
function ze() {
|
|
717
747
|
return fe() !== null;
|
|
718
748
|
}
|
|
719
|
-
const Je = ["readFile", "writeFile", "appendFile", "readdir", "stat", "lstat", "fstat", "access", "open", "close", "read", "write", "chmod", "mkdir", "rmdir", "unlink", "rename"],
|
|
720
|
-
let
|
|
749
|
+
const Je = ["readFile", "writeFile", "appendFile", "readdir", "stat", "lstat", "fstat", "access", "open", "close", "read", "write", "chmod", "mkdir", "rmdir", "unlink", "rename"], re = ["lookup", "resolve", "resolve4", "resolve6", "resolveAny", "resolveMx", "resolveNs", "resolveTxt", "reverse"], Ve = ["pbkdf2", "randomBytes", "scrypt", "generateKeyPair"], Qe = ["gzip", "gunzip", "deflate", "inflate", "deflateRaw", "inflateRaw", "brotliCompress", "brotliDecompress"];
|
|
750
|
+
let ie = !1;
|
|
721
751
|
function Xe(r) {
|
|
722
752
|
if (typeof r != "string") return !1;
|
|
723
753
|
const t = process.env.SF_FUNCSPAN_JSONL_FILE;
|
|
@@ -725,8 +755,8 @@ function Xe(r) {
|
|
|
725
755
|
const e = process.env.SF_WORKER_POOL_JSONL_FILE;
|
|
726
756
|
return !(!e || !r.includes(e));
|
|
727
757
|
}
|
|
728
|
-
let
|
|
729
|
-
function
|
|
758
|
+
let se = !1;
|
|
759
|
+
function oe(r) {
|
|
730
760
|
if (typeof r != "string") return !1;
|
|
731
761
|
if (r === "localhost" || r === "127.0.0.1" || r === "::1") return !0;
|
|
732
762
|
try {
|
|
@@ -738,7 +768,7 @@ function re(r) {
|
|
|
738
768
|
return !1;
|
|
739
769
|
}
|
|
740
770
|
function Ye() {
|
|
741
|
-
if (!
|
|
771
|
+
if (!se) try {
|
|
742
772
|
let r;
|
|
743
773
|
if (typeof require > "u") return void (process.env.SF_DEBUG === "true" && console.log("[WorkerPool] Skipping dns patching in pure ESM environment (require unavailable)"));
|
|
744
774
|
try {
|
|
@@ -748,35 +778,35 @@ function Ye() {
|
|
|
748
778
|
}
|
|
749
779
|
if (r.__sf_worker_pool_patched__) return;
|
|
750
780
|
Object.defineProperty(r, "__sf_worker_pool_patched__", { value: !0, enumerable: !1, writable: !1, configurable: !1 });
|
|
751
|
-
for (const t of
|
|
781
|
+
for (const t of re) if (typeof r[t] == "function") {
|
|
752
782
|
const e = r[t];
|
|
753
783
|
r[t] = function(...i) {
|
|
754
|
-
return
|
|
784
|
+
return Y() ? e.apply(this, i) : oe(i[0]) ? e.apply(this, i) : typeof i[i.length - 1] == "function" ? A("dns", t, e, i, this) : e.apply(this, i);
|
|
755
785
|
}, Object.defineProperty(r[t], "name", { value: t, writable: !1 });
|
|
756
786
|
}
|
|
757
787
|
(function(t) {
|
|
758
788
|
if (!t.promises) return void (process.env.SF_DEBUG === "true" && console.log("[WorkerPool] dns.promises not available, skipping"));
|
|
759
789
|
if (!t.promises.__sf_worker_pool_patched__) {
|
|
760
790
|
Object.defineProperty(t.promises, "__sf_worker_pool_patched__", { value: !0, enumerable: !1, writable: !1, configurable: !1 });
|
|
761
|
-
for (const e of
|
|
791
|
+
for (const e of re) if (typeof t.promises[e] == "function") {
|
|
762
792
|
const i = t.promises[e];
|
|
763
793
|
t.promises[e] = function(...n) {
|
|
764
|
-
return
|
|
794
|
+
return Y() ? i.apply(this, n) : oe(n[0]) ? i.apply(this, n) : _e("dns", e, i, n, this);
|
|
765
795
|
}, Object.defineProperty(t.promises[e], "name", { value: e, writable: !1 });
|
|
766
796
|
}
|
|
767
797
|
process.env.SF_DEBUG === "true" && console.log("[WorkerPool] dns.promises module patched successfully");
|
|
768
798
|
}
|
|
769
|
-
})(r),
|
|
799
|
+
})(r), se = !0, process.env.SF_DEBUG === "true" && console.log("[WorkerPool] dns module patched successfully");
|
|
770
800
|
} catch (r) {
|
|
771
801
|
console.error("[WorkerPool] Error patching dns module:", r);
|
|
772
802
|
}
|
|
773
803
|
}
|
|
774
|
-
let
|
|
804
|
+
let ae = !1, ce = !1, z = !1;
|
|
775
805
|
function Ze() {
|
|
776
|
-
if (
|
|
806
|
+
if (z) return;
|
|
777
807
|
const r = process.env.SF_DEBUG === "true";
|
|
778
|
-
r && console.log("[WorkerPool] Initializing worker pool patching..."),
|
|
779
|
-
if (!
|
|
808
|
+
r && console.log("[WorkerPool] Initializing worker pool patching..."), U("fs") && (r && console.log("[WorkerPool] Patching fs module..."), (function() {
|
|
809
|
+
if (!ie) try {
|
|
780
810
|
const t = require("node:fs");
|
|
781
811
|
if (t.__sf_worker_pool_patched__) return;
|
|
782
812
|
Object.defineProperty(t, "__sf_worker_pool_patched__", { value: !0, enumerable: !1, writable: !1, configurable: !1 });
|
|
@@ -786,12 +816,12 @@ function Ze() {
|
|
|
786
816
|
return Xe(n[0]) ? i.apply(this, n) : typeof n[n.length - 1] == "function" ? A("fs", e, i, n, this) : i.apply(this, n);
|
|
787
817
|
}, Object.defineProperty(t[e], "name", { value: e, writable: !1 });
|
|
788
818
|
}
|
|
789
|
-
|
|
819
|
+
ie = !0, process.env.SF_DEBUG === "true" && console.log("[WorkerPool] fs module patched successfully");
|
|
790
820
|
} catch (t) {
|
|
791
821
|
console.error("[WorkerPool] Error patching fs module:", t);
|
|
792
822
|
}
|
|
793
|
-
})()),
|
|
794
|
-
if (!
|
|
823
|
+
})()), U("dns") && (r && console.log("[WorkerPool] Patching dns module..."), Ye()), U("crypto") && (r && console.log("[WorkerPool] Patching crypto module..."), (function() {
|
|
824
|
+
if (!ae) try {
|
|
795
825
|
const t = require("node:crypto");
|
|
796
826
|
if (t.__sf_worker_pool_patched__) return;
|
|
797
827
|
Object.defineProperty(t, "__sf_worker_pool_patched__", { value: !0, enumerable: !1, writable: !1, configurable: !1 });
|
|
@@ -801,12 +831,12 @@ function Ze() {
|
|
|
801
831
|
return typeof n[n.length - 1] == "function" ? A("crypto", e, i, n, this) : i.apply(this, n);
|
|
802
832
|
}, Object.defineProperty(t[e], "name", { value: e, writable: !1 });
|
|
803
833
|
}
|
|
804
|
-
|
|
834
|
+
ae = !0, process.env.SF_DEBUG === "true" && console.log("[WorkerPool] crypto module patched successfully");
|
|
805
835
|
} catch (t) {
|
|
806
836
|
console.error("[WorkerPool] Error patching crypto module:", t);
|
|
807
837
|
}
|
|
808
|
-
})()),
|
|
809
|
-
if (!
|
|
838
|
+
})()), U("zlib") && (r && console.log("[WorkerPool] Patching zlib module..."), (function() {
|
|
839
|
+
if (!ce) try {
|
|
810
840
|
const t = require("node:zlib");
|
|
811
841
|
if (t.__sf_worker_pool_patched__) return;
|
|
812
842
|
Object.defineProperty(t, "__sf_worker_pool_patched__", { value: !0, enumerable: !1, writable: !1, configurable: !1 });
|
|
@@ -816,163 +846,163 @@ function Ze() {
|
|
|
816
846
|
return typeof n[n.length - 1] == "function" ? A("zlib", e, i, n, this) : i.apply(this, n);
|
|
817
847
|
}, Object.defineProperty(t[e], "name", { value: e, writable: !1 });
|
|
818
848
|
}
|
|
819
|
-
|
|
849
|
+
ce = !0, process.env.SF_DEBUG === "true" && console.log("[WorkerPool] zlib module patched successfully");
|
|
820
850
|
} catch (t) {
|
|
821
851
|
console.error("[WorkerPool] Error patching zlib module:", t);
|
|
822
852
|
}
|
|
823
|
-
})()),
|
|
853
|
+
})()), z = !0, r && console.log("[WorkerPool] Worker pool patching initialized");
|
|
824
854
|
}
|
|
825
855
|
function et() {
|
|
826
|
-
return
|
|
856
|
+
return z;
|
|
827
857
|
}
|
|
828
|
-
let
|
|
829
|
-
function
|
|
830
|
-
if (
|
|
831
|
-
else if (!
|
|
832
|
-
|
|
858
|
+
let J = !1, G = !1;
|
|
859
|
+
function pt(r) {
|
|
860
|
+
if (G) console.warn("[setupInterceptors] ⚠️ Recursive call detected and blocked!");
|
|
861
|
+
else if (!J) {
|
|
862
|
+
G = !0;
|
|
833
863
|
try {
|
|
834
864
|
let t, e;
|
|
835
|
-
const i =
|
|
865
|
+
const i = ue(new Error().stack);
|
|
836
866
|
if (i) {
|
|
837
|
-
const
|
|
838
|
-
`)[2] || "",
|
|
839
|
-
|
|
867
|
+
const a = i.split(`
|
|
868
|
+
`)[2] || "", o = a.match(/\((.+):(\d+):\d+\)/) || a.match(/at (.+):(\d+):\d+/);
|
|
869
|
+
o && (t = o[1], e = parseInt(o[2], 10));
|
|
840
870
|
}
|
|
841
871
|
if (!r || !r.apiKey) {
|
|
842
|
-
const
|
|
843
|
-
console.error(
|
|
872
|
+
const a = `The required API Key is not provided: ${JSON.stringify(r)}`;
|
|
873
|
+
console.error(a);
|
|
844
874
|
}
|
|
845
875
|
const { config: n } = Se(r);
|
|
846
|
-
if (
|
|
876
|
+
if (ve(n).catch(() => {
|
|
847
877
|
}), t && (n.setupInterceptorsFile = t), e && (n.setupInterceptorsLine = e), n.sfDebug && console.log("Updated configuration after applying options:", n), !n.apiKey || !n.apiGraphqlEndpoint) {
|
|
848
|
-
const
|
|
849
|
-
throw console.error(
|
|
878
|
+
const a = `The required config is not provided: ${JSON.stringify(n)}`;
|
|
879
|
+
throw console.error(a), new Error(a);
|
|
850
880
|
}
|
|
851
|
-
|
|
852
|
-
n.sfDebug && console.error("[FuncSpan] Failed to initialize config loader:",
|
|
881
|
+
ze() || Be(void 0, n.sfDebug).catch((a) => {
|
|
882
|
+
n.sfDebug && console.error("[FuncSpan] Failed to initialize config loader:", a);
|
|
853
883
|
}), process.env.SF_WORKER_POOL_DISABLED === "true" ? n.sfDebug && console.log("[setupInterceptors] Worker pool patching DISABLED (SF_WORKER_POOL_DISABLED=true)") : et() || (Ze(), n.sfDebug && console.log("[setupInterceptors] Worker pool patching initialized (DNS tracking enabled)"));
|
|
854
|
-
const
|
|
855
|
-
|
|
856
|
-
const
|
|
857
|
-
new He().doSend(
|
|
858
|
-
const
|
|
859
|
-
|
|
884
|
+
const s = new Q();
|
|
885
|
+
s.setServiceUUID(n.serviceUUID), we(s), (function(a = []) {
|
|
886
|
+
const o = new Ge(a);
|
|
887
|
+
new He().doSend(o.getExcludedDomains());
|
|
888
|
+
const d = new Me(), p = new xe();
|
|
889
|
+
o.patchFetch(d, p), o.patchHttp(d, p);
|
|
860
890
|
})(n.domainsToNotPropagateHeadersTo);
|
|
861
|
-
const
|
|
862
|
-
|
|
891
|
+
const l = new Le();
|
|
892
|
+
l.setServiceUUID(n.serviceUUID), Pe(l), qe(), new Ke().send(), J = !0, n.sfDebug && console.log("[setupInterceptors] ✅ Initialization complete");
|
|
863
893
|
} finally {
|
|
864
|
-
|
|
894
|
+
G = !1;
|
|
865
895
|
}
|
|
866
896
|
}
|
|
867
897
|
}
|
|
868
|
-
function
|
|
869
|
-
return
|
|
898
|
+
function gt() {
|
|
899
|
+
return J;
|
|
870
900
|
}
|
|
871
|
-
function
|
|
872
|
-
const n =
|
|
901
|
+
function ft(r, t, e, i = !1) {
|
|
902
|
+
const n = g();
|
|
873
903
|
new pe(n.apiKey).identify(r, t, e, i);
|
|
874
904
|
}
|
|
875
|
-
function
|
|
876
|
-
const n =
|
|
905
|
+
function ht(r, t = {}, e, i = !1) {
|
|
906
|
+
const n = g();
|
|
877
907
|
new pe(n.apiKey).addOrUpdateMetadata(r, t, e, i);
|
|
878
908
|
}
|
|
879
|
-
let
|
|
880
|
-
function
|
|
881
|
-
const n = function(...
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
const
|
|
885
|
-
const
|
|
886
|
-
if (
|
|
887
|
-
const
|
|
888
|
-
if (
|
|
909
|
+
let K = null;
|
|
910
|
+
function mt(r, t, e, i) {
|
|
911
|
+
const n = function(...s) {
|
|
912
|
+
const l = de(), a = l?.sfDebug || !1;
|
|
913
|
+
a && console.log(`[FuncSpan] captureFunctionSpan wrapper called for ${e}::${t}`);
|
|
914
|
+
const o = (function(h, v) {
|
|
915
|
+
const I = B();
|
|
916
|
+
if (I) {
|
|
917
|
+
const _ = j(I);
|
|
918
|
+
if (_) return process.env.SF_DEBUG === "true" && console.log(`[FuncSpan] Using HTTP header override for ${h}::${v}`), _;
|
|
889
919
|
}
|
|
890
920
|
try {
|
|
891
|
-
return
|
|
921
|
+
return je(h, v);
|
|
892
922
|
} catch {
|
|
893
923
|
return { sample_rate: process.env.SF_FUNCSPAN_SAMPLE_RATE ? parseFloat(process.env.SF_FUNCSPAN_SAMPLE_RATE) : 1, capture_arguments: !0, capture_return_value: !0, arg_limit_mb: 1, return_limit_mb: 1, enable_sampling: !1, autocapture_all_child_functions: !1, capture_sf_veritas: !1, parse_json_strings: !1 };
|
|
894
924
|
}
|
|
895
925
|
})(e, t);
|
|
896
|
-
if (
|
|
897
|
-
if (
|
|
898
|
-
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
const
|
|
902
|
-
let
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
}),
|
|
926
|
+
if (a && console.log(`[FuncSpan] Config for ${e}::${t}:`, o), o.enable_sampling && o.sample_rate < 1 && Math.random() > o.sample_rate) return a && console.log(`[FuncSpan] Skipping ${t} due to sampling`), r.apply(this, s);
|
|
927
|
+
if (o.sample_rate === 0) return a && console.log(`[FuncSpan] Skipping ${t} - sample_rate is 0.0`), r.apply(this, s);
|
|
928
|
+
a && console.log(`[FuncSpan] Capturing function span for ${t}`);
|
|
929
|
+
const d = V.getInstance(), p = d.getCurrentFunctionSpanId(), c = W();
|
|
930
|
+
d.setCurrentFunctionSpanId(c);
|
|
931
|
+
const f = process.hrtime.bigint(), m = Date.now();
|
|
932
|
+
let u = null;
|
|
933
|
+
o.capture_arguments && (u = {}, i.paramNames.forEach((h, v) => {
|
|
934
|
+
v < s.length && (u[h] = s[v]);
|
|
935
|
+
}), u && o.arg_limit_mb > 0 && (u = M(u, o.arg_limit_mb)));
|
|
906
936
|
try {
|
|
907
|
-
const
|
|
908
|
-
if (
|
|
909
|
-
const
|
|
910
|
-
let
|
|
911
|
-
return
|
|
912
|
-
}, (
|
|
913
|
-
const
|
|
914
|
-
throw
|
|
937
|
+
const h = r.apply(this, s);
|
|
938
|
+
if (h && typeof h.then == "function") return p ? d.setCurrentFunctionSpanId(p) : d.clearCurrentFunctionSpanId(), h.then((F) => {
|
|
939
|
+
const $ = process.hrtime.bigint(), N = Date.now(), P = Number($ - f);
|
|
940
|
+
let X = null;
|
|
941
|
+
return o.capture_return_value && o.return_limit_mb > 0 && (X = M(F, o.return_limit_mb)), L({ functionName: t, filePath: e, metadata: i, args: u, result: X, error: null, duration: N - m, durationNs: P, startTimeNs: f.toString(), async: !0, spanId: c, parentSpanId: p, pid: process.pid, threadId: k }), F;
|
|
942
|
+
}, (F) => {
|
|
943
|
+
const $ = process.hrtime.bigint(), N = Date.now(), P = Number($ - f);
|
|
944
|
+
throw L({ functionName: t, filePath: e, metadata: i, args: u, result: null, error: F?.message || String(F), duration: N - m, durationNs: P, startTimeNs: f.toString(), async: !0, spanId: c, parentSpanId: p, pid: process.pid, threadId: k }), F;
|
|
915
945
|
});
|
|
916
|
-
const
|
|
917
|
-
let
|
|
918
|
-
return
|
|
919
|
-
} catch (
|
|
920
|
-
const
|
|
921
|
-
throw
|
|
946
|
+
const v = process.hrtime.bigint(), I = Date.now(), _ = Number(v - f);
|
|
947
|
+
let S = null;
|
|
948
|
+
return o.capture_return_value && o.return_limit_mb > 0 && (S = M(h, o.return_limit_mb)), L({ functionName: t, filePath: e, metadata: i, args: u, result: S, error: null, duration: I - m, durationNs: _, startTimeNs: f.toString(), async: !1, spanId: c, parentSpanId: p, pid: process.pid, threadId: k }), p ? d.setCurrentFunctionSpanId(p) : d.clearCurrentFunctionSpanId(), h;
|
|
949
|
+
} catch (h) {
|
|
950
|
+
const v = process.hrtime.bigint(), I = Date.now(), _ = Number(v - f);
|
|
951
|
+
throw L({ functionName: t, filePath: e, metadata: i, args: u, result: null, error: h?.message || String(h), duration: I - m, durationNs: _, startTimeNs: f.toString(), async: !1, spanId: c, parentSpanId: p, pid: process.pid, threadId: k }), p ? d.setCurrentFunctionSpanId(p) : d.clearCurrentFunctionSpanId(), h;
|
|
922
952
|
}
|
|
923
953
|
};
|
|
924
954
|
Object.defineProperty(n, "name", { value: t, writable: !1 });
|
|
925
|
-
for (const
|
|
955
|
+
for (const s in r) r.hasOwnProperty(s) && (n[s] = r[s]);
|
|
926
956
|
return n;
|
|
927
957
|
}
|
|
928
|
-
function
|
|
929
|
-
const t =
|
|
958
|
+
function L(r) {
|
|
959
|
+
const t = de(), e = t?.sfDebug || !1;
|
|
930
960
|
e && console.log("[FuncSpan] captureSpanData called for:", { function: r.functionName, file: r.filePath, duration: `${r.duration}ms`, async: r.async, error: r.error, spanId: r.spanId });
|
|
931
961
|
const i = { functionName: r.functionName, filePath: r.filePath, metadata: r.metadata, args: r.args, result: r.result, error: r.error, duration: r.duration, durationNs: r.durationNs, async: r.async, spanId: r.spanId, parentSpanId: r.parentSpanId };
|
|
932
962
|
process.env.SF_FUNCSPAN_CONSOLE_OUTPUT === "true" && console.log(`
|
|
933
963
|
📊 Function Span:`, { function: `${r.functionName} (${r.filePath}:${r.metadata.line}:${r.metadata.column})`, duration: `${r.duration.toFixed(2)}ms`, arguments: r.args, result: r.error ? `Error: ${r.error}` : r.result, spanId: r.spanId, parentSpanId: r.parentSpanId || "none" });
|
|
934
964
|
const n = process.env.SF_FUNCSPAN_JSONL_FILE;
|
|
935
965
|
if (n) try {
|
|
936
|
-
const
|
|
966
|
+
const s = n === "true" || n === "1" ? "funcspans.jsonl" : n, l = Date.now(), a = process.hrtime.bigint(), o = BigInt(r.startTimeNs), d = Number(a - o) / 1e6, p = new Date(l - d).toISOString(), c = JSON.stringify({ timestamp: p, functionName: r.functionName, filePath: r.filePath, line: r.metadata.line, column: r.metadata.column, duration: r.duration, durationNs: r.durationNs, startTimeNs: r.startTimeNs, arguments: r.args, returnValue: r.error ? { error: String(r.error) } : r.result, spanId: r.spanId, parentSpanId: r.parentSpanId, async: r.async, pid: r.pid, threadId: r.threadId }) + `
|
|
937
967
|
`;
|
|
938
|
-
|
|
939
|
-
} catch (
|
|
940
|
-
console.error("[FuncSpan] Error writing to JSONL file:",
|
|
968
|
+
Re(s, c, "utf-8");
|
|
969
|
+
} catch (s) {
|
|
970
|
+
console.error("[FuncSpan] Error writing to JSONL file:", s);
|
|
941
971
|
}
|
|
942
972
|
if (e && console.log("[FuncSpan] Sending function span to transmitter:", i), process.env.SF_FUNCSPAN_SKIP_BACKEND !== "true") try {
|
|
943
|
-
(
|
|
944
|
-
} catch (
|
|
945
|
-
e && console.error("[FuncSpan] Error sending function span:",
|
|
973
|
+
(K || (K = new be()), K).send([i]), e && console.log("[FuncSpan] Function span sent successfully");
|
|
974
|
+
} catch (s) {
|
|
975
|
+
e && console.error("[FuncSpan] Error sending function span:", s);
|
|
946
976
|
}
|
|
947
977
|
}
|
|
948
|
-
function
|
|
978
|
+
function yt(r) {
|
|
949
979
|
return !!r.includes("captureFunctionSpan(") || !!r.includes("@sailfish-ai/sf-veritas") || !(!r.includes("/* @sailfish-instrumented */") && !r.includes("// @sailfish-instrumented"));
|
|
950
980
|
}
|
|
951
981
|
export {
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
982
|
+
V as ContextManager,
|
|
983
|
+
ht as addOrUpdateMetadata,
|
|
984
|
+
mt as captureFunctionSpan,
|
|
985
|
+
_t as clearFuncspanOverride,
|
|
986
|
+
H as getCurrentFunctionSpanId,
|
|
987
|
+
le as getDefaultConfig,
|
|
958
988
|
$e as getEnvConfig,
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
989
|
+
B as getFuncspanOverride,
|
|
990
|
+
je as getGlobalConfig,
|
|
991
|
+
ft as identify,
|
|
962
992
|
Be as initializeConfigLoader,
|
|
963
993
|
Ze as initializeWorkerPoolPatching,
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
994
|
+
yt as isAlreadyInstrumented,
|
|
995
|
+
ze as isConfigLoaderInitialized,
|
|
996
|
+
Nt as isProductionEnvironment,
|
|
997
|
+
Dt as isRuntimeModeEnabled,
|
|
998
|
+
gt as isSetupInterceptorsInitialized,
|
|
969
999
|
et as isWorkerPoolInitialized,
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1000
|
+
j as parseHeaderOverride,
|
|
1001
|
+
It as runWithContext,
|
|
1002
|
+
bt as setFuncspanOverride,
|
|
1003
|
+
Et as setSkipTypeScriptPlugin,
|
|
1004
|
+
pt as setupInterceptors,
|
|
1005
|
+
wt as shouldEnableRuntimeHooks,
|
|
1006
|
+
Tt as transformFunctionSpans,
|
|
1007
|
+
Ct as transformFunctionSpansSync
|
|
978
1008
|
};
|