@mastra/observability 1.23.0-alpha.0 → 1.23.0-alpha.1
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 +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/metrics/pricing-data.json +393 -251
- package/dist/spans/base.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -3365,6 +3365,13 @@ function definedLineage(source) {
|
|
|
3365
3365
|
}
|
|
3366
3366
|
return lineage;
|
|
3367
3367
|
}
|
|
3368
|
+
function modelPair(attributes) {
|
|
3369
|
+
const { model, provider } = attributes ?? {};
|
|
3370
|
+
return typeof model === "string" && model && typeof provider === "string" && provider ? {
|
|
3371
|
+
model,
|
|
3372
|
+
provider
|
|
3373
|
+
} : {};
|
|
3374
|
+
}
|
|
3368
3375
|
/**
|
|
3369
3376
|
* Determines if a span type should be considered internal based on flags.
|
|
3370
3377
|
* Returns false if flags are undefined.
|
|
@@ -3859,6 +3866,7 @@ var BaseSpan = class BaseSpan {
|
|
|
3859
3866
|
parentSpanId: this.getParentSpanId(includeInternalSpans),
|
|
3860
3867
|
externalParentSpanId: this.getExportedExternalParentSpanId(includeInternalSpans),
|
|
3861
3868
|
...this.resumedFromSpanId !== void 0 ? { resumedFromSpanId: this.resumedFromSpanId } : {},
|
|
3869
|
+
...modelPair(this.attributes),
|
|
3862
3870
|
...typeof timeToFirstTokenMs === "number" ? { timeToFirstTokenMs } : {},
|
|
3863
3871
|
...nestedUnderParent ? { nestedUnderParent: true } : {},
|
|
3864
3872
|
...links ? { links } : {},
|
|
@@ -3868,7 +3876,7 @@ var BaseSpan = class BaseSpan {
|
|
|
3868
3876
|
/** Returns the span saved for a later `rebuildSpan()`, with its trace state */
|
|
3869
3877
|
snapshot() {
|
|
3870
3878
|
return {
|
|
3871
|
-
...this.exportSpan(),
|
|
3879
|
+
...this.exportSpan(this.observabilityInstance.getConfig().includeInternalSpans),
|
|
3872
3880
|
ownEntityVersionId: this.ownEntityVersionId ?? null,
|
|
3873
3881
|
...this.traceState ? { traceState: this.traceState } : {}
|
|
3874
3882
|
};
|