@mastra/observability 1.22.0-alpha.3 → 1.22.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.cjs CHANGED
@@ -3324,6 +3324,11 @@ var BaseSpan = class BaseSpan {
3324
3324
  parentSpanId;
3325
3325
  /** Parent from an external tracing system (ambient OTel / dd-trace span) that Mastra did not create; carried for external correlation, not part of Mastra's own parent/child linkage */
3326
3326
  externalParentSpanId;
3327
+ /** Native span fields (see `SpanData`); carried as supplied and exported only when set */
3328
+ resumedFromSpanId;
3329
+ outcome;
3330
+ stopReason;
3331
+ stopReasonContext;
3327
3332
  /** Deep clean options for serialization */
3328
3333
  deepCleanOptions;
3329
3334
  /**
@@ -3390,6 +3395,10 @@ var BaseSpan = class BaseSpan {
3390
3395
  }
3391
3396
  this.tags = !options.parent && options.tags?.length ? options.tags : void 0;
3392
3397
  this.links = validLinks(options.links);
3398
+ this.resumedFromSpanId = options.resumedFromSpanId;
3399
+ this.outcome = options.outcome;
3400
+ this.stopReason = options.stopReason;
3401
+ this.stopReasonContext = deepClean(options.stopReasonContext, this.deepCleanOptions);
3393
3402
  const entityParent = this.getParentSpan(false);
3394
3403
  this.entityType = options.entityType ?? entityParent?.entityType;
3395
3404
  this.entityId = options.entityId ?? entityParent?.entityId;
@@ -3658,6 +3667,10 @@ var BaseSpan = class BaseSpan {
3658
3667
  ...definedLineage(correlation),
3659
3668
  parentSpanId: this.getParentSpanId(includeInternalSpans),
3660
3669
  externalParentSpanId: this.getExportedExternalParentSpanId(includeInternalSpans),
3670
+ ...this.resumedFromSpanId !== void 0 ? { resumedFromSpanId: this.resumedFromSpanId } : {},
3671
+ ...this.outcome !== void 0 ? { outcome: this.outcome } : {},
3672
+ ...this.stopReason !== void 0 ? { stopReason: this.stopReason } : {},
3673
+ ...this.stopReasonContext !== void 0 ? { stopReasonContext: this.stopReasonContext } : {},
3661
3674
  ...nestedUnderParent ? { nestedUnderParent: true } : {},
3662
3675
  ...links ? { links } : {},
3663
3676
  ...this.isRootSpan && !nestedUnderParent && this.tags?.length ? { tags: this.tags } : {}
@@ -3886,7 +3899,7 @@ function isValidSpanId(spanId) {
3886
3899
  function getOrCreateTraceId(options) {
3887
3900
  if (options.traceId) {
3888
3901
  if (isValidTraceId(options.traceId)) return options.traceId;
3889
- else console.error(`[Mastra Tracing] Invalid traceId: must be 1-32 hexadecimal characters, got "${options.traceId}". Generating new trace ID.`);
3902
+ console.error(`[Mastra Tracing] Invalid traceId: must be 1-32 hexadecimal characters, got "${options.traceId}". Generating new trace ID.`);
3890
3903
  }
3891
3904
  return generateTraceId();
3892
3905
  }
@@ -5355,6 +5368,10 @@ var BaseObservabilityInstance = class extends _mastra_core_base.MastraBase {
5355
5368
  spanId: cached.id,
5356
5369
  parentSpanId: cached.parentSpanId,
5357
5370
  externalParentSpanId: cached.externalParentSpanId,
5371
+ resumedFromSpanId: cached.resumedFromSpanId,
5372
+ outcome: cached.outcome,
5373
+ stopReason: cached.stopReason,
5374
+ stopReasonContext: cached.stopReasonContext,
5358
5375
  links: cached.links,
5359
5376
  startTime: cached.startTime instanceof Date ? cached.startTime : new Date(cached.startTime),
5360
5377
  input: cached.input,