@mastra/observability 1.24.0-alpha.4 → 1.24.0-alpha.5
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/bus/observability-bus.d.ts +2 -1
- package/dist/bus/observability-bus.d.ts.map +1 -1
- package/dist/bus/route-event.d.ts.map +1 -1
- package/dist/default.d.ts +4 -1
- package/dist/default.d.ts.map +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +53 -53
- package/dist/docs/references/docs-observability-feedback.md +5 -7
- package/dist/docs/references/reference-observability-feedback.md +43 -14
- package/dist/docs/references/reference-observability-tracing-exporters-mastra-platform-exporter.md +19 -16
- package/dist/exporters/default.d.ts +4 -7
- package/dist/exporters/default.d.ts.map +1 -1
- package/dist/exporters/event-buffer.d.ts +5 -2
- package/dist/exporters/event-buffer.d.ts.map +1 -1
- package/dist/exporters/mastra-platform.d.ts +5 -1
- package/dist/exporters/mastra-platform.d.ts.map +1 -1
- package/dist/exporters/mastra-storage.d.ts +4 -7
- package/dist/exporters/mastra-storage.d.ts.map +1 -1
- package/dist/exporters/platform-resolved-record.d.ts +3 -0
- package/dist/exporters/platform-resolved-record.d.ts.map +1 -0
- package/dist/exporters/storage-annotation.d.ts +9 -0
- package/dist/exporters/storage-annotation.d.ts.map +1 -0
- package/dist/exporters/storage-byte-tracker.d.ts +2 -3
- package/dist/exporters/storage-byte-tracker.d.ts.map +1 -1
- package/dist/index.cjs +900 -730
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +900 -730
- package/dist/index.js.map +1 -1
- package/dist/instances/base.d.ts +2 -1
- package/dist/instances/base.d.ts.map +1 -1
- package/dist/recorded.d.ts +4 -12
- package/dist/recorded.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { ObservabilityExporter, ObservabilityBridge, ObservabilityEvent, ObservabilityDropEvent, SerializationOptions } from '@mastra/core/observability';
|
|
13
13
|
import { BaseObservabilityEventBus } from './base.js';
|
|
14
|
+
import type { ObservabilityHandler } from './route-event.js';
|
|
14
15
|
/**
|
|
15
16
|
* Unified event bus for all observability signals (tracing, logs, metrics, scores, feedback).
|
|
16
17
|
* Routes events to registered exporters and an optional bridge.
|
|
@@ -70,7 +71,7 @@ export declare class ObservabilityBus extends BaseObservabilityEventBus<Observab
|
|
|
70
71
|
* emit() is synchronous — async handler promises are tracked internally
|
|
71
72
|
* and can be drained via flush().
|
|
72
73
|
*/
|
|
73
|
-
emit(event: ObservabilityEvent): void;
|
|
74
|
+
emit(event: ObservabilityEvent, shouldHandle?: (handler: ObservabilityHandler) => boolean): void;
|
|
74
75
|
/**
|
|
75
76
|
* Emit exporter pipeline drop events to exporters and the bridge.
|
|
76
77
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability-bus.d.ts","sourceRoot":"","sources":["../../src/bus/observability-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"observability-bus.d.ts","sourceRoot":"","sources":["../../src/bus/observability-bus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAwC1D;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,yBAAyB,CAAC,kBAAkB,CAAC;IACjF,OAAO,CAAC,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names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EACV,mBAAmB,EAMnB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAGpC;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAa1E;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,aAAa,GACpB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"route-event.d.ts","sourceRoot":"","sources":["../../src/bus/route-event.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EACV,mBAAmB,EAMnB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AAGpC;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAa1E;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,kBAAkB,EACzB,MAAM,EAAE,aAAa,GACpB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAmEtB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,oBAAoB,EAC7B,KAAK,EAAE,sBAAsB,EAC7B,MAAM,EAAE,aAAa,GACpB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAQtB"}
|
package/dist/default.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Mastra } from '@mastra/core';
|
|
2
2
|
import { MastraBase } from '@mastra/core/base';
|
|
3
3
|
import type { IMastraLogger } from '@mastra/core/logger';
|
|
4
|
-
import type { ClientObservabilityProxy, CorrelationContext, ConfigSelector, ConfigSelectorOptions, FeedbackInput, ObservabilityEntrypoint, ObservabilityInstance, RecordedTrace, ScoreInput } from '@mastra/core/observability';
|
|
4
|
+
import type { ClientObservabilityProxy, CorrelationContext, ConfigSelector, ConfigSelectorOptions, FeedbackInput, FeedbackReplacementInput, FeedbackEvent, FeedbackReplacementEvent, ObservabilityEntrypoint, ObservabilityInstance, RecordedTrace, ScoreInput, ScoreEvent } from '@mastra/core/observability';
|
|
5
5
|
import type { ObservabilityRegistryConfig } from './config.js';
|
|
6
6
|
/**
|
|
7
7
|
* Manages observability instances and selects their configurations for Mastra operations.
|
|
@@ -54,6 +54,9 @@ export declare class Observability extends MastraBase implements ObservabilityEn
|
|
|
54
54
|
correlationContext?: CorrelationContext;
|
|
55
55
|
feedback: FeedbackInput;
|
|
56
56
|
}): Promise<void>;
|
|
57
|
+
replaceFeedback(args: FeedbackReplacementInput): Promise<void>;
|
|
58
|
+
/** @internal Queue an HTTP-created record; flush/shutdown await delivery without holding the HTTP response open. */
|
|
59
|
+
__exportPersistedEvent(event: ScoreEvent | FeedbackEvent | FeedbackReplacementEvent): Promise<void>;
|
|
57
60
|
/** Register a named observability instance, optionally marking it as default. */
|
|
58
61
|
registerInstance(name: string, instance: ObservabilityInstance, isDefault?: boolean): void;
|
|
59
62
|
/** Get a registered instance by name. */
|
package/dist/default.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../src/default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EACV,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;;;;OAQG;IACH,2BAA2B,IAAI,wBAAwB,GAAG,SAAS,CAQlE;CAiDF"}
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-observability
|
|
|
3
3
|
description: Documentation for @mastra/observability. Use when working with @mastra/observability APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/observability"
|
|
6
|
-
version: "1.24.0-alpha.
|
|
6
|
+
version: "1.24.0-alpha.5"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -1,251 +1,251 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.24.0-alpha.
|
|
2
|
+
"version": "1.24.0-alpha.5",
|
|
3
3
|
"package": "@mastra/observability",
|
|
4
4
|
"exports": {
|
|
5
5
|
"BaseExporter": {
|
|
6
6
|
"types": "dist/exporters/base.d.ts",
|
|
7
7
|
"implementation": "dist/index.js",
|
|
8
|
-
"line":
|
|
8
|
+
"line": 4256
|
|
9
9
|
},
|
|
10
10
|
"BaseObservabilityEventBus": {
|
|
11
11
|
"types": "dist/bus/base.d.ts",
|
|
12
12
|
"implementation": "dist/index.js",
|
|
13
|
-
"line":
|
|
13
|
+
"line": 99
|
|
14
14
|
},
|
|
15
15
|
"BaseObservabilityInstance": {
|
|
16
16
|
"types": "dist/instances/base.d.ts",
|
|
17
17
|
"implementation": "dist/index.js",
|
|
18
|
-
"line":
|
|
18
|
+
"line": 6144
|
|
19
19
|
},
|
|
20
20
|
"BaseSpan": {
|
|
21
21
|
"types": "dist/spans/base.d.ts",
|
|
22
22
|
"implementation": "dist/index.js",
|
|
23
|
-
"line":
|
|
23
|
+
"line": 3541
|
|
24
24
|
},
|
|
25
25
|
"CardinalityFilter": {
|
|
26
26
|
"types": "dist/metrics/cardinality.d.ts",
|
|
27
27
|
"implementation": "dist/index.js",
|
|
28
|
-
"line":
|
|
28
|
+
"line": 2083
|
|
29
29
|
},
|
|
30
30
|
"CloudExporter": {
|
|
31
31
|
"types": "dist/exporters/cloud.d.ts",
|
|
32
32
|
"implementation": "dist/index.js",
|
|
33
|
-
"line":
|
|
33
|
+
"line": 8564
|
|
34
34
|
},
|
|
35
35
|
"ConsoleExporter": {
|
|
36
36
|
"types": "dist/exporters/console.d.ts",
|
|
37
37
|
"implementation": "dist/index.js",
|
|
38
|
-
"line":
|
|
38
|
+
"line": 8887
|
|
39
39
|
},
|
|
40
40
|
"DEFAULT_DEEP_CLEAN_OPTIONS": {
|
|
41
41
|
"types": "dist/spans/serialization.d.ts",
|
|
42
42
|
"implementation": "dist/index.js",
|
|
43
|
-
"line":
|
|
43
|
+
"line": 202
|
|
44
44
|
},
|
|
45
45
|
"DEFAULT_LIMITS": {
|
|
46
46
|
"types": "dist/client/proxy.d.ts",
|
|
47
47
|
"implementation": "dist/index.js",
|
|
48
|
-
"line":
|
|
48
|
+
"line": 7130
|
|
49
49
|
},
|
|
50
50
|
"DefaultExporter": {
|
|
51
51
|
"types": "dist/exporters/default.d.ts",
|
|
52
52
|
"implementation": "dist/index.js",
|
|
53
|
-
"line":
|
|
53
|
+
"line": 4992
|
|
54
54
|
},
|
|
55
55
|
"DefaultObservabilityInstance": {
|
|
56
56
|
"types": "dist/instances/default.d.ts",
|
|
57
57
|
"implementation": "dist/index.js",
|
|
58
|
-
"line":
|
|
58
|
+
"line": 10799
|
|
59
59
|
},
|
|
60
60
|
"DefaultSpan": {
|
|
61
61
|
"types": "dist/spans/default.d.ts",
|
|
62
62
|
"implementation": "dist/index.js",
|
|
63
|
-
"line":
|
|
63
|
+
"line": 4027
|
|
64
64
|
},
|
|
65
65
|
"JsonExporter": {
|
|
66
66
|
"types": "dist/exporters/test.d.ts",
|
|
67
67
|
"implementation": "dist/index.js",
|
|
68
|
-
"line":
|
|
68
|
+
"line": 10797
|
|
69
69
|
},
|
|
70
70
|
"LoggerContextImpl": {
|
|
71
71
|
"types": "dist/context/logger.d.ts",
|
|
72
72
|
"implementation": "dist/index.js",
|
|
73
|
-
"line":
|
|
73
|
+
"line": 945
|
|
74
74
|
},
|
|
75
75
|
"MastraPlatformExporter": {
|
|
76
76
|
"types": "dist/exporters/mastra-platform.d.ts",
|
|
77
77
|
"implementation": "dist/index.js",
|
|
78
|
-
"line":
|
|
78
|
+
"line": 9217
|
|
79
79
|
},
|
|
80
80
|
"MastraStorageExporter": {
|
|
81
81
|
"types": "dist/exporters/mastra-storage.d.ts",
|
|
82
82
|
"implementation": "dist/index.js",
|
|
83
|
-
"line":
|
|
83
|
+
"line": 5540
|
|
84
84
|
},
|
|
85
85
|
"MetricsContextImpl": {
|
|
86
86
|
"types": "dist/context/metrics.d.ts",
|
|
87
87
|
"implementation": "dist/index.js",
|
|
88
|
-
"line":
|
|
88
|
+
"line": 1009
|
|
89
89
|
},
|
|
90
90
|
"ModelSpanTracker": {
|
|
91
91
|
"types": "dist/model-tracing.d.ts",
|
|
92
92
|
"implementation": "dist/index.js",
|
|
93
|
-
"line":
|
|
93
|
+
"line": 2515
|
|
94
94
|
},
|
|
95
95
|
"NoOpSpan": {
|
|
96
96
|
"types": "dist/spans/no-op.d.ts",
|
|
97
97
|
"implementation": "dist/index.js",
|
|
98
|
-
"line":
|
|
98
|
+
"line": 4199
|
|
99
99
|
},
|
|
100
100
|
"OBSERVABILITY_CAPABILITIES_HEADER": {
|
|
101
101
|
"types": "dist/exporters/mastra-platform.d.ts",
|
|
102
102
|
"implementation": "dist/index.js",
|
|
103
|
-
"line":
|
|
103
|
+
"line": 9118
|
|
104
104
|
},
|
|
105
105
|
"Observability": {
|
|
106
106
|
"types": "dist/default.d.ts",
|
|
107
107
|
"implementation": "dist/index.js",
|
|
108
|
-
"line":
|
|
108
|
+
"line": 11135
|
|
109
109
|
},
|
|
110
110
|
"ObservabilityBus": {
|
|
111
111
|
"types": "dist/bus/observability-bus.d.ts",
|
|
112
112
|
"implementation": "dist/index.js",
|
|
113
|
-
"line":
|
|
113
|
+
"line": 575
|
|
114
114
|
},
|
|
115
115
|
"QUOTA_PAUSE_CAPABILITY": {
|
|
116
116
|
"types": "dist/exporters/mastra-platform.d.ts",
|
|
117
117
|
"implementation": "dist/index.js",
|
|
118
|
-
"line":
|
|
118
|
+
"line": 9119
|
|
119
119
|
},
|
|
120
120
|
"SamplingStrategyType": {
|
|
121
121
|
"types": "dist/config.d.ts",
|
|
122
122
|
"implementation": "dist/index.js",
|
|
123
|
-
"line":
|
|
123
|
+
"line": 744
|
|
124
124
|
},
|
|
125
125
|
"SensitiveDataFilter": {
|
|
126
126
|
"types": "dist/span_processors/sensitive-data-filter.d.ts",
|
|
127
127
|
"implementation": "dist/index.js",
|
|
128
|
-
"line":
|
|
128
|
+
"line": 10922
|
|
129
129
|
},
|
|
130
130
|
"TestExporter": {
|
|
131
131
|
"types": "dist/exporters/test.d.ts",
|
|
132
132
|
"implementation": "dist/index.js",
|
|
133
|
-
"line":
|
|
133
|
+
"line": 9812
|
|
134
134
|
},
|
|
135
135
|
"TraceData": {
|
|
136
136
|
"types": "dist/exporters/tracking.d.ts",
|
|
137
137
|
"implementation": "dist/index.js",
|
|
138
|
-
"line":
|
|
138
|
+
"line": 7283
|
|
139
139
|
},
|
|
140
140
|
"TrackingExporter": {
|
|
141
141
|
"types": "dist/exporters/tracking.d.ts",
|
|
142
142
|
"implementation": "dist/index.js",
|
|
143
|
-
"line":
|
|
143
|
+
"line": 7612
|
|
144
144
|
},
|
|
145
145
|
"buildExportedLog": {
|
|
146
146
|
"types": "dist/client/otlp.d.ts",
|
|
147
147
|
"implementation": "dist/index.js",
|
|
148
|
-
"line":
|
|
148
|
+
"line": 7047
|
|
149
149
|
},
|
|
150
150
|
"buildExportedSpan": {
|
|
151
151
|
"types": "dist/client/otlp.d.ts",
|
|
152
152
|
"implementation": "dist/index.js",
|
|
153
|
-
"line":
|
|
153
|
+
"line": 7029
|
|
154
154
|
},
|
|
155
155
|
"buildTracingOptions": {
|
|
156
156
|
"types": "dist/tracing-options.d.ts",
|
|
157
157
|
"implementation": "dist/index.js",
|
|
158
|
-
"line":
|
|
158
|
+
"line": 11466
|
|
159
159
|
},
|
|
160
160
|
"chainFormatters": {
|
|
161
161
|
"types": "dist/exporters/span-formatters.d.ts",
|
|
162
162
|
"implementation": "dist/index.js",
|
|
163
|
-
"line":
|
|
163
|
+
"line": 8378
|
|
164
164
|
},
|
|
165
165
|
"createClientObservabilityProxy": {
|
|
166
166
|
"types": "dist/client/proxy.d.ts",
|
|
167
167
|
"implementation": "dist/index.js",
|
|
168
|
-
"line":
|
|
168
|
+
"line": 7264
|
|
169
169
|
},
|
|
170
170
|
"decodeResourceLogs": {
|
|
171
171
|
"types": "dist/client/otlp.d.ts",
|
|
172
172
|
"implementation": "dist/index.js",
|
|
173
|
-
"line":
|
|
173
|
+
"line": 6966
|
|
174
174
|
},
|
|
175
175
|
"decodeResourceSpans": {
|
|
176
176
|
"types": "dist/client/otlp.d.ts",
|
|
177
177
|
"implementation": "dist/index.js",
|
|
178
|
-
"line":
|
|
178
|
+
"line": 6929
|
|
179
179
|
},
|
|
180
180
|
"deepClean": {
|
|
181
181
|
"types": "dist/spans/serialization.d.ts",
|
|
182
182
|
"implementation": "dist/index.js",
|
|
183
|
-
"line":
|
|
183
|
+
"line": 345
|
|
184
184
|
},
|
|
185
185
|
"formatBaggage": {
|
|
186
186
|
"types": "dist/client/w3c.d.ts",
|
|
187
187
|
"implementation": "dist/index.js",
|
|
188
|
-
"line":
|
|
188
|
+
"line": 7120
|
|
189
189
|
},
|
|
190
190
|
"formatTraceparent": {
|
|
191
191
|
"types": "dist/client/w3c.d.ts",
|
|
192
192
|
"implementation": "dist/index.js",
|
|
193
|
-
"line":
|
|
193
|
+
"line": 7083
|
|
194
194
|
},
|
|
195
195
|
"getExternalParentId": {
|
|
196
196
|
"types": "dist/spans/base.d.ts",
|
|
197
197
|
"implementation": "dist/index.js",
|
|
198
|
-
"line":
|
|
198
|
+
"line": 3522
|
|
199
199
|
},
|
|
200
200
|
"isSerializedMap": {
|
|
201
201
|
"types": "dist/spans/serialization.d.ts",
|
|
202
202
|
"implementation": "dist/index.js",
|
|
203
|
-
"line":
|
|
203
|
+
"line": 319
|
|
204
204
|
},
|
|
205
205
|
"mergeSerializationOptions": {
|
|
206
206
|
"types": "dist/spans/serialization.d.ts",
|
|
207
207
|
"implementation": "dist/index.js",
|
|
208
|
-
"line":
|
|
208
|
+
"line": 213
|
|
209
209
|
},
|
|
210
210
|
"observabilityConfigValueSchema": {
|
|
211
211
|
"types": "dist/config.d.ts",
|
|
212
212
|
"implementation": "dist/index.js",
|
|
213
|
-
"line":
|
|
213
|
+
"line": 824
|
|
214
214
|
},
|
|
215
215
|
"observabilityFeatures": {
|
|
216
216
|
"types": "dist/features.d.ts",
|
|
217
217
|
"implementation": "dist/index.js",
|
|
218
|
-
"line":
|
|
218
|
+
"line": 11447
|
|
219
219
|
},
|
|
220
220
|
"observabilityInstanceConfigSchema": {
|
|
221
221
|
"types": "dist/config.d.ts",
|
|
222
222
|
"implementation": "dist/index.js",
|
|
223
|
-
"line":
|
|
223
|
+
"line": 812
|
|
224
224
|
},
|
|
225
225
|
"observabilityRegistryConfigSchema": {
|
|
226
226
|
"types": "dist/config.d.ts",
|
|
227
227
|
"implementation": "dist/index.js",
|
|
228
|
-
"line":
|
|
228
|
+
"line": 844
|
|
229
229
|
},
|
|
230
230
|
"otlpSeverityToLogLevel": {
|
|
231
231
|
"types": "dist/client/otlp.d.ts",
|
|
232
232
|
"implementation": "dist/index.js",
|
|
233
|
-
"line":
|
|
233
|
+
"line": 7003
|
|
234
234
|
},
|
|
235
235
|
"parseBaggage": {
|
|
236
236
|
"types": "dist/client/w3c.d.ts",
|
|
237
237
|
"implementation": "dist/index.js",
|
|
238
|
-
"line":
|
|
238
|
+
"line": 7093
|
|
239
239
|
},
|
|
240
240
|
"parseTraceparent": {
|
|
241
241
|
"types": "dist/client/w3c.d.ts",
|
|
242
242
|
"implementation": "dist/index.js",
|
|
243
|
-
"line":
|
|
243
|
+
"line": 7069
|
|
244
244
|
},
|
|
245
245
|
"reconstructSerializedMap": {
|
|
246
246
|
"types": "dist/spans/serialization.d.ts",
|
|
247
247
|
"implementation": "dist/index.js",
|
|
248
|
-
"line":
|
|
248
|
+
"line": 322
|
|
249
249
|
},
|
|
250
250
|
"routeToHandler": {
|
|
251
251
|
"types": "dist/bus/route-event.d.ts",
|
|
@@ -255,17 +255,17 @@
|
|
|
255
255
|
"samplingStrategySchema": {
|
|
256
256
|
"types": "dist/config.d.ts",
|
|
257
257
|
"implementation": "dist/index.js",
|
|
258
|
-
"line":
|
|
258
|
+
"line": 755
|
|
259
259
|
},
|
|
260
260
|
"serializationOptionsSchema": {
|
|
261
261
|
"types": "dist/config.d.ts",
|
|
262
262
|
"implementation": "dist/index.js",
|
|
263
|
-
"line":
|
|
263
|
+
"line": 770
|
|
264
264
|
},
|
|
265
265
|
"truncateString": {
|
|
266
266
|
"types": "dist/spans/serialization.d.ts",
|
|
267
267
|
"implementation": "dist/index.js",
|
|
268
|
-
"line":
|
|
268
|
+
"line": 232
|
|
269
269
|
}
|
|
270
270
|
},
|
|
271
271
|
"modules": {}
|
|
@@ -16,7 +16,7 @@ Unlike metrics and scores, feedback is usually supplied by a person or review wo
|
|
|
16
16
|
|
|
17
17
|
## Add feedback
|
|
18
18
|
|
|
19
|
-
Use `mastra.observability.addFeedback()`
|
|
19
|
+
Use `mastra.observability.addFeedback()` to annotate a trace or span from app code. The helper is optional on the observability entrypoint, so check that the active observability implementation supports it. See the [client SDK observability reference](https://mastra.ai/reference/client-js/observability) for all client methods.
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
if (!mastra.observability.addFeedback) {
|
|
@@ -35,9 +35,9 @@ await mastra.observability.addFeedback({
|
|
|
35
35
|
})
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Feedback goes to each configured exporter that supports it. Each exporter handles its own destination independently. A trace missing from local storage doesn't prevent feedback from reaching Platform or another exporter.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
[`MastraStorageExporter`](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) looks up the trace or span in your configured storage before saving feedback. If the target remains unavailable after retries, it logs a warning and skips the local write. Call `mastra.observability.flush()` or `shutdown()` before your process exits to finish pending delivery.
|
|
41
41
|
|
|
42
42
|
## Find the trace for a message
|
|
43
43
|
|
|
@@ -185,11 +185,9 @@ The local runtime exposes the list route at `/api/observability/feedback` and an
|
|
|
185
185
|
|
|
186
186
|
## Export feedback to Mastra Platform
|
|
187
187
|
|
|
188
|
-
[`MastraPlatformExporter`](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter)
|
|
188
|
+
[`MastraPlatformExporter`](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter) sends feedback to Mastra Platform, which looks up the target trace or span when needed. Local trace storage isn't required. Add `MastraStorageExporter` only if you also want a local copy.
|
|
189
189
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
See [Observability on Mastra Platform](https://mastra.ai/docs/mastra-platform/observability) for the combined exporter configuration.
|
|
190
|
+
Studio sends feedback to the backend serving its trace reads. For HTTP creates handled by your OSS server, the server saves feedback locally and notifies configured exporters. Because exporter delivery is asynchronous, a successful HTTP response doesn't guarantee that the record is already visible at a remote destination. Direct storage writes bypass exporters.
|
|
193
191
|
|
|
194
192
|
## Export feedback to external platforms
|
|
195
193
|
|
|
@@ -33,7 +33,7 @@ await mastra.observability.addFeedback({
|
|
|
33
33
|
|
|
34
34
|
### `addFeedback(args)`
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Sends feedback about a trace or span to configured exporters.
|
|
37
37
|
|
|
38
38
|
```typescript
|
|
39
39
|
await mastra.observability.addFeedback?.({
|
|
@@ -56,7 +56,9 @@ await mastra.observability.addFeedback?.({
|
|
|
56
56
|
|
|
57
57
|
**feedback** (`FeedbackInput`): Feedback payload to add.
|
|
58
58
|
|
|
59
|
-
Without `correlationContext`,
|
|
59
|
+
Without `correlationContext`, each exporter handles the target trace or span at its own destination. `MastraStorageExporter` resolves it from local storage. A failed local lookup doesn't block other exporters. `MastraPlatformExporter` doesn't require local storage. Use `flush()` or `shutdown()` to drain pending deliveries.
|
|
60
|
+
|
|
61
|
+
Local lookup requires the target span's parent chain through its root so feedback inherits the correct root tags. If any ancestor remains missing after retries, the storage exporter logs a warning and skips the local write. Other exporters still receive the feedback.
|
|
60
62
|
|
|
61
63
|
### `createFeedback(args)`
|
|
62
64
|
|
|
@@ -138,7 +140,7 @@ await mastraClient.deleteFeedback({
|
|
|
138
140
|
|
|
139
141
|
**resourceId** (`string`): Restricts the delete to records with this resource id.
|
|
140
142
|
|
|
141
|
-
|
|
143
|
+
The OSS HTTP route returns `{ success: boolean }`. `mastraClient.deleteFeedback()` returns `Promise<{ success: boolean } | { accepted: true }>` to also support Platform backends with queued batch deletion. An accepted response means cleanup is queued, and records can remain readable until cleanup runs. See [client deletion response handling](https://mastra.ai/reference/client-js/observability). The storage domain method returns `Promise<void>`. Requests with more than 1,000 ids return `400`, and a server running `@mastra/core` older than `1.66.0` returns `501`. ClickHouse vNext, PostgreSQL vNext, DuckDB, and the in-memory store implement deletion. Every other adapter, including LibSQL and MongoDB, throws `OBSERVABILITY_STORAGE_DELETE_FEEDBACK_NOT_IMPLEMENTED`.
|
|
142
144
|
|
|
143
145
|
On ClickHouse, deletion uses lightweight deletes on the main feedback events table to remove rows from reads, including OLAP queries, without guaranteeing immediate physical removal, so open-source deployments must configure an [observability retention period](https://mastra.ai/reference/storage/retention) to physically purge them. Each request is marked applied once its delete succeeds; if the delete fails, the request stays unapplied, doesn't block `updateFeedbackReviewStatus()` on the still-visible feedback, and you retry by calling `deleteFeedback()` again. `updateFeedbackReviewStatus()` also retries the delete and throws a not-found error if the retry succeeds, or saves the new status and throws the delete's error if it fails again. Open-source deployments have no background reconciler. ClickHouse applies a TTL to deletion requests only when all five signals have finite retention. See [ClickHouse native TTL](https://mastra.ai/reference/storage/retention). Delete APIs leave the separate delta cursor table untouched. Its rows contain identifiers rather than feedback payloads and expire within two days.
|
|
144
146
|
|
|
@@ -413,21 +415,48 @@ Use `FeedbackFilter` in `listFeedback()` and OLAP query `filters`.
|
|
|
413
415
|
|
|
414
416
|
**tags** (`string[]`): Filter by tags. Matching records must have all specified tags.
|
|
415
417
|
|
|
418
|
+
## Replace feedback
|
|
419
|
+
|
|
420
|
+
`PUT /api/observability/feedback/:feedbackId` accepts a full `{ feedback: { ... } }` replacement. Keep the original `feedbackId`, `traceId`, and `timestamp`, and include every field you want to retain. Omitted optional fields are cleared. The URL and body IDs must match. See [the client example](https://mastra.ai/reference/client-js/observability).
|
|
421
|
+
|
|
422
|
+
OSS writes to its configured storage before returning success and notifies supporting exporters independently. `contextMode` has the same meaning as on create. In `"resolve"` mode, the local trace or span must exist. A missing feedback record is created from the full replacement. Changing an existing record's trace or timestamp returns `409`.
|
|
423
|
+
|
|
424
|
+
In-memory, PostgreSQL vNext, DuckDB, and ClickHouse vNext storage support replacement. Check `capabilities.feedbackReplacement` on the server. Unsupported versions return `501`. Sequential retries of the original HTTP create don't undo a replacement. Direct storage `createFeedback()` calls retain upsert behavior. Pass `onConflict: 'ignore'` to keep an existing record.
|
|
425
|
+
|
|
426
|
+
ClickHouse support uses the existing schema without a migration. Concurrent writes from separate processes can race, so it doesn't guarantee ordering between overlapping creates and replacements. Serialize edits to the same feedback record when using this adapter.
|
|
427
|
+
|
|
428
|
+
To send a replacement to configured exporters without depending on local storage, use the observability entrypoint:
|
|
429
|
+
|
|
430
|
+
```typescript
|
|
431
|
+
await mastra.observability.replaceFeedback?.({
|
|
432
|
+
traceId: 'trace-123',
|
|
433
|
+
feedback: {
|
|
434
|
+
feedbackId: 'feedback-1',
|
|
435
|
+
timestamp: new Date('2026-11-11T12:00:00.123Z'),
|
|
436
|
+
feedbackType: 'thumbs',
|
|
437
|
+
value: -1,
|
|
438
|
+
},
|
|
439
|
+
})
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
Each exporter handles its destination independently. `MastraStorageExporter` resolves local span context when needed, and `MastraPlatformExporter` sends a PUT to Platform. Exporters without a replacement handler skip the event. `flush()` and `shutdown()` wait for pending deliveries.
|
|
443
|
+
|
|
416
444
|
## HTTP routes
|
|
417
445
|
|
|
418
446
|
These routes belong to a Mastra runtime and use its configured observability storage. They're separate from the [unversioned Mastra Platform Feedback API](https://mastra.ai/docs/mastra-platform/api), which doesn't provide a feedback creation route.
|
|
419
447
|
|
|
420
|
-
| Method | Path | Purpose
|
|
421
|
-
| -------- | ------------------------------------------------------- |
|
|
422
|
-
| `GET` | `/api/observability/feedback` | List feedback records
|
|
423
|
-
| `POST` | `/api/observability/feedback` | Create a feedback record
|
|
424
|
-
| `
|
|
425
|
-
| `DELETE` | `/api/observability/
|
|
426
|
-
| `
|
|
427
|
-
| `
|
|
428
|
-
| `POST` | `/api/observability/feedback/
|
|
429
|
-
| `POST` | `/api/observability/feedback/
|
|
430
|
-
| `POST` | `/api/observability/feedback/
|
|
448
|
+
| Method | Path | Purpose | Permission |
|
|
449
|
+
| -------- | ------------------------------------------------------- | ---------------------------------- | ---------------------- |
|
|
450
|
+
| `GET` | `/api/observability/feedback` | List feedback records | `observability:read` |
|
|
451
|
+
| `POST` | `/api/observability/feedback` | Create a feedback record | `observability:write` |
|
|
452
|
+
| `PUT` | `/api/observability/feedback/:feedbackId` | Replace a complete feedback record | `observability:write` |
|
|
453
|
+
| `DELETE` | `/api/observability/feedback` | Delete feedback records by id | `observability:delete` |
|
|
454
|
+
| `DELETE` | `/api/observability/scores` | Delete score records by id | `observability:delete` |
|
|
455
|
+
| `PATCH` | `/api/observability/feedback/:feedbackId/review-status` | Update review status | `observability:write` |
|
|
456
|
+
| `POST` | `/api/observability/feedback/aggregate` | Return one aggregate value | `observability:read` |
|
|
457
|
+
| `POST` | `/api/observability/feedback/breakdown` | Group feedback by dimensions | `observability:read` |
|
|
458
|
+
| `POST` | `/api/observability/feedback/timeseries` | Bucket feedback by interval | `observability:read` |
|
|
459
|
+
| `POST` | `/api/observability/feedback/percentiles` | Return percentile series | `observability:read` |
|
|
431
460
|
|
|
432
461
|
### List query parameters
|
|
433
462
|
|