@mastra/observability 1.24.0-alpha.3 → 1.24.0-alpha.4
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/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +35 -35
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/metrics/pricing-data.json +279 -101
- package/dist/model-tracing.d.ts.map +1 -1
- package/package.json +2 -2
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.4"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.24.0-alpha.
|
|
2
|
+
"version": "1.24.0-alpha.4",
|
|
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": 4249
|
|
9
9
|
},
|
|
10
10
|
"BaseObservabilityEventBus": {
|
|
11
11
|
"types": "dist/bus/base.d.ts",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"BaseObservabilityInstance": {
|
|
16
16
|
"types": "dist/instances/base.d.ts",
|
|
17
17
|
"implementation": "dist/index.js",
|
|
18
|
-
"line":
|
|
18
|
+
"line": 5725
|
|
19
19
|
},
|
|
20
20
|
"BaseSpan": {
|
|
21
21
|
"types": "dist/spans/base.d.ts",
|
|
22
22
|
"implementation": "dist/index.js",
|
|
23
|
-
"line":
|
|
23
|
+
"line": 3534
|
|
24
24
|
},
|
|
25
25
|
"CardinalityFilter": {
|
|
26
26
|
"types": "dist/metrics/cardinality.d.ts",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"CloudExporter": {
|
|
31
31
|
"types": "dist/exporters/cloud.d.ts",
|
|
32
32
|
"implementation": "dist/index.js",
|
|
33
|
-
"line":
|
|
33
|
+
"line": 8144
|
|
34
34
|
},
|
|
35
35
|
"ConsoleExporter": {
|
|
36
36
|
"types": "dist/exporters/console.d.ts",
|
|
37
37
|
"implementation": "dist/index.js",
|
|
38
|
-
"line":
|
|
38
|
+
"line": 8467
|
|
39
39
|
},
|
|
40
40
|
"DEFAULT_DEEP_CLEAN_OPTIONS": {
|
|
41
41
|
"types": "dist/spans/serialization.d.ts",
|
|
@@ -45,27 +45,27 @@
|
|
|
45
45
|
"DEFAULT_LIMITS": {
|
|
46
46
|
"types": "dist/client/proxy.d.ts",
|
|
47
47
|
"implementation": "dist/index.js",
|
|
48
|
-
"line":
|
|
48
|
+
"line": 6710
|
|
49
49
|
},
|
|
50
50
|
"DefaultExporter": {
|
|
51
51
|
"types": "dist/exporters/default.d.ts",
|
|
52
52
|
"implementation": "dist/index.js",
|
|
53
|
-
"line":
|
|
53
|
+
"line": 4631
|
|
54
54
|
},
|
|
55
55
|
"DefaultObservabilityInstance": {
|
|
56
56
|
"types": "dist/instances/default.d.ts",
|
|
57
57
|
"implementation": "dist/index.js",
|
|
58
|
-
"line":
|
|
58
|
+
"line": 10294
|
|
59
59
|
},
|
|
60
60
|
"DefaultSpan": {
|
|
61
61
|
"types": "dist/spans/default.d.ts",
|
|
62
62
|
"implementation": "dist/index.js",
|
|
63
|
-
"line":
|
|
63
|
+
"line": 4020
|
|
64
64
|
},
|
|
65
65
|
"JsonExporter": {
|
|
66
66
|
"types": "dist/exporters/test.d.ts",
|
|
67
67
|
"implementation": "dist/index.js",
|
|
68
|
-
"line":
|
|
68
|
+
"line": 10292
|
|
69
69
|
},
|
|
70
70
|
"LoggerContextImpl": {
|
|
71
71
|
"types": "dist/context/logger.d.ts",
|
|
@@ -75,12 +75,12 @@
|
|
|
75
75
|
"MastraPlatformExporter": {
|
|
76
76
|
"types": "dist/exporters/mastra-platform.d.ts",
|
|
77
77
|
"implementation": "dist/index.js",
|
|
78
|
-
"line":
|
|
78
|
+
"line": 8762
|
|
79
79
|
},
|
|
80
80
|
"MastraStorageExporter": {
|
|
81
81
|
"types": "dist/exporters/mastra-storage.d.ts",
|
|
82
82
|
"implementation": "dist/index.js",
|
|
83
|
-
"line":
|
|
83
|
+
"line": 5150
|
|
84
84
|
},
|
|
85
85
|
"MetricsContextImpl": {
|
|
86
86
|
"types": "dist/context/metrics.d.ts",
|
|
@@ -95,17 +95,17 @@
|
|
|
95
95
|
"NoOpSpan": {
|
|
96
96
|
"types": "dist/spans/no-op.d.ts",
|
|
97
97
|
"implementation": "dist/index.js",
|
|
98
|
-
"line":
|
|
98
|
+
"line": 4192
|
|
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": 8663
|
|
104
104
|
},
|
|
105
105
|
"Observability": {
|
|
106
106
|
"types": "dist/default.d.ts",
|
|
107
107
|
"implementation": "dist/index.js",
|
|
108
|
-
"line":
|
|
108
|
+
"line": 10951
|
|
109
109
|
},
|
|
110
110
|
"ObservabilityBus": {
|
|
111
111
|
"types": "dist/bus/observability-bus.d.ts",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"QUOTA_PAUSE_CAPABILITY": {
|
|
116
116
|
"types": "dist/exporters/mastra-platform.d.ts",
|
|
117
117
|
"implementation": "dist/index.js",
|
|
118
|
-
"line":
|
|
118
|
+
"line": 8664
|
|
119
119
|
},
|
|
120
120
|
"SamplingStrategyType": {
|
|
121
121
|
"types": "dist/config.d.ts",
|
|
@@ -125,57 +125,57 @@
|
|
|
125
125
|
"SensitiveDataFilter": {
|
|
126
126
|
"types": "dist/span_processors/sensitive-data-filter.d.ts",
|
|
127
127
|
"implementation": "dist/index.js",
|
|
128
|
-
"line":
|
|
128
|
+
"line": 10721
|
|
129
129
|
},
|
|
130
130
|
"TestExporter": {
|
|
131
131
|
"types": "dist/exporters/test.d.ts",
|
|
132
132
|
"implementation": "dist/index.js",
|
|
133
|
-
"line":
|
|
133
|
+
"line": 9307
|
|
134
134
|
},
|
|
135
135
|
"TraceData": {
|
|
136
136
|
"types": "dist/exporters/tracking.d.ts",
|
|
137
137
|
"implementation": "dist/index.js",
|
|
138
|
-
"line":
|
|
138
|
+
"line": 6863
|
|
139
139
|
},
|
|
140
140
|
"TrackingExporter": {
|
|
141
141
|
"types": "dist/exporters/tracking.d.ts",
|
|
142
142
|
"implementation": "dist/index.js",
|
|
143
|
-
"line":
|
|
143
|
+
"line": 7192
|
|
144
144
|
},
|
|
145
145
|
"buildExportedLog": {
|
|
146
146
|
"types": "dist/client/otlp.d.ts",
|
|
147
147
|
"implementation": "dist/index.js",
|
|
148
|
-
"line":
|
|
148
|
+
"line": 6627
|
|
149
149
|
},
|
|
150
150
|
"buildExportedSpan": {
|
|
151
151
|
"types": "dist/client/otlp.d.ts",
|
|
152
152
|
"implementation": "dist/index.js",
|
|
153
|
-
"line":
|
|
153
|
+
"line": 6609
|
|
154
154
|
},
|
|
155
155
|
"buildTracingOptions": {
|
|
156
156
|
"types": "dist/tracing-options.d.ts",
|
|
157
157
|
"implementation": "dist/index.js",
|
|
158
|
-
"line":
|
|
158
|
+
"line": 11296
|
|
159
159
|
},
|
|
160
160
|
"chainFormatters": {
|
|
161
161
|
"types": "dist/exporters/span-formatters.d.ts",
|
|
162
162
|
"implementation": "dist/index.js",
|
|
163
|
-
"line":
|
|
163
|
+
"line": 7958
|
|
164
164
|
},
|
|
165
165
|
"createClientObservabilityProxy": {
|
|
166
166
|
"types": "dist/client/proxy.d.ts",
|
|
167
167
|
"implementation": "dist/index.js",
|
|
168
|
-
"line":
|
|
168
|
+
"line": 6844
|
|
169
169
|
},
|
|
170
170
|
"decodeResourceLogs": {
|
|
171
171
|
"types": "dist/client/otlp.d.ts",
|
|
172
172
|
"implementation": "dist/index.js",
|
|
173
|
-
"line":
|
|
173
|
+
"line": 6546
|
|
174
174
|
},
|
|
175
175
|
"decodeResourceSpans": {
|
|
176
176
|
"types": "dist/client/otlp.d.ts",
|
|
177
177
|
"implementation": "dist/index.js",
|
|
178
|
-
"line":
|
|
178
|
+
"line": 6509
|
|
179
179
|
},
|
|
180
180
|
"deepClean": {
|
|
181
181
|
"types": "dist/spans/serialization.d.ts",
|
|
@@ -185,17 +185,17 @@
|
|
|
185
185
|
"formatBaggage": {
|
|
186
186
|
"types": "dist/client/w3c.d.ts",
|
|
187
187
|
"implementation": "dist/index.js",
|
|
188
|
-
"line":
|
|
188
|
+
"line": 6700
|
|
189
189
|
},
|
|
190
190
|
"formatTraceparent": {
|
|
191
191
|
"types": "dist/client/w3c.d.ts",
|
|
192
192
|
"implementation": "dist/index.js",
|
|
193
|
-
"line":
|
|
193
|
+
"line": 6663
|
|
194
194
|
},
|
|
195
195
|
"getExternalParentId": {
|
|
196
196
|
"types": "dist/spans/base.d.ts",
|
|
197
197
|
"implementation": "dist/index.js",
|
|
198
|
-
"line":
|
|
198
|
+
"line": 3515
|
|
199
199
|
},
|
|
200
200
|
"isSerializedMap": {
|
|
201
201
|
"types": "dist/spans/serialization.d.ts",
|
|
@@ -215,7 +215,7 @@
|
|
|
215
215
|
"observabilityFeatures": {
|
|
216
216
|
"types": "dist/features.d.ts",
|
|
217
217
|
"implementation": "dist/index.js",
|
|
218
|
-
"line":
|
|
218
|
+
"line": 11277
|
|
219
219
|
},
|
|
220
220
|
"observabilityInstanceConfigSchema": {
|
|
221
221
|
"types": "dist/config.d.ts",
|
|
@@ -230,17 +230,17 @@
|
|
|
230
230
|
"otlpSeverityToLogLevel": {
|
|
231
231
|
"types": "dist/client/otlp.d.ts",
|
|
232
232
|
"implementation": "dist/index.js",
|
|
233
|
-
"line":
|
|
233
|
+
"line": 6583
|
|
234
234
|
},
|
|
235
235
|
"parseBaggage": {
|
|
236
236
|
"types": "dist/client/w3c.d.ts",
|
|
237
237
|
"implementation": "dist/index.js",
|
|
238
|
-
"line":
|
|
238
|
+
"line": 6673
|
|
239
239
|
},
|
|
240
240
|
"parseTraceparent": {
|
|
241
241
|
"types": "dist/client/w3c.d.ts",
|
|
242
242
|
"implementation": "dist/index.js",
|
|
243
|
-
"line":
|
|
243
|
+
"line": 6649
|
|
244
244
|
},
|
|
245
245
|
"reconstructSerializedMap": {
|
|
246
246
|
"types": "dist/spans/serialization.d.ts",
|
package/dist/index.cjs
CHANGED
|
@@ -3252,11 +3252,22 @@ var ModelSpanTracker = class {
|
|
|
3252
3252
|
* create MODEL_STEP and MODEL_CHUNK spans for each semantic unit in the stream.
|
|
3253
3253
|
*/
|
|
3254
3254
|
wrapStream(stream, inferenceOnly = false) {
|
|
3255
|
+
let servedModelId;
|
|
3255
3256
|
return stream.pipeThrough(new stream_web.TransformStream({ transform: (chunk, controller) => {
|
|
3256
3257
|
if (inferenceOnly) {
|
|
3257
3258
|
try {
|
|
3259
|
+
if (chunk.type === "response-metadata" && typeof chunk.payload?.modelId === "string") servedModelId = chunk.payload.modelId;
|
|
3258
3260
|
if (MODEL_RESPONSE_CHUNK_TYPES.has(chunk.type)) this.#captureCompletionStartTime();
|
|
3259
|
-
if (chunk.type === "finish")
|
|
3261
|
+
if (chunk.type === "finish") {
|
|
3262
|
+
const payload = servedModelId && !chunk.payload?.metadata?.modelId ? {
|
|
3263
|
+
...chunk.payload,
|
|
3264
|
+
metadata: {
|
|
3265
|
+
...chunk.payload?.metadata,
|
|
3266
|
+
modelId: servedModelId
|
|
3267
|
+
}
|
|
3268
|
+
} : chunk.payload;
|
|
3269
|
+
this.#endInferenceSpan(payload, false);
|
|
3270
|
+
}
|
|
3260
3271
|
} catch {}
|
|
3261
3272
|
controller.enqueue(chunk);
|
|
3262
3273
|
return;
|