bitfab 0.57.8 → 0.58.0

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.
@@ -6,7 +6,7 @@ import {
6
6
  replayContextReady,
7
7
  runWithReplayContext,
8
8
  warnOnce
9
- } from "./chunk-HKRCT4OE.js";
9
+ } from "./chunk-D6WGJZWM.js";
10
10
  import {
11
11
  runWithCaptureSuppressed
12
12
  } from "./chunk-VCRFFCLY.js";
@@ -1263,4 +1263,4 @@ export {
1263
1263
  sleepForReplayPersistence,
1264
1264
  replay
1265
1265
  };
1266
- //# sourceMappingURL=chunk-CPVOJHEH.js.map
1266
+ //# sourceMappingURL=chunk-3GFX56CU.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BitfabError
3
- } from "./chunk-GUE4W5QV.js";
3
+ } from "./chunk-SKOFROXF.js";
4
4
 
5
5
  // src/codeChange.ts
6
6
  var NUL = String.fromCharCode(0);
@@ -234,7 +234,7 @@ async function seedFromRegistry(registry, pipeline, cases, options = {}) {
234
234
  sessionId: seedCase.sessionId
235
235
  })
236
236
  );
237
- const { flushTraces: flushTraces2 } = await import("./http-PDTDCLCH.js");
237
+ const { flushTraces: flushTraces2 } = await import("./http-QLUKFCM5.js");
238
238
  await flushTraces2(3e4);
239
239
  return { pipeline, traceFunctionKey, traceIds };
240
240
  }
@@ -782,4 +782,4 @@ export {
782
782
  runRegistryMain,
783
783
  runIfEntrypoint
784
784
  };
785
- //# sourceMappingURL=chunk-SSEXCJHP.js.map
785
+ //# sourceMappingURL=chunk-BU5DXLSB.js.map
@@ -187,7 +187,7 @@ function encodeRequestBody(body) {
187
187
  }
188
188
 
189
189
  // src/version.generated.ts
190
- var __version__ = "0.57.8";
190
+ var __version__ = "0.58.0";
191
191
  var __packageName__ = "bitfab";
192
192
 
193
193
  // src/constants.ts
@@ -787,6 +787,7 @@ var SIMULATION_PLAN_READ_TIMEOUT_MS = 5e3;
787
787
  var SIMULATION_PLAN_MAX_HELD = 1e3;
788
788
  var DISABLE_SIMULATION_PLAN_ENV = "BITFAB_DISABLE_SIM_PLAN";
789
789
  var ROOT_TRACE_FUNCTION_KEY_FIELD = "rootTraceFunctionKey";
790
+ var DECLARED_NODE_FIELD = "declaredNode";
790
791
  var CONTENT_OFF_KEY = "content_off_by_simulation_plan";
