@mastra/observability 1.24.1 → 1.24.2
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 +2 -2
- package/dist/docs/assets/SOURCE_MAP.json +38 -38
- package/dist/docs/references/docs-observability-integrations-exporters-mastra-storage.md +13 -13
- package/dist/docs/references/docs-observability-overview.md +2 -2
- package/dist/docs/references/docs-observability-tracing-overview.md +4 -2
- package/dist/docs/references/docs-studio-observability.md +3 -3
- package/dist/docs/references/integrations-observability-arize.md +9 -9
- package/dist/docs/references/integrations-observability-arthur.md +3 -3
- package/dist/docs/references/integrations-observability-braintrust.md +3 -3
- package/dist/docs/references/integrations-observability-confident-ai.md +5 -5
- package/dist/docs/references/integrations-observability-datadog.md +9 -9
- package/dist/docs/references/integrations-observability-laminar.md +2 -2
- package/dist/docs/references/integrations-observability-langfuse.md +14 -14
- package/dist/docs/references/integrations-observability-langsmith.md +9 -9
- package/dist/docs/references/integrations-observability-opentelemetry.md +23 -23
- package/dist/docs/references/integrations-observability-sentry.md +4 -4
- package/dist/docs/references/reference-observability-tracing-bridges-datadog.md +4 -4
- package/dist/docs/references/reference-observability-tracing-bridges-otel.md +4 -4
- package/dist/docs/references/reference-observability-tracing-exporters-cloud-exporter.md +2 -2
- package/dist/docs/references/reference-observability-tracing-exporters-console-exporter.md +1 -1
- package/dist/docs/references/reference-observability-tracing-exporters-datadog.md +3 -3
- package/dist/docs/references/reference-observability-tracing-exporters-default-exporter.md +5 -5
- package/dist/docs/references/reference-observability-tracing-exporters-langfuse.md +3 -3
- package/dist/docs/references/reference-observability-tracing-exporters-mastra-platform-exporter.md +1 -1
- package/dist/docs/references/reference-observability-tracing-exporters-mastra-storage-exporter.md +5 -5
- package/dist/docs/references/reference-observability-tracing-exporters-sentry.md +4 -4
- package/dist/exporters/test.d.ts.map +1 -1
- package/dist/index.cjs +10 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/instances/base.d.ts.map +1 -1
- package/dist/metrics/pricing-data.json +13587 -4600
- package/dist/model-tracing.d.ts.map +1 -1
- package/package.json +6 -6
- /package/dist/docs/references/{docs-mastra-platform-observability.md → docs-mastra-platform-observability-overview.md} +0 -0
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.
|
|
6
|
+
version: "1.24.2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -16,7 +16,7 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
16
16
|
|
|
17
17
|
### Docs
|
|
18
18
|
|
|
19
|
-
- [Observability](references/docs-mastra-platform-observability.md) - Collect, import, and query hosted traces, logs, metrics, scores, and feedback from Mastra applications with Mastra Platform Observability and local fallback storage.
|
|
19
|
+
- [Observability](references/docs-mastra-platform-observability-overview.md) - Collect, import, and query hosted traces, logs, metrics, scores, and feedback from Mastra applications with Mastra Platform Observability and local fallback storage.
|
|
20
20
|
- [Feedback](references/docs-observability-feedback.md) - Create, list, delete, aggregate, and export human feedback records in Mastra observability, with ratings and comments linked to specific traces and spans.
|
|
21
21
|
- [Storage exporter](references/docs-observability-integrations-exporters-mastra-storage.md) - Persist Mastra traces and metrics with MastraStorageExporter, choose a storage provider and tracing strategy, and inspect observability data in Studio.
|
|
22
22
|
- [Logging](references/docs-observability-logging.md) - Configure structured Mastra logging with PinoLogger, trace correlation, observability storage, custom logger adapters, log levels, and query APIs.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.24.
|
|
2
|
+
"version": "1.24.2",
|
|
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": 4317
|
|
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": 6351
|
|
19
19
|
},
|
|
20
20
|
"BaseSpan": {
|
|
21
21
|
"types": "dist/spans/base.d.ts",
|
|
22
22
|
"implementation": "dist/index.js",
|
|
23
|
-
"line":
|
|
23
|
+
"line": 3578
|
|
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": 8797
|
|
34
34
|
},
|
|
35
35
|
"ConsoleExporter": {
|
|
36
36
|
"types": "dist/exporters/console.d.ts",
|
|
37
37
|
"implementation": "dist/index.js",
|
|
38
|
-
"line":
|
|
38
|
+
"line": 9120
|
|
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": 7355
|
|
49
49
|
},
|
|
50
50
|
"DefaultExporter": {
|
|
51
51
|
"types": "dist/exporters/default.d.ts",
|
|
52
52
|
"implementation": "dist/index.js",
|
|
53
|
-
"line":
|
|
53
|
+
"line": 5132
|
|
54
54
|
},
|
|
55
55
|
"DefaultObservabilityInstance": {
|
|
56
56
|
"types": "dist/instances/default.d.ts",
|
|
57
57
|
"implementation": "dist/index.js",
|
|
58
|
-
"line":
|
|
58
|
+
"line": 11053
|
|
59
59
|
},
|
|
60
60
|
"DefaultSpan": {
|
|
61
61
|
"types": "dist/spans/default.d.ts",
|
|
62
62
|
"implementation": "dist/index.js",
|
|
63
|
-
"line":
|
|
63
|
+
"line": 4084
|
|
64
64
|
},
|
|
65
65
|
"JsonExporter": {
|
|
66
66
|
"types": "dist/exporters/test.d.ts",
|
|
67
67
|
"implementation": "dist/index.js",
|
|
68
|
-
"line":
|
|
68
|
+
"line": 11051
|
|
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": 9450
|
|
79
79
|
},
|
|
80
80
|
"MastraStorageExporter": {
|
|
81
81
|
"types": "dist/exporters/mastra-storage.d.ts",
|
|
82
82
|
"implementation": "dist/index.js",
|
|
83
|
-
"line":
|
|
83
|
+
"line": 5697
|
|
84
84
|
},
|
|
85
85
|
"MetricsContextImpl": {
|
|
86
86
|
"types": "dist/context/metrics.d.ts",
|
|
@@ -90,22 +90,22 @@
|
|
|
90
90
|
"ModelSpanTracker": {
|
|
91
91
|
"types": "dist/model-tracing.d.ts",
|
|
92
92
|
"implementation": "dist/index.js",
|
|
93
|
-
"line":
|
|
93
|
+
"line": 2524
|
|
94
94
|
},
|
|
95
95
|
"NoOpSpan": {
|
|
96
96
|
"types": "dist/spans/no-op.d.ts",
|
|
97
97
|
"implementation": "dist/index.js",
|
|
98
|
-
"line":
|
|
98
|
+
"line": 4260
|
|
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": 9351
|
|
104
104
|
},
|
|
105
105
|
"Observability": {
|
|
106
106
|
"types": "dist/default.d.ts",
|
|
107
107
|
"implementation": "dist/index.js",
|
|
108
|
-
"line":
|
|
108
|
+
"line": 11389
|
|
109
109
|
},
|
|
110
110
|
"ObservabilityBus": {
|
|
111
111
|
"types": "dist/bus/observability-bus.d.ts",
|
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
"QUOTA_PAUSE_CAPABILITY": {
|
|
116
116
|
"types": "dist/exporters/mastra-platform.d.ts",
|
|
117
117
|
"implementation": "dist/index.js",
|
|
118
|
-
"line":
|
|
118
|
+
"line": 9352
|
|
119
119
|
},
|
|
120
120
|
"REDACTED_ERROR_MESSAGE": {
|
|
121
121
|
"types": "dist/spans/base.d.ts",
|
|
122
122
|
"implementation": "dist/index.js",
|
|
123
|
-
"line":
|
|
123
|
+
"line": 3439
|
|
124
124
|
},
|
|
125
125
|
"SamplingStrategyType": {
|
|
126
126
|
"types": "dist/config.d.ts",
|
|
@@ -130,57 +130,57 @@
|
|
|
130
130
|
"SensitiveDataFilter": {
|
|
131
131
|
"types": "dist/span_processors/sensitive-data-filter.d.ts",
|
|
132
132
|
"implementation": "dist/index.js",
|
|
133
|
-
"line":
|
|
133
|
+
"line": 11176
|
|
134
134
|
},
|
|
135
135
|
"TestExporter": {
|
|
136
136
|
"types": "dist/exporters/test.d.ts",
|
|
137
137
|
"implementation": "dist/index.js",
|
|
138
|
-
"line":
|
|
138
|
+
"line": 10061
|
|
139
139
|
},
|
|
140
140
|
"TraceData": {
|
|
141
141
|
"types": "dist/exporters/tracking.d.ts",
|
|
142
142
|
"implementation": "dist/index.js",
|
|
143
|
-
"line":
|
|
143
|
+
"line": 7516
|
|
144
144
|
},
|
|
145
145
|
"TrackingExporter": {
|
|
146
146
|
"types": "dist/exporters/tracking.d.ts",
|
|
147
147
|
"implementation": "dist/index.js",
|
|
148
|
-
"line":
|
|
148
|
+
"line": 7845
|
|
149
149
|
},
|
|
150
150
|
"buildExportedLog": {
|
|
151
151
|
"types": "dist/client/otlp.d.ts",
|
|
152
152
|
"implementation": "dist/index.js",
|
|
153
|
-
"line":
|
|
153
|
+
"line": 7272
|
|
154
154
|
},
|
|
155
155
|
"buildExportedSpan": {
|
|
156
156
|
"types": "dist/client/otlp.d.ts",
|
|
157
157
|
"implementation": "dist/index.js",
|
|
158
|
-
"line":
|
|
158
|
+
"line": 7254
|
|
159
159
|
},
|
|
160
160
|
"buildTracingOptions": {
|
|
161
161
|
"types": "dist/tracing-options.d.ts",
|
|
162
162
|
"implementation": "dist/index.js",
|
|
163
|
-
"line":
|
|
163
|
+
"line": 11730
|
|
164
164
|
},
|
|
165
165
|
"chainFormatters": {
|
|
166
166
|
"types": "dist/exporters/span-formatters.d.ts",
|
|
167
167
|
"implementation": "dist/index.js",
|
|
168
|
-
"line":
|
|
168
|
+
"line": 8611
|
|
169
169
|
},
|
|
170
170
|
"createClientObservabilityProxy": {
|
|
171
171
|
"types": "dist/client/proxy.d.ts",
|
|
172
172
|
"implementation": "dist/index.js",
|
|
173
|
-
"line":
|
|
173
|
+
"line": 7497
|
|
174
174
|
},
|
|
175
175
|
"decodeResourceLogs": {
|
|
176
176
|
"types": "dist/client/otlp.d.ts",
|
|
177
177
|
"implementation": "dist/index.js",
|
|
178
|
-
"line":
|
|
178
|
+
"line": 7191
|
|
179
179
|
},
|
|
180
180
|
"decodeResourceSpans": {
|
|
181
181
|
"types": "dist/client/otlp.d.ts",
|
|
182
182
|
"implementation": "dist/index.js",
|
|
183
|
-
"line":
|
|
183
|
+
"line": 7153
|
|
184
184
|
},
|
|
185
185
|
"deepClean": {
|
|
186
186
|
"types": "dist/spans/serialization.d.ts",
|
|
@@ -190,17 +190,17 @@
|
|
|
190
190
|
"formatBaggage": {
|
|
191
191
|
"types": "dist/client/w3c.d.ts",
|
|
192
192
|
"implementation": "dist/index.js",
|
|
193
|
-
"line":
|
|
193
|
+
"line": 7345
|
|
194
194
|
},
|
|
195
195
|
"formatTraceparent": {
|
|
196
196
|
"types": "dist/client/w3c.d.ts",
|
|
197
197
|
"implementation": "dist/index.js",
|
|
198
|
-
"line":
|
|
198
|
+
"line": 7308
|
|
199
199
|
},
|
|
200
200
|
"getExternalParentId": {
|
|
201
201
|
"types": "dist/spans/base.d.ts",
|
|
202
202
|
"implementation": "dist/index.js",
|
|
203
|
-
"line":
|
|
203
|
+
"line": 3559
|
|
204
204
|
},
|
|
205
205
|
"isSerializedMap": {
|
|
206
206
|
"types": "dist/spans/serialization.d.ts",
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
"observabilityFeatures": {
|
|
221
221
|
"types": "dist/features.d.ts",
|
|
222
222
|
"implementation": "dist/index.js",
|
|
223
|
-
"line":
|
|
223
|
+
"line": 11711
|
|
224
224
|
},
|
|
225
225
|
"observabilityInstanceConfigSchema": {
|
|
226
226
|
"types": "dist/config.d.ts",
|
|
@@ -235,17 +235,17 @@
|
|
|
235
235
|
"otlpSeverityToLogLevel": {
|
|
236
236
|
"types": "dist/client/otlp.d.ts",
|
|
237
237
|
"implementation": "dist/index.js",
|
|
238
|
-
"line":
|
|
238
|
+
"line": 7228
|
|
239
239
|
},
|
|
240
240
|
"parseBaggage": {
|
|
241
241
|
"types": "dist/client/w3c.d.ts",
|
|
242
242
|
"implementation": "dist/index.js",
|
|
243
|
-
"line":
|
|
243
|
+
"line": 7318
|
|
244
244
|
},
|
|
245
245
|
"parseTraceparent": {
|
|
246
246
|
"types": "dist/client/w3c.d.ts",
|
|
247
247
|
"implementation": "dist/index.js",
|
|
248
|
-
"line":
|
|
248
|
+
"line": 7294
|
|
249
249
|
},
|
|
250
250
|
"reconstructSerializedMap": {
|
|
251
251
|
"types": "dist/spans/serialization.d.ts",
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
"redactErrorInfo": {
|
|
256
256
|
"types": "dist/spans/base.d.ts",
|
|
257
257
|
"implementation": "dist/index.js",
|
|
258
|
-
"line":
|
|
258
|
+
"line": 3445
|
|
259
259
|
},
|
|
260
260
|
"routeToHandler": {
|
|
261
261
|
"types": "dist/bus/route-event.d.ts",
|
|
@@ -8,7 +8,7 @@ The `MastraStorageExporter` persists traces to your configured storage backend,
|
|
|
8
8
|
|
|
9
9
|
> **Note:** `MastraStorageExporter` was previously called `DefaultExporter`. The original `DefaultExporter` class is still exported from `@mastra/observability` for backward compatibility, but it's deprecated. New code should use `MastraStorageExporter`.
|
|
10
10
|
|
|
11
|
-
> **Production Observability:** Observability data can
|
|
11
|
+
> **Production Observability:** Observability data can overwhelm general-purpose databases in production. For high-traffic applications, route the observability storage domain to [ClickHouse](https://mastra.ai/integrations/databases/clickhouse) through [composite storage](https://mastra.ai/reference/storage/composite). See [Production Recommendations](#production-recommendations) for details.
|
|
12
12
|
|
|
13
13
|
## Configuration
|
|
14
14
|
|
|
@@ -17,7 +17,7 @@ The `MastraStorageExporter` persists traces to your configured storage backend,
|
|
|
17
17
|
1. **Storage Backend**: Configure a storage provider (libSQL, PostgreSQL, etc.)
|
|
18
18
|
2. **Studio**: Install for viewing traces locally
|
|
19
19
|
|
|
20
|
-
### Basic
|
|
20
|
+
### Basic setup
|
|
21
21
|
|
|
22
22
|
```typescript
|
|
23
23
|
import { Mastra } from '@mastra/core'
|
|
@@ -40,7 +40,7 @@ export const mastra = new Mastra({
|
|
|
40
40
|
})
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
### Recommended
|
|
43
|
+
### Recommended configuration
|
|
44
44
|
|
|
45
45
|
Include MastraStorageExporter in your observability configuration:
|
|
46
46
|
|
|
@@ -128,7 +128,7 @@ Access your traces through Studio:
|
|
|
128
128
|
|
|
129
129
|
MastraStorageExporter automatically selects the optimal tracing strategy based on your storage provider. You can also override this selection if needed.
|
|
130
130
|
|
|
131
|
-
### Available
|
|
131
|
+
### Available strategies
|
|
132
132
|
|
|
133
133
|
| Strategy | Description | Use Case |
|
|
134
134
|
| ---------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------------- |
|
|
@@ -139,7 +139,7 @@ MastraStorageExporter automatically selects the optimal tracing strategy based o
|
|
|
139
139
|
|
|
140
140
|
> **Note:** `realtime` assumes one process owns a span from start to end, so it isn't supported with durable execution (durable agents, and Inngest, Temporal, or evented workflows). When any of these is registered, the exporter logs one warning and runs `batch-with-updates`.
|
|
141
141
|
|
|
142
|
-
### Strategy
|
|
142
|
+
### Strategy configuration
|
|
143
143
|
|
|
144
144
|
```typescript
|
|
145
145
|
new MastraStorageExporter({
|
|
@@ -160,7 +160,7 @@ Different storage providers support different tracing strategies. Some providers
|
|
|
160
160
|
|
|
161
161
|
If you set the strategy to `'auto'`, the `MastraStorageExporter` automatically selects the optimal strategy for the storage provider. If you set an explicit strategy that the storage provider doesn't support, the exporter logs a warning and falls back to the provider's preferred strategy.
|
|
162
162
|
|
|
163
|
-
### Providers with
|
|
163
|
+
### Providers with observability support
|
|
164
164
|
|
|
165
165
|
| Storage Provider | Preferred Strategy | Supported Strategies | Recommended Use |
|
|
166
166
|
| ----------------------------------------------------------------------------- | ------------------ | ------------------------------- | ------------------------------------- |
|
|
@@ -174,7 +174,7 @@ If you set the strategy to `'auto'`, the `MastraStorageExporter` automatically s
|
|
|
174
174
|
|
|
175
175
|
> **Note:** Under `insert-only`, only completed spans are persisted, and span start and update events are ignored. A trace therefore becomes visible in Studio only after its root span ends, and filtering traces by `status: 'running'` returns no results. `PostgresStoreVNext` uses `event-sourced` tracing instead, so in-progress traces remain visible while preserving append-only writes.
|
|
176
176
|
|
|
177
|
-
### Providers without
|
|
177
|
+
### Providers without observability support
|
|
178
178
|
|
|
179
179
|
The following storage providers **don't support** the observability domain. If you're using one of these providers and need observability, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to a supported provider:
|
|
180
180
|
|
|
@@ -185,7 +185,7 @@ The following storage providers **don't support** the observability domain. If y
|
|
|
185
185
|
- [Upstash](https://mastra.ai/integrations/databases/upstash)
|
|
186
186
|
- [LanceDB](https://mastra.ai/integrations/databases/lancedb)
|
|
187
187
|
|
|
188
|
-
### Strategy
|
|
188
|
+
### Strategy benefits
|
|
189
189
|
|
|
190
190
|
- **realtime**: Immediate visibility, best for debugging in a single process
|
|
191
191
|
- **batch-with-updates**: 10-100x throughput improvement, full span lifecycle
|
|
@@ -194,9 +194,9 @@ The following storage providers **don't support** the observability domain. If y
|
|
|
194
194
|
|
|
195
195
|
## Production recommendations
|
|
196
196
|
|
|
197
|
-
Observability data grows
|
|
197
|
+
Observability data grows fast in production environments. A single agent interaction can generate hundreds of spans, and high-traffic applications can produce thousands of traces per day. Most general-purpose databases aren't optimized for this write-heavy, append-only workload.
|
|
198
198
|
|
|
199
|
-
### Recommended: ClickHouse for
|
|
199
|
+
### Recommended: ClickHouse for high-volume production
|
|
200
200
|
|
|
201
201
|
[ClickHouse](https://mastra.ai/integrations/databases/clickhouse) is a columnar database designed for high-volume analytics workloads. It's the recommended choice for production observability because:
|
|
202
202
|
|
|
@@ -205,13 +205,13 @@ Observability data grows quickly in production environments. A single agent inte
|
|
|
205
205
|
- **Fast queries**: Columnar storage enables quick trace lookups and aggregations
|
|
206
206
|
- **Time-series native**: Built-in support for time-based data retention and partitioning
|
|
207
207
|
|
|
208
|
-
### Using
|
|
208
|
+
### Using composite storage
|
|
209
209
|
|
|
210
210
|
If you're using a provider without observability support (like Convex or DynamoDB) or want to optimize performance, use [composite storage](https://mastra.ai/reference/storage/composite) to route observability data to ClickHouse while keeping other data in your primary database.
|
|
211
211
|
|
|
212
212
|
## Batching behavior
|
|
213
213
|
|
|
214
|
-
### Flush
|
|
214
|
+
### Flush triggers
|
|
215
215
|
|
|
216
216
|
For both batch strategies (`batch-with-updates` and `insert-only`), traces are flushed to storage when any of these conditions are met:
|
|
217
217
|
|
|
@@ -310,6 +310,6 @@ new MastraStorageExporter({
|
|
|
310
310
|
## Related
|
|
311
311
|
|
|
312
312
|
- [Traces usage](https://mastra.ai/docs/observability/tracing/overview)
|
|
313
|
-
- [MastraPlatformExporter](https://mastra.ai/docs/mastra-platform/observability)
|
|
313
|
+
- [MastraPlatformExporter](https://mastra.ai/docs/mastra-platform/observability/overview)
|
|
314
314
|
- [Composite Storage](https://mastra.ai/reference/storage/composite): Combine multiple storage providers
|
|
315
315
|
- [Storage Configuration](https://mastra.ai/docs/storage)
|
|
@@ -222,7 +222,7 @@ For backend compatibility details and exporter batching behavior, see [Mastra St
|
|
|
222
222
|
|
|
223
223
|
## Mastra platform
|
|
224
224
|
|
|
225
|
-
For hosted traces, logs, and metrics across projects and deploys, see [Observability on Mastra platform](https://mastra.ai/docs/mastra-platform/observability).
|
|
225
|
+
For hosted traces, logs, and metrics across projects and deploys, see [Observability on Mastra platform](https://mastra.ai/docs/mastra-platform/observability/overview).
|
|
226
226
|
|
|
227
227
|
## Next steps
|
|
228
228
|
|
|
@@ -232,4 +232,4 @@ For hosted traces, logs, and metrics across projects and deploys, see [Observabi
|
|
|
232
232
|
- [Feedback](https://mastra.ai/docs/observability/feedback)
|
|
233
233
|
- [Mastra Studio](https://mastra.ai/docs/studio/observability)
|
|
234
234
|
- [Automatic metrics reference](https://mastra.ai/reference/observability/metrics/automatic-metrics)
|
|
235
|
-
- [Mastra platform observability](https://mastra.ai/docs/mastra-platform/observability)
|
|
235
|
+
- [Mastra platform observability](https://mastra.ai/docs/mastra-platform/observability/overview)
|
|
@@ -62,6 +62,8 @@ If the configured failure policy lets the main execution continue, it can still
|
|
|
62
62
|
|
|
63
63
|
Model inference spans (`MODEL_INFERENCE`) measure provider execution and record usage. Model chunk spans (`MODEL_CHUNK`) capture content after output processors have accepted or transformed it. Chunks belong to the logical step (`MODEL_STEP`), so buffered output can arrive after provider execution ends without outliving its parent. In the agent streaming paths, inference spans no longer capture response output; use the processed chunk spans or the generation output instead.
|
|
64
64
|
|
|
65
|
+
A resumed workflow run continues the suspended run's trace on every engine: it keeps the original sampling decision and trace-level settings such as `hideInput`, except those the resume call sets itself, and it nests under the suspended run span. A run that wasn't sampled stays unrecorded when it resumes. Snapshots written by earlier versions carry only the trace and span IDs. Their resumes sample again.
|
|
66
|
+
|
|
65
67
|
## Sampling strategies
|
|
66
68
|
|
|
67
69
|
Sampling allows you to control which traces are collected, helping you balance between observability needs and resource costs.
|
|
@@ -111,7 +113,7 @@ The `sampling` option allows you to control which traces are collected, helping
|
|
|
111
113
|
}
|
|
112
114
|
```
|
|
113
115
|
|
|
114
|
-
3. **Ratio-Based Sampling**:
|
|
116
|
+
3. **Ratio-Based Sampling**: Samples a random percentage of traces. Ideal for production environments where you want statistical insights without the cost of full tracing. The probability value ranges from 0 (no traces) to 1 (all traces).
|
|
115
117
|
|
|
116
118
|
```ts
|
|
117
119
|
sampling: {
|
|
@@ -719,7 +721,7 @@ const exporter = new LangfuseExporter({
|
|
|
719
721
|
|
|
720
722
|
## Serialization options
|
|
721
723
|
|
|
722
|
-
Serialization options control how span data (input, output, and attributes) is truncated before export. This is useful when working with large payloads,
|
|
724
|
+
Serialization options control how span data (input, output, and attributes) is truncated before export. This is useful when working with large payloads, nested objects, or when you need to optimize trace storage.
|
|
723
725
|
|
|
724
726
|
### Configuration
|
|
725
727
|
|
|
@@ -14,7 +14,7 @@ All require an observability storage backend to be configured.
|
|
|
14
14
|
|
|
15
15
|
## Quickstart
|
|
16
16
|
|
|
17
|
-
For detailed instructions, follow the [observability instructions](https://mastra.ai/docs/observability/overview). To get
|
|
17
|
+
For detailed instructions, follow the [observability instructions](https://mastra.ai/docs/observability/overview). To get started fast, add the `@mastra/observability` package to your project and configure it with [LibSQL](https://mastra.ai/integrations/databases/libsql) and [DuckDB](https://mastra.ai/integrations/vectors/duckdb) for a local development setup that supports both traces and metrics.
|
|
18
18
|
|
|
19
19
|
**npm**:
|
|
20
20
|
|
|
@@ -84,7 +84,7 @@ export const mastra = new Mastra({
|
|
|
84
84
|
|
|
85
85
|
## Mastra platform
|
|
86
86
|
|
|
87
|
-
For hosted traces, logs, and metrics across projects and deploys, see [Observability on Mastra platform](https://mastra.ai/docs/mastra-platform/observability).
|
|
87
|
+
For hosted traces, logs, and metrics across projects and deploys, see [Observability on Mastra platform](https://mastra.ai/docs/mastra-platform/observability/overview).
|
|
88
88
|
|
|
89
89
|
## Metrics
|
|
90
90
|
|
|
@@ -122,4 +122,4 @@ Log forwarding is enabled by default when you configure observability. See [logg
|
|
|
122
122
|
- [Metrics overview](https://mastra.ai/docs/observability/metrics/overview)
|
|
123
123
|
- [Traces usage](https://mastra.ai/docs/observability/tracing/overview)
|
|
124
124
|
- [Logging](https://mastra.ai/docs/observability/logging)
|
|
125
|
-
- [Mastra platform observability](https://mastra.ai/docs/mastra-platform/observability)
|
|
125
|
+
- [Mastra platform observability](https://mastra.ai/docs/mastra-platform/observability/overview)
|
|
@@ -36,7 +36,7 @@ bun add @mastra/arize@latest
|
|
|
36
36
|
|
|
37
37
|
## Configuration
|
|
38
38
|
|
|
39
|
-
### Phoenix
|
|
39
|
+
### Phoenix setup
|
|
40
40
|
|
|
41
41
|
Phoenix is an open-source observability platform that can run locally or be self-hosted.
|
|
42
42
|
|
|
@@ -56,7 +56,7 @@ PHOENIX_API_KEY=your-api-key # For authenticated Phoenix instances
|
|
|
56
56
|
PHOENIX_PROJECT_NAME=mastra-service # Defaults to 'mastra-service'
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
#### Zero-
|
|
59
|
+
#### Zero-config setup
|
|
60
60
|
|
|
61
61
|
With environment variables set, use the exporter with no configuration:
|
|
62
62
|
|
|
@@ -77,7 +77,7 @@ export const mastra = new Mastra({
|
|
|
77
77
|
})
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
#### Explicit
|
|
80
|
+
#### Explicit configuration
|
|
81
81
|
|
|
82
82
|
You can also pass credentials directly (takes precedence over environment variables):
|
|
83
83
|
|
|
@@ -114,7 +114,7 @@ export const mastra = new Mastra({
|
|
|
114
114
|
>
|
|
115
115
|
> Set `PHOENIX_COLLECTOR_ENDPOINT=http://localhost:6006/v1/traces` and run your Mastra agent to see traces at [localhost:6006](http://localhost:6006).
|
|
116
116
|
|
|
117
|
-
### Arize AX
|
|
117
|
+
### Arize AX setup
|
|
118
118
|
|
|
119
119
|
Arize AX is a managed cloud and enterprise self-hosted observability platform with advanced features for production AI systems.
|
|
120
120
|
|
|
@@ -134,7 +134,7 @@ ARIZE_API_KEY=your-api-key
|
|
|
134
134
|
ARIZE_PROJECT_NAME=mastra-service
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
#### Zero-
|
|
137
|
+
#### Zero-config setup
|
|
138
138
|
|
|
139
139
|
With environment variables set, use the exporter with no configuration:
|
|
140
140
|
|
|
@@ -155,7 +155,7 @@ export const mastra = new Mastra({
|
|
|
155
155
|
})
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
-
#### Explicit
|
|
158
|
+
#### Explicit configuration
|
|
159
159
|
|
|
160
160
|
You can also pass credentials directly (takes precedence over environment variables):
|
|
161
161
|
|
|
@@ -186,7 +186,7 @@ export const mastra = new Mastra({
|
|
|
186
186
|
|
|
187
187
|
The Arize exporter supports advanced configuration for fine-tuning OpenTelemetry behavior:
|
|
188
188
|
|
|
189
|
-
### Complete
|
|
189
|
+
### Complete configuration
|
|
190
190
|
|
|
191
191
|
```typescript
|
|
192
192
|
new ArizeExporter({
|
|
@@ -218,7 +218,7 @@ new ArizeExporter({
|
|
|
218
218
|
})
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
-
### Batch
|
|
221
|
+
### Batch processing options
|
|
222
222
|
|
|
223
223
|
Control how traces are batched and exported:
|
|
224
224
|
|
|
@@ -233,7 +233,7 @@ new ArizeExporter({
|
|
|
233
233
|
})
|
|
234
234
|
```
|
|
235
235
|
|
|
236
|
-
### Resource
|
|
236
|
+
### Resource attributes
|
|
237
237
|
|
|
238
238
|
Add custom attributes to all exported spans:
|
|
239
239
|
|
|
@@ -60,7 +60,7 @@ ARTHUR_BASE_URL=http://localhost:3030
|
|
|
60
60
|
ARTHUR_TASK_ID=your-task-id
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
### Zero-
|
|
63
|
+
### Zero-config setup
|
|
64
64
|
|
|
65
65
|
With environment variables set, use the exporter with no configuration:
|
|
66
66
|
|
|
@@ -81,7 +81,7 @@ export const mastra = new Mastra({
|
|
|
81
81
|
})
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
### Explicit
|
|
84
|
+
### Explicit configuration
|
|
85
85
|
|
|
86
86
|
You can also pass credentials directly (takes precedence over environment variables):
|
|
87
87
|
|
|
@@ -110,7 +110,7 @@ export const mastra = new Mastra({
|
|
|
110
110
|
|
|
111
111
|
## Configuration options
|
|
112
112
|
|
|
113
|
-
### Complete
|
|
113
|
+
### Complete configuration
|
|
114
114
|
|
|
115
115
|
```typescript
|
|
116
116
|
new ArthurExporter({
|
|
@@ -48,7 +48,7 @@ BRAINTRUST_API_KEY=sk-xxxxxxxxxxxxxxxx
|
|
|
48
48
|
BRAINTRUST_ENDPOINT=https://api.braintrust.dev # Custom endpoint if needed
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
### Zero-
|
|
51
|
+
### Zero-config setup
|
|
52
52
|
|
|
53
53
|
With environment variables set, use the exporter with no configuration:
|
|
54
54
|
|
|
@@ -69,7 +69,7 @@ export const mastra = new Mastra({
|
|
|
69
69
|
})
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
### Explicit
|
|
72
|
+
### Explicit configuration
|
|
73
73
|
|
|
74
74
|
You can also pass credentials directly (takes precedence over environment variables):
|
|
75
75
|
|
|
@@ -95,7 +95,7 @@ export const mastra = new Mastra({
|
|
|
95
95
|
})
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
### Complete
|
|
98
|
+
### Complete configuration
|
|
99
99
|
|
|
100
100
|
```typescript
|
|
101
101
|
new BraintrustExporter({
|
|
@@ -49,7 +49,7 @@ CONFIDENT_API_KEY=confident_proj_xxxxxxxxxxxxx
|
|
|
49
49
|
CONFIDENT_OTEL_ENDPOINT=https://eu.otel.confident-ai.com/v1/traces
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
### Zero-
|
|
52
|
+
### Zero-config setup
|
|
53
53
|
|
|
54
54
|
With environment variables set, use the exporter with no configuration:
|
|
55
55
|
|
|
@@ -70,7 +70,7 @@ export const mastra = new Mastra({
|
|
|
70
70
|
})
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
-
### Explicit
|
|
73
|
+
### Explicit configuration
|
|
74
74
|
|
|
75
75
|
You can also pass credentials directly (takes precedence over environment variables):
|
|
76
76
|
|
|
@@ -136,7 +136,7 @@ const result = await mastra.getAgent('assistant').generate('How do you make the
|
|
|
136
136
|
})
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
Your metadata is merged with the fields Mastra sets itself, such as `runId`. Tags apply to the root span,
|
|
139
|
+
Your metadata is merged with the fields Mastra sets itself, such as `runId`. Tags apply to the root span, which means they apply to the trace rather than to individual spans.
|
|
140
140
|
|
|
141
141
|
## Lifecycle
|
|
142
142
|
|
|
@@ -152,11 +152,11 @@ In a long-running server, shut down during graceful shutdown rather than per req
|
|
|
152
152
|
|
|
153
153
|
## Threads and trace properties
|
|
154
154
|
|
|
155
|
-
This exporter maps Mastra's own tracing surface, so trace metadata and tags come from `tracingOptions`
|
|
155
|
+
This exporter maps Mastra's own tracing surface, so trace metadata and tags come from the `tracingOptions` passed to the traced call.
|
|
156
156
|
|
|
157
157
|
Grouping turns into [threads](https://www.confident-ai.com/docs/llm-tracing/features/threads) and setting trace-level properties such as user IDs use `confident-trace`'s SDK instrumentation, which attaches to Mastra directly rather than through an exporter. See the [Mastra integration guide](https://www.confident-ai.com/docs/integrations/third-party/mastra) for that setup.
|
|
158
158
|
|
|
159
|
-
Choose one or the other.
|
|
159
|
+
Choose one or the other. Don't use both at once.
|
|
160
160
|
|
|
161
161
|
## Related
|
|
162
162
|
|