@mastra/observability 1.7.2 → 1.7.3

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @mastra/observability
2
2
 
3
+ ## 1.7.3
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 [[`f32b9e1`](https://github.com/mastra-ai/mastra/commit/f32b9e115a3c754d1c8cfa3f4256fba87b09cfb7), [`7d6f521`](https://github.com/mastra-ai/mastra/commit/7d6f52164d0cca099f0b07cb2bba334360f1c8ab), [`a50d220`](https://github.com/mastra-ai/mastra/commit/a50d220b01ecbc5644d489a3d446c3bd4ab30245), [`665477b`](https://github.com/mastra-ai/mastra/commit/665477bc104fd52cfef8e7610d7664781a70c220), [`4cc2755`](https://github.com/mastra-ai/mastra/commit/4cc2755a7194cb08720ff2ab4dffb4b4a5103dfd), [`ac7baf6`](https://github.com/mastra-ai/mastra/commit/ac7baf66ef1db15e03975ef4ebb02724f015a391), [`ed425d7`](https://github.com/mastra-ai/mastra/commit/ed425d78e7c66cbda8209fee910856f98c6c6b82), [`1371703`](https://github.com/mastra-ai/mastra/commit/1371703835080450ef3f9aea58059a95d0da2e5a), [`0df8321`](https://github.com/mastra-ai/mastra/commit/0df832196eeb2450ab77ce887e8553abdd44c5a6), [`98f8a8b`](https://github.com/mastra-ai/mastra/commit/98f8a8bdf5761b9982f3ad3acbe7f1cc3efa71f3), [`ba6f7e9`](https://github.com/mastra-ai/mastra/commit/ba6f7e9086d8281393f2acae60fda61de3bff1f9), [`7eb2596`](https://github.com/mastra-ai/mastra/commit/7eb25960d607e07468c9a10c5437abd2deaf1e9a), [`1805ddc`](https://github.com/mastra-ai/mastra/commit/1805ddc9c9b3b14b63749735a13c05a45af43a80), [`fff91cf`](https://github.com/mastra-ai/mastra/commit/fff91cf914de0e731578aacebffdeebef82f0440), [`61109b3`](https://github.com/mastra-ai/mastra/commit/61109b34feb0e38d54bee4b8ca83eb7345b1d557), [`33f1ead`](https://github.com/mastra-ai/mastra/commit/33f1eadfa19c86953f593478e5fa371093b33779)]:
10
+ - @mastra/core@1.23.0
11
+
12
+ ## 1.7.3-alpha.0
13
+
14
+ ### Patch Changes
15
+
16
+ - 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))
17
+
18
+ - 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)]:
19
+ - @mastra/core@1.23.0-alpha.8
20
+
3
21
  ## 1.7.2
4
22
 
5
23
  ### 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 } : {}