@mastra/observability 1.24.3-alpha.1 → 1.24.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.
@@ -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.3-alpha.1"
6
+ version: "1.24.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -37,7 +37,7 @@ Read the individual reference documents for detailed explanations and code examp
37
37
  - [LangSmith](references/integrations-observability-langsmith.md) - Export Mastra traces to LangSmith for LLM monitoring and evaluation with project, API key, endpoint, and environment configuration.
38
38
  - [OpenTelemetry](references/integrations-observability-opentelemetry.md) - Connect Mastra observability to OpenTelemetry with an exporter for traces and logs or a bridge for joining existing distributed trace contexts.
39
39
  - [PostHog](references/integrations-observability-posthog.md) - Give Mastra agents PostHog tools through Mastra Connect, and export Mastra traces to PostHog AI observability with serverless flushing.
40
- - [Sentry](references/integrations-observability-sentry.md) - Export Mastra traces to Sentry AI monitoring with OpenTelemetry semantic conventions, zero-config setup, and optional SDK or exporter settings.
40
+ - [Sentry](references/integrations-observability-sentry.md) - Give Mastra agents Sentry tools through Mastra Connect, and export Mastra traces to Sentry AI monitoring with OpenTelemetry semantic conventions.
41
41
 
42
42
  ### Reference
43
43
 
@@ -1,11 +1,11 @@
1
1
  {
2
- "version": "1.24.3-alpha.1",
2
+ "version": "1.24.3",
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": 68378
8
+ "line": 68133
9
9
  },
