@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 +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/instances/base.d.ts.map +1 -1
- package/dist/metrics/pricing-data.json +400 -342
- package/dist/spans/base.d.ts +5 -0
- package/dist/spans/base.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -3299,6 +3299,11 @@ var BaseSpan = class BaseSpan {
|
|
|
3299
3299
|
parentSpanId;
|
|
3300
3300
|
/** 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 */
|
|
3301
3301
|
externalParentSpanId;
|
|
3302
|
+
/** Native span fields (see `SpanData`); carried as supplied and exported only when set */
|
|
3303
|
+
resumedFromSpanId;
|
|
3304
|
+
outcome;
|
|
3305
|
+
stopReason;
|
|
3306
|
+
stopReasonContext;
|
|
3302
3307
|
/** Deep clean options for serialization */
|
|
3303
3308
|
deepCleanOptions;
|
|
3304
3309
|
/**
|
|
@@ -3365,6 +3370,10 @@ var BaseSpan = class BaseSpan {
|
|
|
3365
3370
|
}
|
|
3366
3371
|
this.tags = !options.parent && options.tags?.length ? options.tags : void 0;
|
|
3367
3372
|
this.links = validLinks(options.links);
|
|
3373
|
+
this.resumedFromSpanId = options.resumedFromSpanId;
|
|
3374
|
+
this.outcome = options.outcome;
|
|
3375
|
+
this.stopReason = options.stopReason;
|
|
3376
|
+
this.stopReasonContext = deepClean(options.stopReasonContext, this.deepCleanOptions);
|
|
3368
3377
|
const entityParent = this.getParentSpan(false);
|
|
3369
3378
|
this.entityType = options.entityType ?? entityParent?.entityType;
|
|
3370
3379
|
this.entityId = options.entityId ?? entityParent?.entityId;
|
|
@@ -3633,6 +3642,10 @@ var BaseSpan = class BaseSpan {
|
|
|
3633
3642
|
...definedLineage(correlation),
|
|
3634
3643
|
parentSpanId: this.getParentSpanId(includeInternalSpans),
|
|
3635
3644
|
externalParentSpanId: this.getExportedExternalParentSpanId(includeInternalSpans),
|
|
3645
|
+
...this.resumedFromSpanId !== void 0 ? { resumedFromSpanId: this.resumedFromSpanId } : {},
|
|
3646
|
+
...this.outcome !== void 0 ? { outcome: this.outcome } : {},
|
|
3647
|
+
...this.stopReason !== void 0 ? { stopReason: this.stopReason } : {},
|
|
3648
|
+
...this.stopReasonContext !== void 0 ? { stopReasonContext: this.stopReasonContext } : {},
|
|
3636
3649
|
...nestedUnderParent ? { nestedUnderParent: true } : {},
|
|
3637
3650
|
...links ? { links } : {},
|
|
3638
3651
|
...this.isRootSpan && !nestedUnderParent && this.tags?.length ? { tags: this.tags } : {}
|
|
@@ -3861,7 +3874,7 @@ function isValidSpanId(spanId) {
|
|
|
3861
3874
|
function getOrCreateTraceId(options) {
|
|
3862
3875
|
if (options.traceId) {
|
|
3863
3876
|
if (isValidTraceId(options.traceId)) return options.traceId;
|
|
3864
|
-
|
|
3877
|
+
console.error(`[Mastra Tracing] Invalid traceId: must be 1-32 hexadecimal characters, got "${options.traceId}". Generating new trace ID.`);
|
|
3865
3878
|
}
|
|
3866
3879
|
return generateTraceId();
|
|
3867
3880
|
}
|
|
@@ -5330,6 +5343,10 @@ var BaseObservabilityInstance = class extends MastraBase {
|
|
|
5330
5343
|
spanId: cached.id,
|
|
5331
5344
|
parentSpanId: cached.parentSpanId,
|
|
5332
5345
|
externalParentSpanId: cached.externalParentSpanId,
|
|
5346
|
+
resumedFromSpanId: cached.resumedFromSpanId,
|
|
5347
|
+
outcome: cached.outcome,
|
|
5348
|
+
stopReason: cached.stopReason,
|
|
5349
|
+
stopReasonContext: cached.stopReasonContext,
|
|
5333
5350
|
links: cached.links,
|
|
5334
5351
|
startTime: cached.startTime instanceof Date ? cached.startTime : new Date(cached.startTime),
|
|
5335
5352
|
input: cached.input,
|