brass-runtime 1.19.0 → 1.19.2
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 +34 -0
- package/dist/agent/cli/main.cjs +30 -30
- package/dist/agent/cli/main.js +2 -2
- package/dist/agent/cli/main.mjs +2 -2
- package/dist/agent/index.cjs +3 -3
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/agent/index.mjs +2 -2
- package/dist/{chunk-GOEO763K.cjs → chunk-2XXQ3NVT.cjs} +19 -19
- package/dist/{chunk-5RVHSBJ6.mjs → chunk-5X3MPWTR.mjs} +275 -39
- package/dist/{chunk-2R3RVNS2.js → chunk-6AGAZD32.js} +6 -6
- package/dist/{chunk-BLXBZ6RE.mjs → chunk-6BNZS2A4.mjs} +1 -1
- package/dist/{chunk-EXBGIC66.js → chunk-6W5DC3TX.js} +1 -1
- package/dist/{chunk-MUMBUXU6.mjs → chunk-BFNBU47C.mjs} +22 -6
- package/dist/{chunk-JWFOWPMB.js → chunk-BHX4MD35.js} +5 -5
- package/dist/{chunk-OO7BGCC3.cjs → chunk-CXWJII2N.cjs} +13 -13
- package/dist/{chunk-Z2YIDHRI.cjs → chunk-ENMKEX3N.cjs} +5 -5
- package/dist/{chunk-RZGB3DXR.js → chunk-HKLZJ5UK.js} +275 -39
- package/dist/{chunk-HW2CLRJ3.mjs → chunk-IA6BDGXW.mjs} +6 -6
- package/dist/{chunk-MA74OYCI.cjs → chunk-IHY2EJTT.cjs} +6 -6
- package/dist/{chunk-AQQQFNYD.mjs → chunk-IWAQQDYE.mjs} +1 -1
- package/dist/{chunk-C3CWI42G.js → chunk-J4F5KC3U.js} +1 -1
- package/dist/{chunk-ZDZNV6NA.cjs → chunk-JKHBEWQA.cjs} +23 -7
- package/dist/{chunk-5UBJT4RW.mjs → chunk-JM7WMSRR.mjs} +3 -3
- package/dist/{chunk-YQWZ7FZX.cjs → chunk-JQCQWO47.cjs} +5 -5
- package/dist/{chunk-B2VXVNIS.js → chunk-LI7WUVJN.js} +1 -1
- package/dist/{chunk-FC5N5QHJ.js → chunk-NWONRWBT.js} +2 -2
- package/dist/{chunk-H4ZRUQZL.js → chunk-PG6CHG34.js} +3 -3
- package/dist/{chunk-NQW3YUFN.cjs → chunk-QAHW7S3Q.cjs} +18 -18
- package/dist/{chunk-GXOIUBKE.js → chunk-RZQK32C6.js} +2 -2
- package/dist/{chunk-EKLEDIVJ.mjs → chunk-S6KSHYAT.mjs} +2 -2
- package/dist/{chunk-URVS2OE2.mjs → chunk-SCHM2MDA.mjs} +2 -2
- package/dist/{chunk-A6EG5WRL.js → chunk-TAPB4NN5.js} +2 -2
- package/dist/{chunk-APQBU7TM.js → chunk-TN2P7RNK.js} +22 -6
- package/dist/{chunk-QBVS3UYN.cjs → chunk-TWEHIAUE.cjs} +54 -54
- package/dist/{chunk-7FZUTJM3.cjs → chunk-UOKXJQAI.cjs} +380 -144
- package/dist/{chunk-FYWWU3Z7.cjs → chunk-VXNWVAIG.cjs} +2 -2
- package/dist/{chunk-KAPZHDO4.mjs → chunk-WA65XP2P.mjs} +1 -1
- package/dist/{chunk-4PKBNG2H.js → chunk-XO3TDAJE.js} +1 -1
- package/dist/{chunk-KDXNWGPB.mjs → chunk-XRRC5BBM.mjs} +1 -1
- package/dist/{chunk-DV644N7P.cjs → chunk-ZJC3JZIE.cjs} +16 -16
- package/dist/{chunk-3NKXUX4T.mjs → chunk-ZXLETUGQ.mjs} +2 -2
- package/dist/{chunk-OX6MF7SZ.mjs → chunk-ZXXOXB3T.mjs} +5 -5
- package/dist/{chunk-6STX4PS3.cjs → chunk-ZZ2CMYJL.cjs} +13 -13
- package/dist/core/index.cjs +9 -7
- package/dist/core/index.d.ts +6 -6
- package/dist/core/index.js +8 -6
- package/dist/core/index.mjs +8 -6
- package/dist/{defaultClient-Cid0JoUR.d.ts → defaultClient-hyVSNzSJ.d.ts} +3 -3
- package/dist/{effect-DnGUuhw6.d.ts → effect-DbEMiMvv.d.ts} +8 -1
- package/dist/http/index.cjs +48 -48
- package/dist/http/index.d.ts +8 -8
- package/dist/http/index.js +6 -6
- package/dist/http/index.mjs +6 -6
- package/dist/http/testing.cjs +8 -8
- package/dist/http/testing.d.ts +4 -4
- package/dist/http/testing.js +4 -4
- package/dist/http/testing.mjs +4 -4
- package/dist/index.cjs +87 -85
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -7
- package/dist/index.mjs +9 -7
- package/dist/{layer-D2LFcBVx.d.ts → layer-CsNGeVee.d.ts} +1 -1
- package/dist/observability/index.cjs +9 -9
- package/dist/observability/index.d.ts +7 -7
- package/dist/observability/index.js +8 -8
- package/dist/observability/index.mjs +8 -8
- package/dist/perf/cli.cjs +25 -25
- package/dist/perf/cli.js +10 -10
- package/dist/perf/cli.mjs +10 -10
- package/dist/perf/index.cjs +12 -12
- package/dist/perf/index.js +10 -10
- package/dist/perf/index.mjs +10 -10
- package/dist/{server-Bf1zNYZk.d.ts → server-BKKuzAW9.d.ts} +4 -4
- package/dist/{stream-I7bkvF7a.d.ts → stream-B8c_UKZq.d.ts} +1 -1
- package/dist/{tracer-DF83nLn6.d.ts → tracer-CS3yOXZx.d.ts} +2 -2
- package/dist/{tracing-CWV4gT0u.d.ts → tracing-DIAUf2x8.d.ts} +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkJQCQWO47cjs = require('./chunk-JQCQWO47.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkTWEHIAUEcjs = require('./chunk-TWEHIAUE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkZJC3JZIEcjs = require('./chunk-ZJC3JZIE.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkVXNWVAIGcjs = require('./chunk-VXNWVAIG.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkUOKXJQAIcjs = require('./chunk-UOKXJQAI.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkJKHBEWQAcjs = require('./chunk-JKHBEWQA.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -299,10 +299,10 @@ function makeRuntimeCase(variant, chainDepth) {
|
|
|
299
299
|
maxCapacity: 8192,
|
|
300
300
|
flushBudget: 2048
|
|
301
301
|
};
|
|
302
|
-
const scheduler = variant === "wide-scheduler" ? new (0,
|
|
303
|
-
const recorder = variant === "recorder" ?
|
|
304
|
-
const hooks = _nullishCoalesce(_optionalChain([recorder, 'optionalAccess', _8 => _8.hooks]), () => ( (variant === "active-hooks" ? new (0,
|
|
305
|
-
const runtime =
|
|
302
|
+
const scheduler = variant === "wide-scheduler" ? new (0, _chunkJKHBEWQAcjs.Scheduler)(schedulerConfig) : void 0;
|
|
303
|
+
const recorder = variant === "recorder" ? _chunkJQCQWO47cjs.makeRuntimeRecorder.call(void 0, { maxEvents: 1e4 }) : void 0;
|
|
304
|
+
const hooks = _nullishCoalesce(_optionalChain([recorder, 'optionalAccess', _8 => _8.hooks]), () => ( (variant === "active-hooks" ? new (0, _chunkVXNWVAIGcjs.EventBus)() : void 0)));
|
|
305
|
+
const runtime = _chunkJKHBEWQAcjs.Runtime.makeWithEngine(hooks ? {} : {}, "ts", {
|
|
306
306
|
hooks,
|
|
307
307
|
...scheduler ? { scheduler } : {},
|
|
308
308
|
inferLane: false
|
|
@@ -349,7 +349,7 @@ function makeFlatMapChain(depth) {
|
|
|
349
349
|
return effect;
|
|
350
350
|
}
|
|
351
351
|
function makeFiberRefProgram(depth) {
|
|
352
|
-
const ref =
|
|
352
|
+
const ref = _chunkJQCQWO47cjs.makeFiberRef.call(void 0, 0);
|
|
353
353
|
let effect = ref.set(0);
|
|
354
354
|
for (let i = 0; i < depth; i++) {
|
|
355
355
|
effect = _chunkMVGUEJ5Zcjs.asyncFlatMap.call(void 0, effect, () => ref.update((n) => n + 1));
|
|
@@ -651,7 +651,7 @@ async function profileHttpLayers(options = {}) {
|
|
|
651
651
|
}
|
|
652
652
|
async function runScenario(scenario) {
|
|
653
653
|
const server = await startDummyServer(scenario.delayMs);
|
|
654
|
-
const observability = scenario.variant === "default-json-observed" ?
|
|
654
|
+
const observability = scenario.variant === "default-json-observed" ? _chunkZJC3JZIEcjs.makeObservability.call(void 0, {
|
|
655
655
|
logs: false,
|
|
656
656
|
traces: { maxFinishedSpans: 1e4 },
|
|
657
657
|
autoStart: false
|
|
@@ -838,9 +838,9 @@ function makeDefaultJsonRunner(server, scenario, preset, disableAdaptiveLimiter
|
|
|
838
838
|
}
|
|
839
839
|
function makeProfileRuntime(concurrency, observability) {
|
|
840
840
|
const capacity = Math.max(65536, concurrency * 8);
|
|
841
|
-
return
|
|
841
|
+
return _chunkJKHBEWQAcjs.Runtime.makeWithEngine(_nullishCoalesce(_optionalChain([observability, 'optionalAccess', _30 => _30.env]), () => ( {})), "ts", {
|
|
842
842
|
hooks: _optionalChain([observability, 'optionalAccess', _31 => _31.hooks]),
|
|
843
|
-
scheduler: new (0,
|
|
843
|
+
scheduler: new (0, _chunkJKHBEWQAcjs.Scheduler)({
|
|
844
844
|
laneMode: "single",
|
|
845
845
|
initialCapacity: capacity,
|
|
846
846
|
maxCapacity: capacity,
|
|
@@ -862,24 +862,24 @@ function baseHttpConfig(baseUrl, scenario) {
|
|
|
862
862
|
};
|
|
863
863
|
}
|
|
864
864
|
function makeWireClient(baseUrl, scenario) {
|
|
865
|
-
return
|
|
865
|
+
return _chunkUOKXJQAIcjs.makeHttp.call(void 0, baseHttpConfig(baseUrl, scenario));
|
|
866
866
|
}
|
|
867
867
|
function makeMinimalClient(baseUrl, scenario) {
|
|
868
|
-
return
|
|
868
|
+
return _chunkUOKXJQAIcjs.makeDefaultHttpClient.call(void 0, {
|
|
869
869
|
preset: "minimal",
|
|
870
870
|
compression: false,
|
|
871
871
|
...baseHttpConfig(baseUrl, scenario)
|
|
872
872
|
});
|
|
873
873
|
}
|
|
874
874
|
function makeDefaultClient(baseUrl, scenario, preset, disableAdaptiveLimiter, observability) {
|
|
875
|
-
return
|
|
875
|
+
return _chunkUOKXJQAIcjs.makeDefaultHttpClient.call(void 0, {
|
|
876
876
|
preset,
|
|
877
877
|
compression: false,
|
|
878
878
|
...baseHttpConfig(baseUrl, scenario),
|
|
879
879
|
...disableAdaptiveLimiter ? { adaptiveLimiter: false } : {},
|
|
880
880
|
...observability ? {
|
|
881
881
|
middleware: [
|
|
882
|
-
|
|
882
|
+
_chunkTWEHIAUEcjs.withHttpObservability.call(void 0, {
|
|
883
883
|
metrics: observability.metrics,
|
|
884
884
|
logs: false,
|
|
885
885
|
spans: {},
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
EventBus,
|
|
3
3
|
InMemoryTracer,
|
|
4
4
|
makeMetrics
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WA65XP2P.mjs";
|
|
6
6
|
import {
|
|
7
7
|
Runtime,
|
|
8
8
|
ctxExtend,
|
|
9
9
|
ctxToObject,
|
|
10
10
|
emptyContext,
|
|
11
11
|
getCurrentFiber
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BFNBU47C.mjs";
|
|
13
13
|
import {
|
|
14
14
|
asyncFail,
|
|
15
15
|
asyncFlatMap,
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
EventBus,
|
|
3
3
|
InMemoryTracer,
|
|
4
4
|
makeMetrics
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LI7WUVJN.js";
|
|
6
6
|
import {
|
|
7
7
|
Runtime,
|
|
8
8
|
ctxExtend,
|
|
9
9
|
ctxToObject,
|
|
10
10
|
emptyContext,
|
|
11
11
|
getCurrentFiber
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TN2P7RNK.js";
|
|
13
13
|
import {
|
|
14
14
|
asyncFail,
|
|
15
15
|
asyncFlatMap,
|
|
@@ -2860,7 +2860,9 @@ var Runtime = class _Runtime {
|
|
|
2860
2860
|
this.forkPolicy = makeForkPolicy(this.env, this.hooks);
|
|
2861
2861
|
this.fiberEngine = this.makeFiberEngine(this.engineMode, args.wasm);
|
|
2862
2862
|
this.fallbackUsed = false;
|
|
2863
|
+
this.staticFastPathOk = this.hooks === NoopHooks && this.scheduler === globalScheduler && !this.inferLane && this.engineMode === "ts";
|
|
2863
2864
|
}
|
|
2865
|
+
staticFastPathOk;
|
|
2864
2866
|
makeFiberEngine(mode, wasm) {
|
|
2865
2867
|
if (mode === "ts") return new JsFiberEngine(this);
|
|
2866
2868
|
if (mode === "wasm") return new WasmFiberEngine(this, wasm);
|
|
@@ -2990,11 +2992,8 @@ var Runtime = class _Runtime {
|
|
|
2990
2992
|
});
|
|
2991
2993
|
}
|
|
2992
2994
|
tryRunNativeTopLevel(effect, cb) {
|
|
2993
|
-
if (this.
|
|
2995
|
+
if (!this.staticFastPathOk) return false;
|
|
2994
2996
|
if (getCurrentFiber() !== null) return false;
|
|
2995
|
-
if (this.scheduler !== globalScheduler) return false;
|
|
2996
|
-
if (this.inferLane) return false;
|
|
2997
|
-
if (this.engineMode !== "ts") return false;
|
|
2998
2997
|
new NativeTopLevelRunner(this, effect, cb).start();
|
|
2999
2998
|
return true;
|
|
3000
2999
|
}
|
|
@@ -3070,16 +3069,25 @@ var NativeTopLevelRunner = class {
|
|
|
3070
3069
|
this.runLoop();
|
|
3071
3070
|
}
|
|
3072
3071
|
runLoop() {
|
|
3073
|
-
this
|
|
3072
|
+
const prevFiber = setCurrentFiber(this);
|
|
3073
|
+
try {
|
|
3074
3074
|
this.yielded = false;
|
|
3075
3075
|
let budget = NATIVE_FAST_PATH_STEP_BUDGET;
|
|
3076
3076
|
while (!this.result && budget-- > 0) {
|
|
3077
3077
|
const current = this.current;
|
|
3078
3078
|
switch (current._tag) {
|
|
3079
3079
|
case "Succeed":
|
|
3080
|
+
if (!this.stack || this.stack.length === 0) {
|
|
3081
|
+
this.notify(Exit.succeed(current.value));
|
|
3082
|
+
return;
|
|
3083
|
+
}
|
|
3080
3084
|
this.onSuccess(current.value);
|
|
3081
3085
|
break;
|
|
3082
3086
|
case "Fail":
|
|
3087
|
+
if (!this.stack || this.stack.length === 0) {
|
|
3088
|
+
this.notify(Exit.failCause(Cause.fail(current.error)));
|
|
3089
|
+
return;
|
|
3090
|
+
}
|
|
3083
3091
|
this.onCause(Cause.fail(current.error));
|
|
3084
3092
|
break;
|
|
3085
3093
|
case "Sync":
|
|
@@ -3156,7 +3164,9 @@ var NativeTopLevelRunner = class {
|
|
|
3156
3164
|
this.yielded = true;
|
|
3157
3165
|
queueMicrotask(() => this.runLoop());
|
|
3158
3166
|
}
|
|
3159
|
-
}
|
|
3167
|
+
} finally {
|
|
3168
|
+
setCurrentFiber(prevFiber);
|
|
3169
|
+
}
|
|
3160
3170
|
}
|
|
3161
3171
|
runAsync(current) {
|
|
3162
3172
|
let registered = false;
|
|
@@ -4136,6 +4146,11 @@ function withCurrentFiber(fiber, f) {
|
|
|
4136
4146
|
_current = prev;
|
|
4137
4147
|
}
|
|
4138
4148
|
}
|
|
4149
|
+
function setCurrentFiber(fiber) {
|
|
4150
|
+
const prev = _current;
|
|
4151
|
+
_current = fiber;
|
|
4152
|
+
return prev;
|
|
4153
|
+
}
|
|
4139
4154
|
|
|
4140
4155
|
// src/core/runtime/engine/JsFiberEngine.ts
|
|
4141
4156
|
var JsFiberEngine = class {
|
|
@@ -4397,6 +4412,7 @@ export {
|
|
|
4397
4412
|
getCurrentFiber,
|
|
4398
4413
|
unsafeGetCurrentRuntime,
|
|
4399
4414
|
withCurrentFiber,
|
|
4415
|
+
setCurrentFiber,
|
|
4400
4416
|
Scope,
|
|
4401
4417
|
withScopeAsync,
|
|
4402
4418
|
withScope
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkENMKEX3Ncjs = require('./chunk-ENMKEX3N.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -13,26 +13,26 @@ var _chunkZ2YIDHRIcjs = require('./chunk-Z2YIDHRI.cjs');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkZJC3JZIEcjs = require('./chunk-ZJC3JZIE.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkUOKXJQAIcjs = require('./chunk-UOKXJQAI.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
var _chunkL6VB5N7Qcjs = require('./chunk-L6VB5N7Q.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkZZ2CMYJLcjs = require('./chunk-ZZ2CMYJL.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
var
|
|
35
|
+
var _chunkJKHBEWQAcjs = require('./chunk-JKHBEWQA.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -116,7 +116,7 @@ var HTTP_OBSERVABILITY_CONTRACT = Object.freeze({
|
|
|
116
116
|
});
|
|
117
117
|
function withHttpObservability(options) {
|
|
118
118
|
if (!isObservabilityInstance(options)) {
|
|
119
|
-
|
|
119
|
+
_chunkZJC3JZIEcjs.validateHttpObservabilityOptions.call(void 0, _nullishCoalesce(options, () => ( {})));
|
|
120
120
|
}
|
|
121
121
|
const resolved = resolveHttpObservabilityOptions(options);
|
|
122
122
|
const metricCache = makeHttpMetricCache();
|
|
@@ -183,13 +183,13 @@ function withHttpObservability(options) {
|
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
};
|
|
186
|
-
const fiber =
|
|
186
|
+
const fiber = _chunkJKHBEWQAcjs.getCurrentFiber.call(void 0, );
|
|
187
187
|
_optionalChain([fiber, 'optionalAccess', _3 => _3.addFinalizer, 'optionalCall', _4 => _4(() => {
|
|
188
188
|
completeFinish("abort", void 0, { "http.cancelled": true });
|
|
189
189
|
})]);
|
|
190
190
|
const reqLogLevel = resolved.logs === false ? false : _nullishCoalesce(resolved.logs.requestLevel, () => ( false));
|
|
191
191
|
if (reqLogLevel) {
|
|
192
|
-
const logEff =
|
|
192
|
+
const logEff = _chunkZJC3JZIEcjs.logEffect.call(void 0, reqLogLevel, "http.client.request", requestLogFields(req, resolved));
|
|
193
193
|
_chunkL6VB5N7Qcjs.registerHttpEffect.call(void 0, logEff, env, () => void 0);
|
|
194
194
|
}
|
|
195
195
|
const wireReq = resolved.injectTraceHeaders ? injectCurrentTraceContext(req) : req;
|
|
@@ -197,7 +197,7 @@ function withHttpObservability(options) {
|
|
|
197
197
|
const finish = completeFinish(httpStatusOutcome(res.status), String(res.status), {});
|
|
198
198
|
const adaptiveAttrs = observeAdaptiveLimiter(wireReq, next, resolved);
|
|
199
199
|
if (shouldEmitHttpSpanEvents(resolved)) {
|
|
200
|
-
const ev =
|
|
200
|
+
const ev = _chunkZJC3JZIEcjs.spanEvent.call(void 0, "http.client.response", {
|
|
201
201
|
...finish.spanAttributes,
|
|
202
202
|
...adaptiveAttrs
|
|
203
203
|
});
|
|
@@ -205,7 +205,7 @@ function withHttpObservability(options) {
|
|
|
205
205
|
}
|
|
206
206
|
const respLevel = resolved.logs === false ? false : (_nullishCoalesce(resolved.logs.responseLevel, () => ( false))) || (finish.outcome === "error" ? _nullishCoalesce(resolved.logs.errorLevel, () => ( "warn")) : false);
|
|
207
207
|
if (respLevel) {
|
|
208
|
-
const logEff =
|
|
208
|
+
const logEff = _chunkZJC3JZIEcjs.logEffect.call(void 0, respLevel, "http.client.response", {
|
|
209
209
|
...requestLogFields(req, resolved),
|
|
210
210
|
status: res.status,
|
|
211
211
|
statusText: res.statusText,
|
|
@@ -217,18 +217,18 @@ function withHttpObservability(options) {
|
|
|
217
217
|
cb({ _tag: "Success", value: res });
|
|
218
218
|
};
|
|
219
219
|
const onError = (error) => {
|
|
220
|
-
const status =
|
|
220
|
+
const status = _chunkUOKXJQAIcjs.httpErrorStatus.call(void 0, error);
|
|
221
221
|
const finish = completeFinish(
|
|
222
222
|
httpErrorOutcome(error),
|
|
223
223
|
status !== void 0 ? String(status) : void 0,
|
|
224
224
|
{
|
|
225
225
|
"error.type": error._tag,
|
|
226
|
-
"http.retryable":
|
|
226
|
+
"http.retryable": _chunkUOKXJQAIcjs.isRetryableHttpError.call(void 0, error)
|
|
227
227
|
}
|
|
228
228
|
);
|
|
229
229
|
const adaptiveAttrs = observeAdaptiveLimiter(wireReq, next, resolved);
|
|
230
230
|
if (shouldEmitHttpSpanEvents(resolved)) {
|
|
231
|
-
const ev =
|
|
231
|
+
const ev = _chunkZJC3JZIEcjs.spanEvent.call(void 0, "http.client.error", {
|
|
232
232
|
...finish.spanAttributes,
|
|
233
233
|
...adaptiveAttrs,
|
|
234
234
|
"error.type": error._tag
|
|
@@ -238,13 +238,13 @@ function withHttpObservability(options) {
|
|
|
238
238
|
const errLevel = resolved.logs === false ? false : _nullishCoalesce(resolved.logs.errorLevel, () => ( "error"));
|
|
239
239
|
if (errLevel) {
|
|
240
240
|
const statusText = httpErrorStatusText(error);
|
|
241
|
-
const logEff =
|
|
241
|
+
const logEff = _chunkZJC3JZIEcjs.logEffect.call(void 0, errLevel, "http.client.error", {
|
|
242
242
|
...requestLogFields(req, resolved),
|
|
243
243
|
outcome: finish.outcome,
|
|
244
244
|
durationMs: finish.durationMs,
|
|
245
245
|
...status !== void 0 ? { status } : {},
|
|
246
246
|
...statusText ? { statusText } : {},
|
|
247
|
-
retryable:
|
|
247
|
+
retryable: _chunkUOKXJQAIcjs.isRetryableHttpError.call(void 0, error),
|
|
248
248
|
errorTag: error._tag,
|
|
249
249
|
message: httpErrorMessage(error)
|
|
250
250
|
});
|
|
@@ -272,7 +272,7 @@ function withHttpObservability(options) {
|
|
|
272
272
|
};
|
|
273
273
|
});
|
|
274
274
|
if (resolved.spans === false) return run;
|
|
275
|
-
return
|
|
275
|
+
return _chunkZJC3JZIEcjs.withSpan.call(void 0, spanName(req, resolved.spans), run, spanStartAttributes(req, resolved));
|
|
276
276
|
};
|
|
277
277
|
};
|
|
278
278
|
}
|
|
@@ -312,7 +312,7 @@ function withLeanHttpSampledSpanObservability(next, options, metricCache) {
|
|
|
312
312
|
finishLeanHttpSpan(span, "success");
|
|
313
313
|
} else {
|
|
314
314
|
const error = httpErrorFromCause(exit.cause);
|
|
315
|
-
const status =
|
|
315
|
+
const status = _chunkUOKXJQAIcjs.httpErrorStatus.call(void 0, error);
|
|
316
316
|
recordHttpMetricsFinish(
|
|
317
317
|
handles,
|
|
318
318
|
httpErrorOutcome(error),
|
|
@@ -375,7 +375,7 @@ function withLeanHttpMetricsObservability(next, options, metricCache) {
|
|
|
375
375
|
);
|
|
376
376
|
} else {
|
|
377
377
|
const error = httpErrorFromCause(exit.cause);
|
|
378
|
-
const status =
|
|
378
|
+
const status = _chunkUOKXJQAIcjs.httpErrorStatus.call(void 0, error);
|
|
379
379
|
recordHttpMetricsFinish(
|
|
380
380
|
handles,
|
|
381
381
|
httpErrorOutcome(error),
|
|
@@ -465,7 +465,7 @@ function startLeanHttpSpan(req, options) {
|
|
|
465
465
|
if (configuredSampleRate <= 0) return void 0;
|
|
466
466
|
if (configuredSampleRate < 1 && Math.random() >= configuredSampleRate) return void 0;
|
|
467
467
|
}
|
|
468
|
-
const fiber =
|
|
468
|
+
const fiber = _chunkJKHBEWQAcjs.getCurrentFiber.call(void 0, );
|
|
469
469
|
const runtime = _optionalChain([fiber, 'optionalAccess', _16 => _16.runtime]);
|
|
470
470
|
const sink = _nullishCoalesce(options.spanSink, () => ( _optionalChain([runtime, 'optionalAccess', _17 => _17.hooks])));
|
|
471
471
|
if (!_optionalChain([fiber, 'optionalAccess', _18 => _18.fiberContext]) || !runtime || !sink) return void 0;
|
|
@@ -492,7 +492,7 @@ function startLeanHttpSpan(req, options) {
|
|
|
492
492
|
attributes = spanStartAttributes(req, options);
|
|
493
493
|
if (sampled === void 0) {
|
|
494
494
|
traceId = _nullishCoalesce(traceId, () => ( tracer.newTraceId()));
|
|
495
|
-
sampled =
|
|
495
|
+
sampled = _chunkZJC3JZIEcjs.shouldSampleWith.call(void 0, _optionalChain([brass, 'optionalAccess', _26 => _26.sampler]), {
|
|
496
496
|
traceId,
|
|
497
497
|
spanName: name,
|
|
498
498
|
parentSampled: _optionalChain([previousTrace, 'optionalAccess', _27 => _27.sampled]),
|
|
@@ -594,7 +594,7 @@ function getCachedBaseLabels(req, options, cache) {
|
|
|
594
594
|
if (cache.disabled) return requestBaseLabels(req, options);
|
|
595
595
|
const route = requestRoute(req, options);
|
|
596
596
|
const host = options.includeHostLabel ? requestHost(req) : void 0;
|
|
597
|
-
const policy =
|
|
597
|
+
const policy = _chunkUOKXJQAIcjs.getHttpRequestPolicy.call(void 0, req);
|
|
598
598
|
const preset = typeof policy === "string" ? policy : _optionalChain([policy, 'optionalAccess', _46 => _46.preset]);
|
|
599
599
|
const key = `${req.method}|${_nullishCoalesce(host, () => ( ""))}|${_nullishCoalesce(route, () => ( ""))}|${_nullishCoalesce(preset, () => ( ""))}`;
|
|
600
600
|
const existing = cache.baseLabelsCache.get(key);
|
|
@@ -727,7 +727,7 @@ function adaptiveLimiterLabels(req, stats, options) {
|
|
|
727
727
|
});
|
|
728
728
|
}
|
|
729
729
|
function inferAdaptiveLimiterKey(req, stats) {
|
|
730
|
-
const policy =
|
|
730
|
+
const policy = _chunkUOKXJQAIcjs.getHttpRequestPolicy.call(void 0, req);
|
|
731
731
|
if (policy.poolKey) return policy.poolKey;
|
|
732
732
|
const host = requestHost(req);
|
|
733
733
|
if (host) return host;
|
|
@@ -809,7 +809,7 @@ function requestLogFields(req, options) {
|
|
|
809
809
|
}
|
|
810
810
|
function requestPolicyLogFields(req, options) {
|
|
811
811
|
if (!options.policy.enabled) return void 0;
|
|
812
|
-
const policy =
|
|
812
|
+
const policy = _chunkUOKXJQAIcjs.getHttpRequestPolicy.call(void 0, req);
|
|
813
813
|
const fields = {
|
|
814
814
|
...policy.preset ? { preset: policy.preset } : {},
|
|
815
815
|
...policy.lane ? { lane: policy.lane } : {},
|
|
@@ -822,7 +822,7 @@ function requestPolicyLogFields(req, options) {
|
|
|
822
822
|
}
|
|
823
823
|
function requestPolicySpanAttributes(req, options) {
|
|
824
824
|
if (!options.policy.enabled) return {};
|
|
825
|
-
const policy =
|
|
825
|
+
const policy = _chunkUOKXJQAIcjs.getHttpRequestPolicy.call(void 0, req);
|
|
826
826
|
return {
|
|
827
827
|
...compactSpanAttributes({
|
|
828
828
|
"http.request.policy.lane": policy.lane,
|
|
@@ -836,7 +836,7 @@ function requestPolicySpanAttributes(req, options) {
|
|
|
836
836
|
}
|
|
837
837
|
function requestPolicyMetricLabels(req, options) {
|
|
838
838
|
if (!options.policy.enabled || options.policy.labelKeys.length === 0) return {};
|
|
839
|
-
const policy =
|
|
839
|
+
const policy = _chunkUOKXJQAIcjs.getHttpRequestPolicy.call(void 0, req);
|
|
840
840
|
const values = {
|
|
841
841
|
preset: policy.preset,
|
|
842
842
|
lane: policy.lane,
|
|
@@ -912,17 +912,17 @@ function httpErrorStatusText(error) {
|
|
|
912
912
|
return error._tag === "FetchError" ? error.statusText : void 0;
|
|
913
913
|
}
|
|
914
914
|
function injectCurrentTraceContext(req) {
|
|
915
|
-
const fiber =
|
|
915
|
+
const fiber = _chunkJKHBEWQAcjs.getCurrentFiber.call(void 0, );
|
|
916
916
|
const trace = _optionalChain([fiber, 'optionalAccess', _62 => _62.fiberContext, 'optionalAccess', _63 => _63.trace]);
|
|
917
917
|
if (!_optionalChain([trace, 'optionalAccess', _64 => _64.traceId]) || !_optionalChain([trace, 'optionalAccess', _65 => _65.spanId])) return req;
|
|
918
918
|
return {
|
|
919
919
|
...req,
|
|
920
|
-
headers:
|
|
920
|
+
headers: _chunkZJC3JZIEcjs.injectTraceContext.call(void 0, req.headers, trace)
|
|
921
921
|
};
|
|
922
922
|
}
|
|
923
923
|
function currentTraceExemplar(value, timestamp) {
|
|
924
|
-
const fiber =
|
|
925
|
-
return
|
|
924
|
+
const fiber = _chunkJKHBEWQAcjs.getCurrentFiber.call(void 0, );
|
|
925
|
+
return _chunkZJC3JZIEcjs.exemplarFromTraceContext.call(void 0, _optionalChain([fiber, 'optionalAccess', _66 => _66.fiberContext, 'optionalAccess', _67 => _67.trace]), value, timestamp);
|
|
926
926
|
}
|
|
927
927
|
function requestHost(req) {
|
|
928
928
|
if (!isAbsoluteUrl(req.url)) return void 0;
|
|
@@ -990,38 +990,38 @@ function compactLabels(labels) {
|
|
|
990
990
|
|
|
991
991
|
// src/observability/adapters.ts
|
|
992
992
|
function makeFetchRequestObservabilityContext(observability, request, input = {}) {
|
|
993
|
-
return
|
|
993
|
+
return _chunkZJC3JZIEcjs.makeRequestObservabilityContext.call(void 0, observability, {
|
|
994
994
|
headers: request.headers,
|
|
995
995
|
method: request.method,
|
|
996
|
-
target:
|
|
997
|
-
route: _nullishCoalesce(input.route, () => (
|
|
996
|
+
target: _chunkZJC3JZIEcjs.sanitizeHttpTarget.call(void 0, request.url),
|
|
997
|
+
route: _nullishCoalesce(input.route, () => ( _chunkZJC3JZIEcjs.normalizeHttpRoute.call(void 0, urlPathname(request.url)))),
|
|
998
998
|
...input
|
|
999
999
|
});
|
|
1000
1000
|
}
|
|
1001
1001
|
function makeNodeRequestObservabilityContext(observability, request, input = {}) {
|
|
1002
|
-
return
|
|
1002
|
+
return _chunkZJC3JZIEcjs.makeRequestObservabilityContext.call(void 0, observability, {
|
|
1003
1003
|
headers: request.headers,
|
|
1004
1004
|
method: request.method,
|
|
1005
|
-
target:
|
|
1006
|
-
route: _nullishCoalesce(input.route, () => (
|
|
1005
|
+
target: _chunkZJC3JZIEcjs.sanitizeHttpTarget.call(void 0, request.url),
|
|
1006
|
+
route: _nullishCoalesce(input.route, () => ( _chunkZJC3JZIEcjs.normalizeHttpRoute.call(void 0, request.url))),
|
|
1007
1007
|
...input
|
|
1008
1008
|
});
|
|
1009
1009
|
}
|
|
1010
1010
|
function makeExpressRequestObservabilityContext(observability, request, input = {}) {
|
|
1011
|
-
return
|
|
1011
|
+
return _chunkZJC3JZIEcjs.makeRequestObservabilityContext.call(void 0, observability, {
|
|
1012
1012
|
headers: request.headers,
|
|
1013
1013
|
method: request.method,
|
|
1014
|
-
target:
|
|
1015
|
-
route: _nullishCoalesce(_nullishCoalesce(input.route, () => ( _optionalChain([request, 'access', _68 => _68.route, 'optionalAccess', _69 => _69.path]))), () => (
|
|
1014
|
+
target: _chunkZJC3JZIEcjs.sanitizeHttpTarget.call(void 0, _nullishCoalesce(request.originalUrl, () => ( request.url))),
|
|
1015
|
+
route: _nullishCoalesce(_nullishCoalesce(input.route, () => ( _optionalChain([request, 'access', _68 => _68.route, 'optionalAccess', _69 => _69.path]))), () => ( _chunkZJC3JZIEcjs.normalizeHttpRoute.call(void 0, _nullishCoalesce(request.path, () => ( request.url))))),
|
|
1016
1016
|
...input
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
1019
|
function makeFastifyRequestObservabilityContext(observability, request, input = {}) {
|
|
1020
|
-
return
|
|
1020
|
+
return _chunkZJC3JZIEcjs.makeRequestObservabilityContext.call(void 0, observability, {
|
|
1021
1021
|
headers: request.headers,
|
|
1022
1022
|
method: request.method,
|
|
1023
|
-
target:
|
|
1024
|
-
route: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(input.route, () => ( _optionalChain([request, 'access', _70 => _70.routeOptions, 'optionalAccess', _71 => _71.url]))), () => ( request.routerPath)), () => (
|
|
1023
|
+
target: _chunkZJC3JZIEcjs.sanitizeHttpTarget.call(void 0, request.url),
|
|
1024
|
+
route: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(input.route, () => ( _optionalChain([request, 'access', _70 => _70.routeOptions, 'optionalAccess', _71 => _71.url]))), () => ( request.routerPath)), () => ( _chunkZJC3JZIEcjs.normalizeHttpRoute.call(void 0, request.url))),
|
|
1025
1025
|
...input
|
|
1026
1026
|
});
|
|
1027
1027
|
}
|
|
@@ -1042,7 +1042,7 @@ function urlPathname(url) {
|
|
|
1042
1042
|
|
|
1043
1043
|
// src/observability/config.ts
|
|
1044
1044
|
function makeNoopObservability() {
|
|
1045
|
-
return
|
|
1045
|
+
return _chunkZJC3JZIEcjs.makeObservability.call(void 0, {
|
|
1046
1046
|
metrics: false,
|
|
1047
1047
|
logs: false,
|
|
1048
1048
|
traces: false,
|
|
@@ -1051,12 +1051,12 @@ function makeNoopObservability() {
|
|
|
1051
1051
|
}
|
|
1052
1052
|
function makeObservabilityPreset(preset, overrides = {}) {
|
|
1053
1053
|
if (preset === "disabled") return makeNoopObservability();
|
|
1054
|
-
return
|
|
1054
|
+
return _chunkZJC3JZIEcjs.makeObservability.call(void 0, mergeObservabilityOptions(observabilityOptionsForPreset(preset), overrides));
|
|
1055
1055
|
}
|
|
1056
1056
|
function makeObservabilityFromEnv(env = readProcessEnv(), overrides = {}) {
|
|
1057
1057
|
const preset = env.BRASS_OBSERVABILITY === "disabled" ? "disabled" : parsePreset(_nullishCoalesce(env.BRASS_OBSERVABILITY_PRESET, () => ( env.NODE_ENV)));
|
|
1058
1058
|
if (preset === "disabled") return makeNoopObservability();
|
|
1059
|
-
return
|
|
1059
|
+
return _chunkZJC3JZIEcjs.makeObservability.call(void 0, mergeObservabilityOptions(observabilityOptionsFromEnv(env, preset), overrides));
|
|
1060
1060
|
}
|
|
1061
1061
|
function observabilityOptionsForPreset(preset) {
|
|
1062
1062
|
switch (preset) {
|
|
@@ -1187,27 +1187,27 @@ function readProcessEnv() {
|
|
|
1187
1187
|
}
|
|
1188
1188
|
|
|
1189
1189
|
// src/observability/layer.ts
|
|
1190
|
-
var ObservabilityService =
|
|
1190
|
+
var ObservabilityService = _chunkZZ2CMYJLcjs.makeServiceTag.call(void 0, "Observability");
|
|
1191
1191
|
function makeObservabilityLayer(config = {}, options = {}) {
|
|
1192
1192
|
const tag = _nullishCoalesce(options.tag, () => ( ObservabilityService));
|
|
1193
|
-
return
|
|
1193
|
+
return _chunkZZ2CMYJLcjs.layerEffect.call(void 0,
|
|
1194
1194
|
tag,
|
|
1195
|
-
(context) => _chunkMVGUEJ5Zcjs.asyncSync.call(void 0, () =>
|
|
1195
|
+
(context) => _chunkMVGUEJ5Zcjs.asyncSync.call(void 0, () => _chunkZJC3JZIEcjs.makeObservability.call(void 0, resolveObservabilityLayerConfig(config, context))),
|
|
1196
1196
|
shutdownObservability
|
|
1197
1197
|
);
|
|
1198
1198
|
}
|
|
1199
1199
|
function makeObservedRuntimeLayer(options = {}) {
|
|
1200
1200
|
const {
|
|
1201
1201
|
observabilityTag = ObservabilityService,
|
|
1202
|
-
runtimeTag =
|
|
1202
|
+
runtimeTag = _chunkENMKEX3Ncjs.RuntimeService,
|
|
1203
1203
|
env = {},
|
|
1204
1204
|
...runtimeOptions
|
|
1205
1205
|
} = options;
|
|
1206
|
-
return
|
|
1206
|
+
return _chunkZZ2CMYJLcjs.layerEffect.call(void 0,
|
|
1207
1207
|
runtimeTag,
|
|
1208
1208
|
(context) => _chunkMVGUEJ5Zcjs.asyncSync.call(void 0, () => {
|
|
1209
1209
|
const observability = context.unsafeGet(observabilityTag);
|
|
1210
|
-
return new (0,
|
|
1210
|
+
return new (0, _chunkJKHBEWQAcjs.Runtime)({
|
|
1211
1211
|
...runtimeOptions,
|
|
1212
1212
|
env: mergeRuntimeEnv(resolveObservedRuntimeLayerEnv(env, context, observability), observability.env),
|
|
1213
1213
|
hooks: observability.hooks
|
|
@@ -1217,8 +1217,8 @@ function makeObservedRuntimeLayer(options = {}) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
function makeObservedHttpClientLayer(config = {}, options = {}) {
|
|
1219
1219
|
const observabilityTag = _nullishCoalesce(options.observabilityTag, () => ( ObservabilityService));
|
|
1220
|
-
const httpTag = _nullishCoalesce(options.httpTag, () => (
|
|
1221
|
-
return
|
|
1220
|
+
const httpTag = _nullishCoalesce(options.httpTag, () => ( _chunkUOKXJQAIcjs.HttpClientService));
|
|
1221
|
+
return _chunkZZ2CMYJLcjs.layerEffect.call(void 0,
|
|
1222
1222
|
httpTag,
|
|
1223
1223
|
(context) => _chunkMVGUEJ5Zcjs.asyncSync.call(void 0, () => {
|
|
1224
1224
|
const observability = context.unsafeGet(observabilityTag);
|
|
@@ -1228,7 +1228,7 @@ function makeObservedHttpClientLayer(config = {}, options = {}) {
|
|
|
1228
1228
|
context,
|
|
1229
1229
|
observability
|
|
1230
1230
|
);
|
|
1231
|
-
return
|
|
1231
|
+
return _chunkUOKXJQAIcjs.makeDefaultHttpClient.call(void 0, {
|
|
1232
1232
|
...httpConfig,
|
|
1233
1233
|
middleware: [
|
|
1234
1234
|
..._nullishCoalesce(httpConfig.middleware, () => ( [])),
|
|
@@ -1258,7 +1258,7 @@ function mergeRuntimeEnv(env, observabilityEnv) {
|
|
|
1258
1258
|
return Object.assign({}, env, observabilityEnv);
|
|
1259
1259
|
}
|
|
1260
1260
|
function shutdownObservability(observability) {
|
|
1261
|
-
return
|
|
1261
|
+
return _chunkJKHBEWQAcjs.fromPromiseAbortable.call(void 0,
|
|
1262
1262
|
() => observability.shutdown().then(() => void 0),
|
|
1263
1263
|
() => void 0,
|
|
1264
1264
|
{ label: "observability.shutdown" }
|