bitfab 0.52.6 → 0.53.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.
@@ -5,7 +5,7 @@ import {
5
5
  replayContextReady,
6
6
  runWithReplayContext,
7
7
  warnOnce
8
- } from "./chunk-NXC6NYIY.js";
8
+ } from "./chunk-6IMGAODW.js";
9
9
 
10
10
  // src/gitCommand.ts
11
11
  var EXIT_GRACE_MS = 500;
@@ -1303,4 +1303,4 @@ export {
1303
1303
  sleepForReplayPersistence,
1304
1304
  replay
1305
1305
  };
1306
- //# sourceMappingURL=chunk-DRTHTSHO.js.map
1306
+ //# sourceMappingURL=chunk-SJKWUQ3G.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-GJKU7VWG.js";
9
+ } from "./chunk-CBRO6BP7.js";
10
10
  export {
11
11
  BitfabError,
12
12
  HttpClient,
@@ -16,4 +16,4 @@ export {
16
16
  parseRetryAfterMs,
17
17
  serializePayloadBody
18
18
  };
19
- //# sourceMappingURL=http-ER2NMEKI.js.map
19
+ //# sourceMappingURL=http-KP7DVTOD.js.map
@@ -6,7 +6,7 @@ import {
6
6
  flushTraces,
7
7
  parseRetryAfterMs,
8
8
  serializePayloadBody
9
- } from "./chunk-NXC6NYIY.js";
9
+ } from "./chunk-6IMGAODW.js";
10
10
  import "./chunk-H6LZRFMN.js";
11
11
  export {
12
12
  BitfabError,
@@ -17,4 +17,4 @@ export {
17
17
  parseRetryAfterMs,
18
18
  serializePayloadBody
19
19
  };
20
- //# sourceMappingURL=http-MGES3ZVX.js.map
20
+ //# sourceMappingURL=http-SEN3PUXX.js.map
package/dist/index.cjs CHANGED
@@ -51,7 +51,7 @@ var __version__, __packageName__;
51
51
  var init_version_generated = __esm({
52
52
  "src/version.generated.ts"() {
53
53
  "use strict";
54
- __version__ = "0.52.6";
54
+ __version__ = "0.53.0";
55
55
  __packageName__ = "bitfab";
56
56
  }
57
57
  });
@@ -6887,6 +6887,26 @@ var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
6887
6887
  var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
6888
6888
  var AUTO_TRACE_POLICY_REFRESH_MS = 6e4;
6889
6889
  var AUTO_TRACE_POLICY_RETRY_MS = 1e4;
6890
+ function spanOwnerName(receiver) {
6891
+ if (typeof receiver === "function") {
6892
+ return receiver.name !== "" ? receiver.name : void 0;
6893
+ }
6894
+ if (typeof receiver !== "object" || receiver === null) {
6895
+ return void 0;
6896
+ }
6897
+ const owner = receiver.constructor;
6898
+ if (typeof owner !== "function" || owner === Object || owner.name === "") {
6899
+ return void 0;
6900
+ }
6901
+ return owner.name;
6902
+ }
6903
+ function qualifiedSpanName(receiver, functionName) {
6904
+ if (functionName === void 0) {
6905
+ return void 0;
6906
+ }
6907
+ const owner = spanOwnerName(receiver);
6908
+ return owner === void 0 ? functionName : `${owner}.${functionName}`;
6909
+ }
6890
6910
  function autoTraceLimit(value, fallback) {
6891
6911
  return value !== void 0 && Number.isFinite(value) && value >= 0 ? Math.floor(value) : fallback;
6892
6912
  }
@@ -7089,12 +7109,13 @@ var Bitfab = class {
7089
7109
  );
7090
7110
  const excluded = new Set(options.exclude ?? []);
7091
7111
  const includeWrappers = options.includeWrappers ?? false;
7112
+ const rootNameFor = (receiver) => options.name ?? (fn.name !== "" ? qualifiedSpanName(receiver, name) ?? name : name);
7092
7113
  const rootOptions = {
7093
- name: options.name ?? name,
7114
+ name: options.name,
7115
+ nameFor: rootNameFor,
7094
7116
  type: options.type ?? "custom",
7095
7117
  surface: "opt-out"
7096
7118
  };
7097
- const rootName = options.name ?? name;
7098
7119
  const buildTracedRoot = (spanOptions) => this.withSpan(
7099
7120
  traceFunctionKey,
7100
7121
  spanOptions,
@@ -7234,6 +7255,7 @@ var Bitfab = class {
7234
7255
  return tracedRoot.apply(this, args);
7235
7256
  }
7236
7257
  const link = getReplayContext() || inSeedScope() ? void 0 : { traceFunctionKey };
7258
+ const rootName = rootNameFor(this);
7237
7259
  return invokeThroughAutoTraceEntries(
7238
7260
  enclosing,
7239
7261
  (entry, next) => entry.context.invokeNestedRoot(
@@ -7900,7 +7922,7 @@ var Bitfab = class {
7900
7922
  const baseSpanParams = {
7901
7923
  traceFunctionKey,
7902
7924
  functionName,
7903
- spanName: options.name ?? functionName ?? traceFunctionKey,
7925
+ spanName: options.name ?? options.nameFor?.(this) ?? qualifiedSpanName(this, functionName) ?? traceFunctionKey,
7904
7926
  traceId,
7905
7927
  spanId,
7906
7928
  parentSpanId,