791
792
  var CONTENT_KEYS = [
792
793
  "input",
@@ -870,6 +871,13 @@ function isTraceRootSpan(payload) {
870
871
  const parentId = rawSpanOf(payload)?.parent_id;
871
872
  return parentId === void 0 || parentId === null;
872
873
  }
874
+ function declaredInCode(payload) {
875
+ return payload[DECLARED_NODE_FIELD] === true;
876
+ }
877
+ function recordedError(payload) {
878
+ const error = spanDataOf(payload)?.error;
879
+ return error !== void 0 && error !== null;
880
+ }
873
881
  var SimulationPlan = class {
874
882
  constructor(source, enabled = true) {
875
883
  this.source = source;
@@ -1033,7 +1041,7 @@ var SimulationPlan = class {
1033
1041
  }
1034
1042
  }
1035
1043
  payloadToSend(entry) {
1036
- if (entry.traceFunctionKey === void 0) {
1044
+ if (entry.traceFunctionKey === void 0 || declaredInCode(entry.payload)) {
1037
1045
  return entry.payload;
1038
1046
  }
1039
1047
  if (this.contentOffByKey !== void 0) {
@@ -1045,6 +1053,10 @@ var SimulationPlan = class {
1045
1053
  return stripContent(entry.payload);
1046
1054
  }
1047
1055
  submitEntry(entry) {
1056
+ if (entry.traceFunctionKey !== void 0 && this.skipsSpan(entry.payload, entry.traceFunctionKey)) {
1057
+ entry.drop?.();
1058
+ return;
1059
+ }
1048
1060
  try {
1049
1061
  entry.submit(this.payloadToSend(entry));
1050
1062
  } catch (error) {
@@ -1107,8 +1119,12 @@ var SimulationPlan = class {
1107
1119
  contentOffNow(traceFunctionKey, spanName) {
1108
1120
  return !this.stopped && !this.disabled() && this.contentOff(traceFunctionKey, spanName);
1109
1121
  }
1122
+ skipsSpan(payload, traceFunctionKey) {
1123
+ const name = spanNameOf(payload);
1124
+ return name !== void 0 && this.contentOff(traceFunctionKey, name) && !isTraceRootSpan(payload) && !declaredInCode(payload) && spanInstrumentationOf(payload) !== void 0 && !recordedByFramework(payload) && !recordedError(payload);
1125
+ }
1110
1126
  apply(payload, traceFunctionKey) {
1111
- if (recordedByFramework(payload)) {
1127
+ if (recordedByFramework(payload) || declaredInCode(payload)) {
1112
1128
  return payload;
1113
1129
  }
1114
1130
  const name = spanNameOf(payload);
@@ -2327,7 +2343,6 @@ var HttpClient = class {
2327
2343
  this.closed = true;
2328
2344
  this.externalSpanTransform = void 0;
2329
2345
  this.externalTraceTransform = void 0;
2330
- this.frameworkSpanStart = void 0;
2331
2346
  this.releaseHeldExternalSpans = void 0;
2332
2347
  this.stopSimulationPlan = void 0;
2333
2348
  const transport = this.traceTransport;
@@ -2510,16 +2525,6 @@ var HttpClient = class {
2510
2525
  carrierMeta("internal_trace", body, void 0)
2511
2526
  );
2512
2527
  }
2513
- reserveFrameworkSpan(traceId, spanId, parentSpanId) {
2514
- try {
2515
- this.frameworkSpanStart?.(traceId, spanId, parentSpanId ?? null);
2516
- } catch (error) {
2517
- warnOnce(
2518
- "framework-span-reservation-failed",
2519
- `a framework span could not be counted toward its trace's span limit: ${describeError(error)}`
2520
- );
2521
- }
2522
- }
2523
2528
  sendExternalSpan(payload) {
2524
2529
  const ref = carrierRef(payload);
2525
2530
  if (ref?.spanId !== void 0) {
@@ -2548,6 +2553,7 @@ var HttpClient = class {
2548
2553
  sdkVersion: __version__
2549
2554
  };
2550
2555
  delete body[ROOT_TRACE_FUNCTION_KEY_FIELD];
2556
+ delete body[DECLARED_NODE_FIELD];
2551
2557
  this.getTraceTransport()?.submit(
2552
2558
  "external_span",
2553
2559
  body,
@@ -2843,10 +2849,9 @@ export {
2843
2849
  serializePayloadBody,
2844
2850
  isFrameworkInstrumentation,
2845
2851
  makeSpanOrigin,
2846
- recordedByFramework,
2847
2852
  ROOT_TRACE_FUNCTION_KEY_FIELD,
2853
+ DECLARED_NODE_FIELD,
2848
2854
  CONTENT_OFF_KEY,
2849
- traceIdOf,
2850
2855
  SimulationPlan,
2851
2856
  recordCallerTraceMetadata,
2852
2857
  callerTraceMetadata,
@@ -2857,4 +2862,4 @@ export {
2857
2862
  parseRetryAfterMs,
2858
2863
  HttpClient
2859
2864
  };
2860
- //# sourceMappingURL=chunk-HKRCT4OE.js.map
2865
+ //# sourceMappingURL=chunk-D6WGJZWM.js.map