@mastra/observability 1.9.2-alpha.1 → 1.10.0-alpha.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 +33 -0
- package/dist/context/logger.d.ts.map +1 -1
- package/dist/context/metrics.d.ts.map +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/model-tracing.d.ts.map +1 -1
- package/dist/recorded.d.ts.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @mastra/observability
|
|
2
2
|
|
|
3
|
+
## 1.10.0-alpha.3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added unique IDs (`logId`, `metricId`, `scoreId`, `feedbackId`) to all observability signals, generated automatically at emission time for de-duplication across the framework pipeline and cross-system correlation. User-facing APIs (`logger.info()`, `metrics.emit()`, `addScore()`, `addFeedback()`) are unchanged. ([#15242](https://github.com/mastra-ai/mastra/pull/15242))
|
|
8
|
+
|
|
9
|
+
For existing ClickHouse and DuckDB observability signal tables, run `npx mastra migrate` before initializing the store so the new signal-ID schema is applied.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`20f59b8`](https://github.com/mastra-ai/mastra/commit/20f59b876cf91199efbc49a0e36b391240708f08), [`e2687a7`](https://github.com/mastra-ai/mastra/commit/e2687a7408790c384563816a9a28ed06735684c9), [`8f1b280`](https://github.com/mastra-ai/mastra/commit/8f1b280b7fe6999ec654f160cb69c1a8719e7a57), [`12df98c`](https://github.com/mastra-ai/mastra/commit/12df98c4904643d9481f5c78f3bed443725b4c96)]:
|
|
14
|
+
- @mastra/core@1.26.0-alpha.11
|
|
15
|
+
|
|
16
|
+
## 1.10.0-alpha.2
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- Changed `MODEL_CHUNK` `tool-result` span `output` handling. ([#15495](https://github.com/mastra-ai/mastra/pull/15495))
|
|
21
|
+
|
|
22
|
+
**What changed**
|
|
23
|
+
- `MODEL_CHUNK` spans for `tool-result` now omit `output` for locally executed tools.
|
|
24
|
+
- `TOOL_CALL` remains the canonical span for locally executed tool result payloads.
|
|
25
|
+
- `MODEL_CHUNK` spans for provider-executed `tool-result` chunks still include `output`.
|
|
26
|
+
- `MODEL_CHUNK` metadata still includes `toolCallId`, `toolName`, and `providerExecuted`.
|
|
27
|
+
|
|
28
|
+
**Why**
|
|
29
|
+
This reduces duplicate tool result payloads in traces without dropping provider-emitted tool results that may not have a matching `TOOL_CALL` span.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [[`8786a61`](https://github.com/mastra-ai/mastra/commit/8786a61fa54ba265f85eeff9985ca39863d18bb6), [`8fb2405`](https://github.com/mastra-ai/mastra/commit/8fb2405138f2d208b7962ad03f121ca25bcc28c5)]:
|
|
34
|
+
- @mastra/core@1.26.0-alpha.7
|
|
35
|
+
|
|
3
36
|
## 1.9.2-alpha.1
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/context/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/context/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAyB,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAE/C,MAAM,WAAW,mBAAmB;IAClC,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,qDAAqD;IACrD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9B,wCAAwC;IACxC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK;IAQ1B,wCAAwC;IACxC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;CAOnC"}
|
package/dist/index.cjs
CHANGED
|
@@ -17802,8 +17802,6 @@ var ObservabilityBus = class extends BaseObservabilityEventBus {
|
|
|
17802
17802
|
await super.shutdown();
|
|
17803
17803
|
}
|
|
17804
17804
|
};
|
|
17805
|
-
|
|
17806
|
-
// src/context/logger.ts
|
|
17807
17805
|
var LOG_LEVEL_PRIORITY = {
|
|
17808
17806
|
debug: 0,
|
|
17809
17807
|
info: 1,
|
|
@@ -17856,6 +17854,7 @@ var LoggerContextImpl = class {
|
|
|
17856
17854
|
return;
|
|
17857
17855
|
}
|
|
17858
17856
|
const exportedLog = {
|
|
17857
|
+
logId: observability.generateSignalId(),
|
|
17859
17858
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17860
17859
|
level,
|
|
17861
17860
|
message,
|
|
@@ -17869,8 +17868,6 @@ var LoggerContextImpl = class {
|
|
|
17869
17868
|
this.config.observabilityBus.emit(event);
|
|
17870
17869
|
}
|
|
17871
17870
|
};
|
|
17872
|
-
|
|
17873
|
-
// src/context/metrics.ts
|
|
17874
17871
|
var MetricsContextImpl = class {
|
|
17875
17872
|
traceId;
|
|
17876
17873
|
spanId;
|
|
@@ -17898,6 +17895,7 @@ var MetricsContextImpl = class {
|
|
|
17898
17895
|
const filteredLabels = labels ? this.cardinalityFilter.filterLabels(labels) : {};
|
|
17899
17896
|
const costContext = options?.costContext ? cloneCostContext(options.costContext) : void 0;
|
|
17900
17897
|
const exportedMetric = {
|
|
17898
|
+
metricId: observability.generateSignalId(),
|
|
17901
17899
|
timestamp: /* @__PURE__ */ new Date(),
|
|
17902
17900
|
traceId: this.traceId,
|
|
17903
17901
|
spanId: this.spanId,
|
|
@@ -19152,14 +19150,16 @@ var ModelSpanTracker = class {
|
|
|
19152
19150
|
dynamic,
|
|
19153
19151
|
providerExecuted,
|
|
19154
19152
|
providerMetadata,
|
|
19155
|
-
//
|
|
19153
|
+
// Keep provider-executed results on MODEL_CHUNK because they come
|
|
19154
|
+
// from the model/provider stream and may not have a sibling TOOL_CALL span.
|
|
19155
|
+
// For locally executed tools, the canonical payload lives on TOOL_CALL.
|
|
19156
19156
|
result} = chunk.payload || {};
|
|
19157
19157
|
const metadata = { toolCallId, toolName };
|
|
19158
19158
|
if (isError !== void 0) metadata.isError = isError;
|
|
19159
19159
|
if (dynamic !== void 0) metadata.dynamic = dynamic;
|
|
19160
19160
|
if (providerExecuted !== void 0) metadata.providerExecuted = providerExecuted;
|
|
19161
19161
|
if (providerMetadata !== void 0) metadata.providerMetadata = providerMetadata;
|
|
19162
|
-
this.#createEventSpan(chunk.type, result, { metadata });
|
|
19162
|
+
this.#createEventSpan(chunk.type, providerExecuted ? result : void 0, { metadata });
|
|
19163
19163
|
break;
|
|
19164
19164
|
}
|
|
19165
19165
|
}
|
|
@@ -20200,8 +20200,6 @@ var DefaultObservabilityInstance = class extends BaseObservabilityInstance {
|
|
|
20200
20200
|
return new DefaultSpan(options, this);
|
|
20201
20201
|
}
|
|
20202
20202
|
};
|
|
20203
|
-
|
|
20204
|
-
// src/recorded.ts
|
|
20205
20203
|
function nullToUndefined(value) {
|
|
20206
20204
|
return value ?? void 0;
|
|
20207
20205
|
}
|
|
@@ -20256,6 +20254,7 @@ function buildScoreEvent(args) {
|
|
|
20256
20254
|
return {
|
|
20257
20255
|
type: "score",
|
|
20258
20256
|
score: {
|
|
20257
|
+
scoreId: observability.generateSignalId(),
|
|
20259
20258
|
timestamp: /* @__PURE__ */ new Date(),
|
|
20260
20259
|
traceId,
|
|
20261
20260
|
spanId,
|
|
@@ -20277,6 +20276,7 @@ function buildFeedbackEvent(args) {
|
|
|
20277
20276
|
return {
|
|
20278
20277
|
type: "feedback",
|
|
20279
20278
|
feedback: {
|
|
20279
|
+
feedbackId: observability.generateSignalId(),
|
|
20280
20280
|
timestamp: /* @__PURE__ */ new Date(),
|
|
20281
20281
|
traceId,
|
|
20282
20282
|
spanId,
|