@mastra/observability 1.7.2-alpha.0 → 1.7.3-alpha.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/CHANGELOG.md +20 -0
- package/dist/index.cjs +15 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/dist/model-tracing.d.ts.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @mastra/observability
|
|
2
2
|
|
|
3
|
+
## 1.7.3-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed MODEL_STEP span input containing the entire raw HTTP request body instead of just the messages. Observability exporters (Datadog, Langfuse, etc.) now receive clean message arrays as MODEL_STEP span input. ([#15099](https://github.com/mastra-ai/mastra/pull/15099))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`ac7baf6`](https://github.com/mastra-ai/mastra/commit/ac7baf66ef1db15e03975ef4ebb02724f015a391), [`0df8321`](https://github.com/mastra-ai/mastra/commit/0df832196eeb2450ab77ce887e8553abdd44c5a6), [`61109b3`](https://github.com/mastra-ai/mastra/commit/61109b34feb0e38d54bee4b8ca83eb7345b1d557), [`33f1ead`](https://github.com/mastra-ai/mastra/commit/33f1eadfa19c86953f593478e5fa371093b33779)]:
|
|
10
|
+
- @mastra/core@1.23.0-alpha.8
|
|
11
|
+
|
|
12
|
+
## 1.7.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- **Fixed Anthropic cache tokens being double-counted in observability metrics** ([#13914](https://github.com/mastra-ai/mastra/pull/13914))
|
|
17
|
+
|
|
18
|
+
Anthropic cache token usage is now normalized correctly for AI SDK v6-style usage payloads, so input token metrics and tracing output no longer overcount cached tokens when the total already includes them.
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`cb15509`](https://github.com/mastra-ai/mastra/commit/cb15509b58f6a83e11b765c945082afc027db972), [`81e4259`](https://github.com/mastra-ai/mastra/commit/81e425939b4ceeb4f586e9b6d89c3b1c1f2d2fe7), [`951b8a1`](https://github.com/mastra-ai/mastra/commit/951b8a1b5ef7e1474c59dc4f2b9fc1a8b1e508b6), [`80c5668`](https://github.com/mastra-ai/mastra/commit/80c5668e365470d3a96d3e953868fd7a643ff67c), [`3d478c1`](https://github.com/mastra-ai/mastra/commit/3d478c1e13f17b80f330ac49d7aa42ef929b93ff), [`2b4ea10`](https://github.com/mastra-ai/mastra/commit/2b4ea10b053e4ea1ab232d536933a4a3c4cba999), [`a0544f0`](https://github.com/mastra-ai/mastra/commit/a0544f0a1e6bd52ac12676228967c1938e43648d), [`6039f17`](https://github.com/mastra-ai/mastra/commit/6039f176f9c457304825ff1df8c83b8e457376c0), [`06b928d`](https://github.com/mastra-ai/mastra/commit/06b928dfc2f5630d023467476cc5919dfa858d0a), [`6a8d984`](https://github.com/mastra-ai/mastra/commit/6a8d9841f2933456ee1598099f488d742b600054), [`c8c86aa`](https://github.com/mastra-ai/mastra/commit/c8c86aa1458017fbd1c0776fdc0c520d129df8a6)]:
|
|
21
|
+
- @mastra/core@1.22.0
|
|
22
|
+
|
|
3
23
|
## 1.7.2-alpha.0
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -17967,6 +17967,19 @@ function sumDefinedValues(obj, keys) {
|
|
|
17967
17967
|
}
|
|
17968
17968
|
|
|
17969
17969
|
// src/model-tracing.ts
|
|
17970
|
+
function extractStepInput(request) {
|
|
17971
|
+
if (!request) return void 0;
|
|
17972
|
+
const { body } = request;
|
|
17973
|
+
if (body == null) return request;
|
|
17974
|
+
try {
|
|
17975
|
+
const parsed = typeof body === "string" ? JSON.parse(body) : body;
|
|
17976
|
+
if (Array.isArray(parsed?.messages)) return parsed.messages;
|
|
17977
|
+
if (Array.isArray(parsed?.contents)) return parsed.contents;
|
|
17978
|
+
return parsed;
|
|
17979
|
+
} catch {
|
|
17980
|
+
return request;
|
|
17981
|
+
}
|
|
17982
|
+
}
|
|
17970
17983
|
var ModelSpanTracker = class {
|
|
17971
17984
|
#modelSpan;
|
|
17972
17985
|
#currentStepSpan;
|
|
@@ -18038,7 +18051,7 @@ var ModelSpanTracker = class {
|
|
|
18038
18051
|
...payload?.messageId ? { messageId: payload.messageId } : {},
|
|
18039
18052
|
...payload?.warnings?.length ? { warnings: payload.warnings } : {}
|
|
18040
18053
|
},
|
|
18041
|
-
input: payload?.request
|
|
18054
|
+
input: extractStepInput(payload?.request)
|
|
18042
18055
|
});
|
|
18043
18056
|
this.#chunkSequence = 0;
|
|
18044
18057
|
}
|
|
@@ -18051,7 +18064,7 @@ var ModelSpanTracker = class {
|
|
|
18051
18064
|
return;
|
|
18052
18065
|
}
|
|
18053
18066
|
this.#currentStepSpan.update({
|
|
18054
|
-
input: payload.request,
|
|
18067
|
+
input: extractStepInput(payload.request),
|
|
18055
18068
|
attributes: {
|
|
18056
18069
|
...payload.messageId ? { messageId: payload.messageId } : {},
|
|
18057
18070
|
...payload.warnings?.length ? { warnings: payload.warnings } : {}
|