10
10
  "BaseObservabilityEventBus": {
11
11
  "types": "dist/bus/base.d.ts",
@@ -15,27 +15,27 @@
15
15
  "BaseObservabilityInstance": {
16
16
  "types": "dist/instances/base.d.ts",
17
17
  "implementation": "dist/index.js",
18
- "line": 70412
18
+ "line": 70167
19
19
  },
20
20
  "BaseSpan": {
21
21
  "types": "dist/spans/base.d.ts",
22
22
  "implementation": "dist/index.js",
23
- "line": 67637
23
+ "line": 67392
24
24
  },
25
25
  "CardinalityFilter": {
26
26
  "types": "dist/metrics/cardinality.d.ts",
27
27
  "implementation": "dist/index.js",
28
- "line": 66149
28
+ "line": 65904
29
29
  },
30
30
  "CloudExporter": {
31
31
  "types": "dist/exporters/cloud.d.ts",
32
32
  "implementation": "dist/index.js",
33
- "line": 72860
33
+ "line": 72615
34
34
  },
35
35
  "ConsoleExporter": {
36
36
  "types": "dist/exporters/console.d.ts",
37
37
  "implementation": "dist/index.js",
38
- "line": 73183
38
+ "line": 72938
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": 71418
48
+ "line": 71173
49
49
  },
50
50
  "DefaultExporter": {
51
51
  "types": "dist/exporters/default.d.ts",
52
52
  "implementation": "dist/index.js",
53
- "line": 69193
53
+ "line": 68948
54
54
  },
55
55
  "DefaultObservabilityInstance": {
56
56
  "types": "dist/instances/default.d.ts",
57
57
  "implementation": "dist/index.js",
58
- "line": 75116
58
+ "line": 74871
59
59
  },
60
60
  "DefaultSpan": {
61
61
  "types": "dist/spans/default.d.ts",
62
62
  "implementation": "dist/index.js",
63
- "line": 68145
63
+ "line": 67900
64
64
  },
65
65
  "JsonExporter": {
66
66
  "types": "dist/exporters/test.d.ts",
67
67
  "implementation": "dist/index.js",
68
- "line": 75114
68
+ "line": 74869
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": 73513
78
+ "line": 73268
79
79
  },
80
80
  "MastraStorageExporter": {
81
81
  "types": "dist/exporters/mastra-storage.d.ts",
82
82
  "implementation": "dist/index.js",
83
- "line": 69758
83
+ "line": 69513
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": 66583
93
+ "line": 66338
94
94
  },
95
95
  "NoOpSpan": {
96
96
  "types": "dist/spans/no-op.d.ts",
97
97
  "implementation": "dist/index.js",
98
- "line": 68321
98
+ "line": 68076
99
99
  },
100
100
  "OBSERVABILITY_CAPABILITIES_HEADER": {
101
101
  "types": "dist/exporters/mastra-platform.d.ts",
102
102
  "implementation": "dist/index.js",
103
- "line": 73414
103
+ "line": 73169
104
104
  },
105
105
  "Observability": {
106
106
  "types": "dist/default.d.ts",
107
107
  "implementation": "dist/index.js",
108
- "line": 75452
108
+ "line": 75207
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": 73415
118
+ "line": 73170
119
119
  },
120
120
  "REDACTED_ERROR_MESSAGE": {
121
121
  "types": "dist/spans/base.d.ts",
122
122
  "implementation": "dist/index.js",
123
- "line": 67498
123
+ "line": 67253
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": 75239
133
+ "line": 74994
134
134
  },
135
135
  "TestExporter": {
136
136
  "types": "dist/exporters/test.d.ts",
137
137
  "implementation": "dist/index.js",
138
- "line": 74124
138
+ "line": 73879
139
139
  },
140
140
  "TraceData": {
141
141
  "types": "dist/exporters/tracking.d.ts",
142
142
  "implementation": "dist/index.js",
143
- "line": 71579
143
+ "line": 71334
144
144
  },
145
145
  "TrackingExporter": {
146
146
  "types": "dist/exporters/tracking.d.ts",
147
147
  "implementation": "dist/index.js",
148
- "line": 71908
148
+ "line": 71663
149
149
  },
150
150
  "buildExportedLog": {
151
151
  "types": "dist/client/otlp.d.ts",
152
152
  "implementation": "dist/index.js",
153
- "line": 71335
153
+ "line": 71090
154
154
  },
155
155
  "buildExportedSpan": {
156
156
  "types": "dist/client/otlp.d.ts",
157
157
  "implementation": "dist/index.js",
158
- "line": 71317
158
+ "line": 71072
159
159
  },
160
160
  "buildTracingOptions": {
161
161
  "types": "dist/tracing-options.d.ts",
162
162
  "implementation": "dist/index.js",
163
- "line": 75793
163
+ "line": 75548
164
164
  },
165
165
  "chainFormatters": {
166
166
  "types": "dist/exporters/span-formatters.d.ts",
167
167
  "implementation": "dist/index.js",
168
- "line": 72674
168
+ "line": 72429
169
169
  },
170
170
  "createClientObservabilityProxy": {
171
171
  "types": "dist/client/proxy.d.ts",
172
172
  "implementation": "dist/index.js",
173
- "line": 71560
173
+ "line": 71315
174
174
  },
175
175
  "decodeResourceLogs": {
176
176
  "types": "dist/client/otlp.d.ts",
177
177
  "implementation": "dist/index.js",
178
- "line": 71254
178
+ "line": 71009
179
179
  },
180
180
  "decodeResourceSpans": {
181
181
  "types": "dist/client/otlp.d.ts",
182
182
  "implementation": "dist/index.js",
183
- "line": 71216
183
+ "line": 70971
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": 71408
193
+ "line": 71163
194
194
  },
195
195
  "formatTraceparent": {
196
196
  "types": "dist/client/w3c.d.ts",
197
197
  "implementation": "dist/index.js",
198
- "line": 71371
198
+ "line": 71126
199
199
  },
200
200
  "getExternalParentId": {
201
201
  "types": "dist/spans/base.d.ts",
202
202
  "implementation": "dist/index.js",
203
- "line": 67618
203
+ "line": 67373
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": 75774
223
+ "line": 75529
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": 71291
238
+ "line": 71046
239
239
  },
240
240
  "parseBaggage": {
241
241
  "types": "dist/client/w3c.d.ts",
242
242
  "implementation": "dist/index.js",
243
- "line": 71381
243
+ "line": 71136
244
244
  },
245
245
  "parseTraceparent": {
246
246
  "types": "dist/client/w3c.d.ts",
247
247
  "implementation": "dist/index.js",
248
- "line": 71357
248
+ "line": 71112
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": 67504
258
+ "line": 67259
259
259
  },
260
260
  "routeToHandler": {
261
261
  "types": "dist/bus/route-event.d.ts",
@@ -208,7 +208,7 @@ Platform adds these fields and grouping options:
208
208
  | `aggregateTraces()` | Supports `groupBy: ['projectId']` and `countDistinct.projectId`. |
209
209
  | `aggregateSpans()` | Supports `groupBy: ['projectId']`, but not `countDistinct.projectId`. |
210
210
 
211
- Data retention depends on your plan: 15 days for Starter, 6 months for Teams, and custom retention for Enterprise. See [pricing](https://mastra.ai/pricing) for current plan limits.
211
+ Data retention depends on your plan: 15 days for Free, 60 days for Starter, 180 days for Team, and custom retention for Enterprise. See [pricing](https://mastra.ai/pricing) for current plan limits.
212
212
 
213
213
  ### Other observability data
214
214
 
@@ -4,9 +4,50 @@
4
4
 
5
5
  # Sentry
6
6
 
7
- [Sentry](https://sentry.io/) is an application monitoring platform with AI-specific tracing capabilities. The Sentry exporter sends your traces to Sentry using OpenTelemetry semantic conventions, providing insights into model performance and token usage, plus tool executions.
7
+ [Sentry](https://sentry.io/) is an application monitoring platform with AI-specific tracing capabilities. Use it with Mastra in two ways:
8
8
 
9
- ## Installation
9
+ - **Agent tools** let an agent work with Sentry issues, events, and projects through [Mastra Connect](https://mastra.ai/docs/mastra-platform/connect).
10
+ - **[Tracing](#tracing)** exports your Mastra traces to Sentry.
11
+
12
+ ## Connect
13
+
14
+ Before you start, complete the [Connect setup](https://mastra.ai/docs/mastra-platform/connect) to install `@mastra/connect` and configure your platform project.
15
+
16
+ ### Agent tools
17
+
18
+ Give agents tools from Sentry's hosted Model Context Protocol (MCP) server to search issues and events, read stack traces and traces, and manage issues, projects, and teams in Sentry.
19
+
20
+ Connect an account with the `sentry-mcp` provider ID. Run this command from the directory that contains your `.env` file:
21
+
22
+ ```bash
23
+ mastra connect add sentry-mcp
24
+ ```
25
+
26
+ Then pass [`tools()`](https://mastra.ai/reference/connect/tools) to the agent and select the provider:
27
+
28
+ ```typescript
29
+ import { Agent } from '@mastra/core/agent'
30
+ import { tools } from '@mastra/connect'
31
+
32
+ export const sentryMcpAgent = new Agent({
33
+ id: 'sentry-mcp-agent',
34
+ name: 'Sentry agent',
35
+ instructions:
36
+ 'You help people search issues and events, read stack traces and traces, and manage issues, projects, and teams in Sentry.',
37
+ model: '__GATEWAY_OPENAI_MODEL_LUNA__',
38
+ tools: tools({ providers: ['sentry-mcp'] }),
39
+ })
40
+ ```
41
+
42
+ Mastra discovers Sentry's tools from its MCP server when the agent runs. The available tools depend on the server and the connected account, not on your `@mastra/connect` version. Tool keys start with `sentry-mcp_`.
43
+
44
+ To see which tools Sentry provides, read the [Sentry MCP server](https://docs.sentry.io/product/sentry-mcp/) documentation. To require approval before a call runs, see [MCP providers](https://mastra.ai/reference/connect/tools) in the `tools()` reference.
45
+
46
+ ## Tracing
47
+
48
+ The Sentry exporter sends your traces to Sentry using OpenTelemetry semantic conventions, providing insights into model performance and token usage, plus tool executions.
49
+
50
+ ### Installation
10
51
 
11
52
  **npm**:
12
53
 
@@ -32,9 +73,9 @@ yarn add @mastra/sentry@latest
32
73
  bun add @mastra/sentry@latest
33
74
  ```
34
75
 
35
- ## Configuration
76
+ ### Configuration
36
77
 
37
- ### Prerequisites
78
+ #### Prerequisites
38
79
 
39
80
  1. **Sentry Account**: Sign up at [sentry.io](https://sentry.io/)
40
81
  2. **DSN**: Get your [Data Source Name](https://docs.sentry.io/concepts/key-terms/dsn-explainer/) from Project Settings → Client Keys
@@ -48,7 +89,7 @@ SENTRY_ENVIRONMENT=production
48
89
  SENTRY_RELEASE=1.0.0
49
90
  ```
50
91
 
51
- ### Zero-config setup
92
+ #### Zero-config setup
52
93
 
53
94
  With environment variables set, use the exporter with no configuration:
54
95
 
@@ -69,7 +110,7 @@ export const mastra = new Mastra({
69
110
  })
70
111
  ```
71
112
 
72
- ### Explicit configuration
113
+ #### Explicit configuration
73
114
 
74
115
  You can also pass credentials directly (takes precedence over environment variables):
75
116
 
@@ -96,9 +137,9 @@ export const mastra = new Mastra({
96
137
  })
97
138
  ```
98
139
 
99
- ## Configuration options
140
+ ### Configuration options
100
141
 
101
- ### Complete configuration
142
+ #### Complete configuration
102
143
 
103
144
  ```typescript
104
145
  new SentryExporter({
@@ -123,7 +164,7 @@ new SentryExporter({
123
164
  })
124
165
  ```
125
166
 
126
- ### Sampling configuration
167
+ #### Sampling configuration
127
168
 
128
169
  Control the percentage of transactions sent to Sentry. This is useful for high-volume applications:
129
170
 
@@ -136,7 +177,7 @@ new SentryExporter({
136
177
 
137
178
  > **Tip:** Set to `1.0` (100%) for development and `0.1` to `0.2` (10-20%) for production high-load applications. To disable tracing entirely, don't set `tracesSampleRate` at all rather than setting it to `0`.
138
179
 
139
- ## Span type mapping
180
+ ### Span type mapping
140
181
 
141
182
  Mastra span types are automatically mapped to Sentry operations:
142
183
 
@@ -159,7 +200,7 @@ Mastra span types are automatically mapped to Sentry operations:
159
200
  | `PROCESSOR_RUN` | `ai.processor` | |
160
201
  | `GENERIC` | `ai.span` | |
161
202
 
162
- ## OpenTelemetry semantic conventions
203
+ ### OpenTelemetry semantic conventions
163
204
 
164
205
  The exporter uses standard GenAI semantic conventions with Sentry-specific attributes:
165
206
 
@@ -195,7 +236,7 @@ The exporter uses standard GenAI semantic conventions with Sentry-specific attri
195
236
  - `gen_ai.response.text`: Output text from child generation
196
237
  - `gen_ai.usage.*`: Token usage from child generation
197
238
 
198
- ## Features
239
+ ### Features
199
240
 
200
241
  - **Hierarchical traces**: Maintains parent-child relationships
201
242
  - **Token tracking**: Automatic token usage tracking for generations