@bitfab/sdk 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.
package/dist/index.d.cts CHANGED
@@ -3326,7 +3326,7 @@ interface CommitRef {
3326
3326
  /**
3327
3327
  * SDK version from package.json (injected at build time)
3328
3328
  */
3329
- declare const __version__ = "0.52.6";
3329
+ declare const __version__ = "0.53.0";
3330
3330
 
3331
3331
  /**
3332
3332
  * Constants for the Bitfab SDK.
package/dist/index.d.ts CHANGED
@@ -3326,7 +3326,7 @@ interface CommitRef {
3326
3326
  /**
3327
3327
  * SDK version from package.json (injected at build time)
3328
3328
  */
3329
- declare const __version__ = "0.52.6";
3329
+ declare const __version__ = "0.53.0";
3330
3330
 
3331
3331
  /**
3332
3332
  * Constants for the Bitfab SDK.
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  getCurrentTrace,
20
20
  reseedFromRegistry,
21
21
  seedFromRegistry
22
- } from "./chunk-3TL4SATS.js";
22
+ } from "./chunk-3IKQHUGK.js";
23
23
  import "./chunk-E5BLYL5X.js";
24
24
  import {
25
25
  BITFAB_PROGRESS_PREFIX,
@@ -28,7 +28,7 @@ import {
28
28
  ReplayError,
29
29
  reportReplayProgress,
30
30
  serializeReplayResult
31
- } from "./chunk-WYC4QRK3.js";
31
+ } from "./chunk-KSKRPIY6.js";
32
32
  import {
33
33
  BitfabError,
34
34
  DEFAULT_SERVICE_URL,
@@ -36,7 +36,7 @@ import {
36
36
  MixedTracingError,
37
37
  __version__,
38
38
  flushTraces
39
- } from "./chunk-7KIRLN47.js";
39
+ } from "./chunk-WIBQUZPU.js";
40
40
  import "./chunk-H6LZRFMN.js";
41
41
  export {
42
42
  BITFAB_PROGRESS_PREFIX,
package/dist/node.cjs CHANGED
@@ -88,7 +88,7 @@ var __version__, __packageName__;
88
88
  var init_version_generated = __esm({
89
89
  "src/version.generated.ts"() {
90
90
  "use strict";
91
- __version__ = "0.52.6";
91
+ __version__ = "0.53.0";
92
92
  __packageName__ = "@bitfab/sdk";
93
93
  }
94
94
  });
@@ -6892,6 +6892,26 @@ var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
6892
6892
  var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
6893
6893
  var AUTO_TRACE_POLICY_REFRESH_MS = 6e4;
6894
6894
  var AUTO_TRACE_POLICY_RETRY_MS = 1e4;
6895
+ function spanOwnerName(receiver) {
6896
+ if (typeof receiver === "function") {
6897
+ return receiver.name !== "" ? receiver.name : void 0;
6898
+ }
6899
+ if (typeof receiver !== "object" || receiver === null) {
6900
+ return void 0;
6901
+ }
6902
+ const owner = receiver.constructor;
6903
+ if (typeof owner !== "function" || owner === Object || owner.name === "") {
6904
+ return void 0;
6905
+ }
6906
+ return owner.name;
6907
+ }
6908
+ function qualifiedSpanName(receiver, functionName) {
6909
+ if (functionName === void 0) {
6910
+ return void 0;
6911
+ }
6912
+ const owner = spanOwnerName(receiver);
6913
+ return owner === void 0 ? functionName : `${owner}.${functionName}`;
6914
+ }
6895
6915
  function autoTraceLimit(value, fallback) {
6896
6916
  return value !== void 0 && Number.isFinite(value) && value >= 0 ? Math.floor(value) : fallback;
6897
6917
  }
@@ -7094,12 +7114,13 @@ var Bitfab = class {
7094
7114
  );
7095
7115
  const excluded = new Set(options.exclude ?? []);
7096
7116
  const includeWrappers = options.includeWrappers ?? false;
7117
+ const rootNameFor = (receiver) => options.name ?? (fn.name !== "" ? qualifiedSpanName(receiver, name) ?? name : name);
7097
7118
  const rootOptions = {
7098
- name: options.name ?? name,
7119
+ name: options.name,
7120
+ nameFor: rootNameFor,
7099
7121
  type: options.type ?? "custom",
7100
7122
  surface: "opt-out"
7101
7123
  };
7102
- const rootName = options.name ?? name;
7103
7124
  const buildTracedRoot = (spanOptions) => this.withSpan(
7104
7125
  traceFunctionKey,
7105
7126
  spanOptions,
@@ -7239,6 +7260,7 @@ var Bitfab = class {
7239
7260
  return tracedRoot.apply(this, args);
7240
7261
  }
7241
7262
  const link = getReplayContext() || inSeedScope() ? void 0 : { traceFunctionKey };
7263
+ const rootName = rootNameFor(this);
7242
7264
  return invokeThroughAutoTraceEntries(
7243
7265
  enclosing,
7244
7266
  (entry, next) => entry.context.invokeNestedRoot(
@@ -7905,7 +7927,7 @@ var Bitfab = class {
7905
7927
  const baseSpanParams = {
7906
7928
  traceFunctionKey,
7907
7929
  functionName,
7908
- spanName: options.name ?? functionName ?? traceFunctionKey,
7930
+ spanName: options.name ?? options.nameFor?.(this) ?? qualifiedSpanName(this, functionName) ?? traceFunctionKey,
7909
7931
  traceId,
7910
7932
  spanId,
7911
7933
  parentSpanId,