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.
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
@@ -28,7 +28,7 @@ import {
28
28
  getCurrentTrace,
29
29
  reseedFromRegistry,
30
30
  seedFromRegistry
31
- } from "./chunk-P26KVTI5.js";
31
+ } from "./chunk-SCXR43UF.js";
32
32
  import "./chunk-E5BLYL5X.js";
33
33
  import {
34
34
  BITFAB_PROGRESS_PREFIX,
@@ -37,7 +37,7 @@ import {
37
37
  ReplayError,
38
38
  reportReplayProgress,
39
39
  serializeReplayResult
40
- } from "./chunk-DRTHTSHO.js";
40
+ } from "./chunk-SJKWUQ3G.js";
41
41
  import {
42
42
  BitfabError,
43
43
  DEFAULT_SERVICE_URL,
@@ -45,7 +45,7 @@ import {
45
45
  MixedTracingError,
46
46
  __version__,
47
47
  flushTraces
48
- } from "./chunk-NXC6NYIY.js";
48
+ } from "./chunk-6IMGAODW.js";
49
49
  import "./chunk-H6LZRFMN.js";
50
50
  export {
51
51
  BITFAB_PROGRESS_PREFIX,
package/dist/node.cjs CHANGED
@@ -97,7 +97,7 @@ var __version__, __packageName__;
97
97
  var init_version_generated = __esm({
98
98
  "src/version.generated.ts"() {
99
99
  "use strict";
100
- __version__ = "0.52.6";
100
+ __version__ = "0.53.0";
101
101
  __packageName__ = "bitfab";
102
102
  }
103
103
  });
@@ -6901,6 +6901,26 @@ var DEFAULT_AUTO_TRACE_MAX_SPANS = 500;
6901
6901
  var AUTO_TRACE_PROTOCOL = "ts-auto-v1";
6902
6902
  var AUTO_TRACE_POLICY_REFRESH_MS = 6e4;
6903
6903
  var AUTO_TRACE_POLICY_RETRY_MS = 1e4;
6904
+ function spanOwnerName(receiver) {
6905
+ if (typeof receiver === "function") {
6906
+ return receiver.name !== "" ? receiver.name : void 0;
6907
+ }
6908
+ if (typeof receiver !== "object" || receiver === null) {
6909
+ return void 0;
6910
+ }
6911
+ const owner = receiver.constructor;
6912
+ if (typeof owner !== "function" || owner === Object || owner.name === "") {
6913
+ return void 0;
6914
+ }
6915
+ return owner.name;
6916
+ }
6917
+ function qualifiedSpanName(receiver, functionName) {
6918
+ if (functionName === void 0) {
6919
+ return void 0;
6920
+ }
6921
+ const owner = spanOwnerName(receiver);
6922
+ return owner === void 0 ? functionName : `${owner}.${functionName}`;
6923
+ }
6904
6924
  function autoTraceLimit(value, fallback) {
6905
6925
  return value !== void 0 && Number.isFinite(value) && value >= 0 ? Math.floor(value) : fallback;
6906
6926
  }
@@ -7103,12 +7123,13 @@ var Bitfab = class {
7103
7123
  );
7104
7124
  const excluded = new Set(options.exclude ?? []);
7105
7125
  const includeWrappers = options.includeWrappers ?? false;
7126
+ const rootNameFor = (receiver) => options.name ?? (fn.name !== "" ? qualifiedSpanName(receiver, name) ?? name : name);
7106
7127
  const rootOptions = {
7107
- name: options.name ?? name,
7128
+ name: options.name,
7129
+ nameFor: rootNameFor,
7108
7130
  type: options.type ?? "custom",
7109
7131
  surface: "opt-out"
7110
7132
  };
7111
- const rootName = options.name ?? name;
7112
7133
  const buildTracedRoot = (spanOptions) => this.withSpan(
7113
7134
  traceFunctionKey,
7114
7135
  spanOptions,
@@ -7248,6 +7269,7 @@ var Bitfab = class {
7248
7269
  return tracedRoot.apply(this, args);
7249
7270
  }
7250
7271
  const link = getReplayContext() || inSeedScope() ? void 0 : { traceFunctionKey };
7272
+ const rootName = rootNameFor(this);
7251
7273
  return invokeThroughAutoTraceEntries(
7252
7274
  enclosing,
7253
7275
  (entry, next) => entry.context.invokeNestedRoot(
@@ -7914,7 +7936,7 @@ var Bitfab = class {
7914
7936
  const baseSpanParams = {
7915
7937
  traceFunctionKey,
7916
7938
  functionName,
7917
- spanName: options.name ?? functionName ?? traceFunctionKey,
7939
+ spanName: options.name ?? options.nameFor?.(this) ?? qualifiedSpanName(this, functionName) ?? traceFunctionKey,
7918
7940
  traceId,
7919
7941
  spanId,
7920
7942
  parentSpanId,