@mastra/observability 1.24.1-alpha.1 → 1.24.2-alpha.0
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 +1 -1
- package/dist/docs/references/docs-observability-integrations-exporters-mastra-storage.md +12 -12
- package/dist/docs/references/docs-observability-tracing-overview.md +4 -2
- package/dist/docs/references/docs-studio-observability.md +1 -1
- 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 +13 -13
- 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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- 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/package.json +6 -6
|
@@ -8,7 +8,7 @@ Mastra supports OpenTelemetry (OTEL) through an exporter for sending traces and
|
|
|
8
8
|
|
|
9
9
|
## Exporter
|
|
10
10
|
|
|
11
|
-
The OpenTelemetry exporter sends your traces and logs using standardized [OpenTelemetry Semantic Conventions for GenAI](https://opentelemetry.io/docs/specs/semconv/gen-ai/).
|
|
11
|
+
The OpenTelemetry exporter sends your traces and logs using standardized [OpenTelemetry Semantic Conventions for GenAI](https://opentelemetry.io/docs/specs/semconv/gen-ai/). Traces stay compatible with platforms such as Agnost AI, Dash0, Datadog, Laminar, Latitude, MLflow, New Relic, Sazabi, Sentry, SigNoz, telemetry.dev, and Traceloop.
|
|
12
12
|
|
|
13
13
|
### Installation
|
|
14
14
|
|
|
@@ -135,7 +135,7 @@ Agnost AI reads `userId` and `conversationId` (or `threadId`) from `tracingOptio
|
|
|
135
135
|
|
|
136
136
|
[Dash0](https://www.dash0.com/) provides real-time observability with automatic insights.
|
|
137
137
|
|
|
138
|
-
##### Zero-
|
|
138
|
+
##### Zero-config setup
|
|
139
139
|
|
|
140
140
|
Set environment variables and use the exporter with an empty config:
|
|
141
141
|
|
|
@@ -165,7 +165,7 @@ export const mastra = new Mastra({
|
|
|
165
165
|
})
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
-
##### Explicit
|
|
168
|
+
##### Explicit configuration
|
|
169
169
|
|
|
170
170
|
```typescript
|
|
171
171
|
import { Mastra } from '@mastra/core'
|
|
@@ -260,7 +260,7 @@ export const mastra = new Mastra({
|
|
|
260
260
|
|
|
261
261
|
[Laminar](https://laminar.sh/) provides specialized LLM observability and analytics.
|
|
262
262
|
|
|
263
|
-
##### Zero-
|
|
263
|
+
##### Zero-config setup
|
|
264
264
|
|
|
265
265
|
```bash
|
|
266
266
|
# Required
|
|
@@ -274,7 +274,7 @@ LAMINAR_ENDPOINT=https://api.lmnr.ai/v1/traces
|
|
|
274
274
|
new OtelExporter({ provider: { laminar: {} } })
|
|
275
275
|
```
|
|
276
276
|
|
|
277
|
-
##### Explicit
|
|
277
|
+
##### Explicit configuration
|
|
278
278
|
|
|
279
279
|
```typescript
|
|
280
280
|
new OtelExporter({
|
|
@@ -331,7 +331,7 @@ new OtelExporter({
|
|
|
331
331
|
|
|
332
332
|
[New Relic](https://newrelic.com/) provides complete observability with AI monitoring capabilities.
|
|
333
333
|
|
|
334
|
-
##### Zero-
|
|
334
|
+
##### Zero-config setup
|
|
335
335
|
|
|
336
336
|
```bash
|
|
337
337
|
# Required
|
|
@@ -345,7 +345,7 @@ NEW_RELIC_ENDPOINT=https://otlp.eu01.nr-data.net # For EU region
|
|
|
345
345
|
new OtelExporter({ provider: { newrelic: {} } })
|
|
346
346
|
```
|
|
347
347
|
|
|
348
|
-
##### Explicit
|
|
348
|
+
##### Explicit configuration
|
|
349
349
|
|
|
350
350
|
```typescript
|
|
351
351
|
new OtelExporter({
|
|
@@ -417,7 +417,7 @@ Choose an exporter based on your setup:
|
|
|
417
417
|
|
|
418
418
|
[SigNoz](https://signoz.io/) is an open-source APM alternative with built-in Tracing support.
|
|
419
419
|
|
|
420
|
-
##### Zero-
|
|
420
|
+
##### Zero-config setup
|
|
421
421
|
|
|
422
422
|
```bash
|
|
423
423
|
# Required
|
|
@@ -432,7 +432,7 @@ SIGNOZ_ENDPOINT=https://my-signoz.example.com # For self-hosted
|
|
|
432
432
|
new OtelExporter({ provider: { signoz: {} } })
|
|
433
433
|
```
|
|
434
434
|
|
|
435
|
-
##### Explicit
|
|
435
|
+
##### Explicit configuration
|
|
436
436
|
|
|
437
437
|
```typescript
|
|
438
438
|
new OtelExporter({
|
|
@@ -472,7 +472,7 @@ new OtelExporter({
|
|
|
472
472
|
|
|
473
473
|
[Traceloop](https://www.traceloop.com/) specializes in LLM observability with automatic prompt tracking.
|
|
474
474
|
|
|
475
|
-
##### Zero-
|
|
475
|
+
##### Zero-config setup
|
|
476
476
|
|
|
477
477
|
```bash
|
|
478
478
|
# Required
|
|
@@ -487,7 +487,7 @@ TRACELOOP_ENDPOINT=https://custom.traceloop.com
|
|
|
487
487
|
new OtelExporter({ provider: { traceloop: {} } })
|
|
488
488
|
```
|
|
489
489
|
|
|
490
|
-
##### Explicit
|
|
490
|
+
##### Explicit configuration
|
|
491
491
|
|
|
492
492
|
```typescript
|
|
493
493
|
new OtelExporter({
|
|
@@ -500,7 +500,7 @@ new OtelExporter({
|
|
|
500
500
|
})
|
|
501
501
|
```
|
|
502
502
|
|
|
503
|
-
#### Custom
|
|
503
|
+
#### Custom or generic OTEL endpoints
|
|
504
504
|
|
|
505
505
|
For other OTEL-compatible platforms or custom collectors:
|
|
506
506
|
|
|
@@ -589,7 +589,7 @@ If the matching log exporter package isn't installed, log export is silently dis
|
|
|
589
589
|
|
|
590
590
|
### Configuration options
|
|
591
591
|
|
|
592
|
-
#### Complete
|
|
592
|
+
#### Complete configuration
|
|
593
593
|
|
|
594
594
|
```typescript
|
|
595
595
|
new OtelExporter({
|
|
@@ -619,7 +619,7 @@ The exporter follows [OpenTelemetry Semantic Conventions for GenAI v1.41.0](http
|
|
|
619
619
|
|
|
620
620
|
The conventions cover the following span names and attributes:
|
|
621
621
|
|
|
622
|
-
#### Span
|
|
622
|
+
#### Span naming
|
|
623
623
|
|
|
624
624
|
- **Model calls**: `chat {model}`
|
|
625
625
|
- **Generation loop**: `model_generation {model}`, with one `agent_step {agent_id}` per turn
|
|
@@ -627,9 +627,9 @@ The conventions cover the following span names and attributes:
|
|
|
627
627
|
- **Agent Runs**: `invoke_agent {agent_id}`
|
|
628
628
|
- **Workflow Runs**: `invoke_workflow {workflow_id}`
|
|
629
629
|
|
|
630
|
-
Each agent turn calls the model once. The `chat` span is that call and is the only span that carries `gen_ai.request.model`, the messages, and `gen_ai.usage.*`, so backends that sum usage across spans count each call once. The `model_generation` span wraps the whole loop and `agent_step` wraps one turn (model call plus tool execution)
|
|
630
|
+
Each agent turn calls the model once. The `chat` span is that call and is the only span that carries `gen_ai.request.model`, the messages, and `gen_ai.usage.*`, so backends that sum usage across spans count each call once. The `model_generation` span wraps the whole loop and `agent_step` wraps one turn (model call plus tool execution). Neither carries usage.
|
|
631
631
|
|
|
632
|
-
#### Key
|
|
632
|
+
#### Key attributes
|
|
633
633
|
|
|
634
634
|
- `gen_ai.operation.name` - Operation type (chat, tool.execute, etc.)
|
|
635
635
|
- `gen_ai.provider.name` - AI provider (openai, anthropic, etc.)
|
|
@@ -655,11 +655,11 @@ Choose the right protocol package based on your provider:
|
|
|
655
655
|
| Traceloop | HTTP/JSON | `@opentelemetry/exporter-trace-otlp-http` |
|
|
656
656
|
| Custom | Varies | Depends on your collector |
|
|
657
657
|
|
|
658
|
-
> **Warning:**
|
|
658
|
+
> **Warning:** Ensure you install the correct protocol package for your provider. The exporter will provide a helpful error message if the wrong package is installed.
|
|
659
659
|
|
|
660
660
|
### Troubleshooting
|
|
661
661
|
|
|
662
|
-
#### Missing
|
|
662
|
+
#### Missing dependency error
|
|
663
663
|
|
|
664
664
|
If you see an error like:
|
|
665
665
|
|
|
@@ -671,7 +671,7 @@ To use HTTP/Protobuf export, install the required package:
|
|
|
671
671
|
|
|
672
672
|
Install the suggested package for your provider.
|
|
673
673
|
|
|
674
|
-
#### Common
|
|
674
|
+
#### Common issues
|
|
675
675
|
|
|
676
676
|
1. **Wrong protocol package**: Verify you installed the correct exporter for your provider
|
|
677
677
|
2. **Invalid endpoint**: Check endpoint format matches provider requirements
|
|
@@ -761,7 +761,7 @@ Using the `OtelBridge` requires two steps:
|
|
|
761
761
|
1. Configure OpenTelemetry instrumentation in your application
|
|
762
762
|
2. Add the `OtelBridge` to your Mastra observability config
|
|
763
763
|
|
|
764
|
-
#### Step 1: OpenTelemetry
|
|
764
|
+
#### Step 1: OpenTelemetry instrumentation
|
|
765
765
|
|
|
766
766
|
Create an instrumentation file that initializes OTEL. This must run before your application code:
|
|
767
767
|
|
|
@@ -790,7 +790,7 @@ sdk.start()
|
|
|
790
790
|
export { sdk }
|
|
791
791
|
```
|
|
792
792
|
|
|
793
|
-
#### Step 2: Mastra
|
|
793
|
+
#### Step 2: Mastra configuration
|
|
794
794
|
|
|
795
795
|
Add the `OtelBridge` to your Mastra observability config:
|
|
796
796
|
|
|
@@ -839,7 +839,7 @@ Logs that originate inside a Mastra span are emitted under that span's OTEL cont
|
|
|
839
839
|
|
|
840
840
|
If you don't register a `LoggerProvider`, log emission is a silent no-op. Traces continue to work as configured.
|
|
841
841
|
|
|
842
|
-
#### Running
|
|
842
|
+
#### Running your application
|
|
843
843
|
|
|
844
844
|
Use the `--import` flag to ensure instrumentation loads before your application:
|
|
845
845
|
|
|
@@ -849,7 +849,7 @@ tsx --import ./instrumentation.ts ./src/index.ts
|
|
|
849
849
|
|
|
850
850
|
#### Flushing before exit
|
|
851
851
|
|
|
852
|
-
Mastra's `flush()` and `shutdown()` ask the registered OTEL providers to flush, but a `BatchSpanProcessor` can still hold a batch it has already started exporting. In serverless or short-lived processes, also `await sdk.shutdown()` after Mastra's flush, so no spans are left in your OTEL SDK when the process exits. The provider's own `forceFlush()`
|
|
852
|
+
Mastra's `flush()` and `shutdown()` ask the registered OTEL providers to flush, but a `BatchSpanProcessor` can still hold a batch it has already started exporting. In serverless or short-lived processes, also `await sdk.shutdown()` after Mastra's flush, so no spans are left in your OTEL SDK when the process exits. The provider's own `forceFlush()` isn't enough: it doesn't wait for a batch the exporter is already sending.
|
|
853
853
|
|
|
854
854
|
### Semantic conventions
|
|
855
855
|
|
|
@@ -48,7 +48,7 @@ SENTRY_ENVIRONMENT=production
|
|
|
48
48
|
SENTRY_RELEASE=1.0.0
|
|
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
|
|
|
@@ -98,7 +98,7 @@ export const mastra = new Mastra({
|
|
|
98
98
|
|
|
99
99
|
## Configuration options
|
|
100
100
|
|
|
101
|
-
### Complete
|
|
101
|
+
### Complete configuration
|
|
102
102
|
|
|
103
103
|
```typescript
|
|
104
104
|
new SentryExporter({
|
|
@@ -123,7 +123,7 @@ new SentryExporter({
|
|
|
123
123
|
})
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
### Sampling
|
|
126
|
+
### Sampling configuration
|
|
127
127
|
|
|
128
128
|
Control the percentage of transactions sent to Sentry. This is useful for high-volume applications:
|
|
129
129
|
|
|
@@ -83,11 +83,11 @@ The flush is best-effort: dd-trace sends LLM Observability data from a backgroun
|
|
|
83
83
|
async shutdown(): Promise<void>
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
Force-finishes any APM spans that weren't
|
|
86
|
+
Force-finishes any APM spans that weren't closed cleanly and flushes pending LLM Observability data. It then disables the integration and clears all internal state.
|
|
87
87
|
|
|
88
88
|
## Usage examples
|
|
89
89
|
|
|
90
|
-
### Basic
|
|
90
|
+
### Basic usage
|
|
91
91
|
|
|
92
92
|
```typescript
|
|
93
93
|
import tracer from 'dd-trace'
|
|
@@ -116,7 +116,7 @@ const mastra = new Mastra({
|
|
|
116
116
|
})
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
### Agentless
|
|
119
|
+
### Agentless mode (LLM observability only, no local agent)
|
|
120
120
|
|
|
121
121
|
If you don't have a local Datadog Agent and only want LLM Observability data, enable agentless mode:
|
|
122
122
|
|
|
@@ -130,7 +130,7 @@ new DatadogBridge({
|
|
|
130
130
|
|
|
131
131
|
Note: APM data can't be sent in agentless mode. If you only need LLM Observability data without `dd-trace` APM, the [Datadog Exporter](https://mastra.ai/reference/observability/tracing/exporters/datadog) is a simpler choice.
|
|
132
132
|
|
|
133
|
-
### With
|
|
133
|
+
### With additional exporters
|
|
134
134
|
|
|
135
135
|
The bridge can be combined with non-Datadog exporters to send traces to additional destinations:
|
|
136
136
|
|
|
@@ -64,11 +64,11 @@ Force flushes the tracer provider and logger provider if they support `forceFlus
|
|
|
64
64
|
async shutdown(): Promise<void>
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
Shuts down the bridge and cleans up resources. Ends any spans that weren't
|
|
67
|
+
Shuts down the bridge and cleans up resources. Ends any spans that weren't closed cleanly, then flushes the providers so those spans are exported.
|
|
68
68
|
|
|
69
69
|
## Usage examples
|
|
70
70
|
|
|
71
|
-
### Basic
|
|
71
|
+
### Basic usage
|
|
72
72
|
|
|
73
73
|
```typescript
|
|
74
74
|
import { Mastra } from '@mastra/core'
|
|
@@ -88,7 +88,7 @@ const mastra = new Mastra({
|
|
|
88
88
|
})
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
### Combined with
|
|
91
|
+
### Combined with exporters
|
|
92
92
|
|
|
93
93
|
The bridge can be used alongside exporters. The bridge handles OTEL context, while exporters send data to additional destinations:
|
|
94
94
|
|
|
@@ -147,7 +147,7 @@ const result = await agent.generate('Hello', {
|
|
|
147
147
|
})
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
-
### How
|
|
150
|
+
### How tags are stored
|
|
151
151
|
|
|
152
152
|
Tags are stored as a JSON-stringified array in the `mastra.tags` span attribute:
|
|
153
153
|
|
|
@@ -184,7 +184,7 @@ The exporter batches tracing spans, logs, metrics, scores, and feedback for effi
|
|
|
184
184
|
- With `projectId` or `MASTRA_PROJECT_ID`, derived routes use `/projects/:projectId/ai/{signal}/publish`
|
|
185
185
|
- Explicit full publish URLs are used as-is, even when `projectId` is configured
|
|
186
186
|
|
|
187
|
-
### Signal
|
|
187
|
+
### Signal processing
|
|
188
188
|
|
|
189
189
|
- `exportTracingEvent()` only exports `SPAN_ENDED` tracing events
|
|
190
190
|
- `onLogEvent()`, `onMetricEvent()`, `onScoreEvent()`, and `onFeedbackEvent()` buffer every event they receive for that signal type
|
|
@@ -238,7 +238,7 @@ const customExporter = new CloudExporter({
|
|
|
238
238
|
|
|
239
239
|
- [Tracing Overview](https://mastra.ai/docs/observability/tracing/overview): Complete guide
|
|
240
240
|
|
|
241
|
-
### Other
|
|
241
|
+
### Other exporters
|
|
242
242
|
|
|
243
243
|
- [DefaultExporter](https://mastra.ai/reference/observability/tracing/exporters/default-exporter): Storage persistence
|
|
244
244
|
- [ConsoleExporter](https://mastra.ai/reference/observability/tracing/exporters/console-exporter): Debug output
|
|
@@ -125,7 +125,7 @@ const exporterWithLogger = new ConsoleExporter({
|
|
|
125
125
|
|
|
126
126
|
- [Tracing Overview](https://mastra.ai/docs/observability/tracing/overview): Complete guide
|
|
127
127
|
|
|
128
|
-
### Other
|
|
128
|
+
### Other exporters
|
|
129
129
|
|
|
130
130
|
- [MastraStorageExporter](https://mastra.ai/reference/observability/tracing/exporters/mastra-storage-exporter): Storage persistence
|
|
131
131
|
- [MastraPlatformExporter](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter): Mastra platform
|
|
@@ -64,7 +64,7 @@ Flushes pending data and shuts down the exporter. Cancels any pending cleanup ti
|
|
|
64
64
|
|
|
65
65
|
## Usage
|
|
66
66
|
|
|
67
|
-
### Zero-
|
|
67
|
+
### Zero-config (using environment variables)
|
|
68
68
|
|
|
69
69
|
```typescript
|
|
70
70
|
import { DatadogExporter } from '@mastra/datadog'
|
|
@@ -73,7 +73,7 @@ import { DatadogExporter } from '@mastra/datadog'
|
|
|
73
73
|
const exporter = new DatadogExporter()
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
### Explicit
|
|
76
|
+
### Explicit configuration
|
|
77
77
|
|
|
78
78
|
```typescript
|
|
79
79
|
import { DatadogExporter } from '@mastra/datadog'
|
|
@@ -86,7 +86,7 @@ const exporter = new DatadogExporter({
|
|
|
86
86
|
})
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
### With
|
|
89
|
+
### With local Datadog agent
|
|
90
90
|
|
|
91
91
|
```typescript
|
|
92
92
|
const exporter = new DatadogExporter({
|
|
@@ -51,7 +51,7 @@ Extends `BaseExporterConfig`, which includes:
|
|
|
51
51
|
type TracingStorageStrategy = 'realtime' | 'batch-with-updates' | 'insert-only'
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
### Strategy
|
|
54
|
+
### Strategy behaviors
|
|
55
55
|
|
|
56
56
|
- **realtime**: Immediately persists each event to storage
|
|
57
57
|
- **batch-with-updates**: Batches creates and updates separately, applies in order
|
|
@@ -119,7 +119,7 @@ The exporter will:
|
|
|
119
119
|
|
|
120
120
|
## Batching behavior
|
|
121
121
|
|
|
122
|
-
### Flush
|
|
122
|
+
### Flush triggers
|
|
123
123
|
|
|
124
124
|
The buffer flushes when any of these conditions are met:
|
|
125
125
|
|
|
@@ -128,7 +128,7 @@ The buffer flushes when any of these conditions are met:
|
|
|
128
128
|
- Buffer size reaches `maxBufferSize` (emergency flush)
|
|
129
129
|
- `shutdown()` is called
|
|
130
130
|
|
|
131
|
-
### Retry
|
|
131
|
+
### Retry logic
|
|
132
132
|
|
|
133
133
|
Failed flushes are retried with exponential backoff:
|
|
134
134
|
|
|
@@ -138,7 +138,7 @@ Failed flushes are retried with exponential backoff:
|
|
|
138
138
|
|
|
139
139
|
When storage doesn't support a signal or retries are exhausted, `DefaultExporter` emits an `ObservabilityDropEvent` through `onDroppedEvent` handlers registered on exporters and bridges. The drop event includes the signal, reason, count, exporter name, storage name when known, and sanitized error details.
|
|
140
140
|
|
|
141
|
-
### Out-of-
|
|
141
|
+
### Out-of-order handling
|
|
142
142
|
|
|
143
143
|
For `batch-with-updates` strategy:
|
|
144
144
|
|
|
@@ -170,7 +170,7 @@ const customExporter = new DefaultExporter({
|
|
|
170
170
|
|
|
171
171
|
- [Tracing Overview](https://mastra.ai/docs/observability/tracing/overview): Complete guide
|
|
172
172
|
|
|
173
|
-
### Other
|
|
173
|
+
### Other exporters
|
|
174
174
|
|
|
175
175
|
- [CloudExporter](https://mastra.ai/reference/observability/tracing/exporters/cloud-exporter): Mastra platform
|
|
176
176
|
- [ConsoleExporter](https://mastra.ai/reference/observability/tracing/exporters/console-exporter): Debug output
|
|
@@ -86,7 +86,7 @@ Flushes pending data and shuts down both the span processor and the client.
|
|
|
86
86
|
|
|
87
87
|
## Usage
|
|
88
88
|
|
|
89
|
-
### Zero-
|
|
89
|
+
### Zero-config (using environment variables)
|
|
90
90
|
|
|
91
91
|
```typescript
|
|
92
92
|
import { LangfuseExporter } from '@mastra/langfuse'
|
|
@@ -95,7 +95,7 @@ import { LangfuseExporter } from '@mastra/langfuse'
|
|
|
95
95
|
const exporter = new LangfuseExporter()
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
### Explicit
|
|
98
|
+
### Explicit configuration
|
|
99
99
|
|
|
100
100
|
```typescript
|
|
101
101
|
import { LangfuseExporter } from '@mastra/langfuse'
|
|
@@ -154,7 +154,7 @@ const agent = new Agent({
|
|
|
154
154
|
})
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
-
### Helper
|
|
157
|
+
### Helper functions
|
|
158
158
|
|
|
159
159
|
#### `withLangfusePrompt(prompt)`
|
|
160
160
|
|
package/dist/docs/references/reference-observability-tracing-exporters-mastra-platform-exporter.md
CHANGED
|
@@ -318,7 +318,7 @@ The original `CloudExporter` is preserved unchanged so dashboards or alert rules
|
|
|
318
318
|
|
|
319
319
|
- [Tracing Overview](https://mastra.ai/docs/observability/tracing/overview): Complete guide
|
|
320
320
|
|
|
321
|
-
### Other
|
|
321
|
+
### Other exporters
|
|
322
322
|
|
|
323
323
|
- [MastraStorageExporter](https://mastra.ai/reference/observability/tracing/exporters/mastra-storage-exporter): Storage persistence
|
|
324
324
|
- [ConsoleExporter](https://mastra.ai/reference/observability/tracing/exporters/console-exporter): Debug output
|
package/dist/docs/references/reference-observability-tracing-exporters-mastra-storage-exporter.md
CHANGED
|
@@ -83,7 +83,7 @@ Inspect the current queue with `exporter.getByteBatchingStats()`.
|
|
|
83
83
|
type TracingStorageStrategy = 'realtime' | 'batch-with-updates' | 'insert-only'
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
### Strategy
|
|
86
|
+
### Strategy behaviors
|
|
87
87
|
|
|
88
88
|
- **realtime**: Immediately persists each event to storage. Use it only in single-process local development. It isn't supported with durable execution: when a durable agent or an Inngest, Temporal, or evented workflow is registered, the exporter logs one warning and runs `batch-with-updates`.
|
|
89
89
|
- **batch-with-updates**: Batches creates and updates separately, applies in order
|
|
@@ -153,7 +153,7 @@ The exporter will:
|
|
|
153
153
|
|
|
154
154
|
## Batching behavior
|
|
155
155
|
|
|
156
|
-
### Flush
|
|
156
|
+
### Flush triggers
|
|
157
157
|
|
|
158
158
|
The buffer flushes when any of these conditions are met:
|
|
159
159
|
|
|
@@ -162,7 +162,7 @@ The buffer flushes when any of these conditions are met:
|
|
|
162
162
|
- Buffer size reaches `maxBufferSize` (emergency flush)
|
|
163
163
|
- `shutdown()` is called
|
|
164
164
|
|
|
165
|
-
### Retry
|
|
165
|
+
### Retry logic
|
|
166
166
|
|
|
167
167
|
Failed flushes are retried with exponential backoff:
|
|
168
168
|
|
|
@@ -170,7 +170,7 @@ Failed flushes are retried with exponential backoff:
|
|
|
170
170
|
- Maximum attempts: `maxRetries`
|
|
171
171
|
- Batch is dropped after all retries fail
|
|
172
172
|
|
|
173
|
-
### Out-of-
|
|
173
|
+
### Out-of-order handling
|
|
174
174
|
|
|
175
175
|
For `batch-with-updates` strategy:
|
|
176
176
|
|
|
@@ -221,7 +221,7 @@ The original `DefaultExporter` is preserved unchanged so dashboards or alert rul
|
|
|
221
221
|
|
|
222
222
|
- [Tracing Overview](https://mastra.ai/docs/observability/tracing/overview): Complete guide
|
|
223
223
|
|
|
224
|
-
### Other
|
|
224
|
+
### Other exporters
|
|
225
225
|
|
|
226
226
|
- [MastraPlatformExporter](https://mastra.ai/reference/observability/tracing/exporters/mastra-platform-exporter): Mastra platform
|
|
227
227
|
- [ConsoleExporter](https://mastra.ai/reference/observability/tracing/exporters/console-exporter): Debug output
|
|
@@ -57,7 +57,7 @@ Ends all active spans and clears internal state before closing the Sentry connec
|
|
|
57
57
|
|
|
58
58
|
## Usage
|
|
59
59
|
|
|
60
|
-
### Zero-
|
|
60
|
+
### Zero-config (using environment variables)
|
|
61
61
|
|
|
62
62
|
```typescript
|
|
63
63
|
import { SentryExporter } from '@mastra/sentry'
|
|
@@ -66,7 +66,7 @@ import { SentryExporter } from '@mastra/sentry'
|
|
|
66
66
|
const exporter = new SentryExporter()
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
### Explicit
|
|
69
|
+
### Explicit configuration
|
|
70
70
|
|
|
71
71
|
```typescript
|
|
72
72
|
import { SentryExporter } from '@mastra/sentry'
|
|
@@ -79,7 +79,7 @@ const exporter = new SentryExporter({
|
|
|
79
79
|
})
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
### With
|
|
82
|
+
### With sampling
|
|
83
83
|
|
|
84
84
|
```typescript
|
|
85
85
|
const exporter = new SentryExporter({
|
|
@@ -89,7 +89,7 @@ const exporter = new SentryExporter({
|
|
|
89
89
|
})
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
### With
|
|
92
|
+
### With custom Sentry options
|
|
93
93
|
|
|
94
94
|
```typescript
|
|
95
95
|
const exporter = new SentryExporter({
|
package/dist/index.cjs
CHANGED
|
@@ -6783,7 +6783,7 @@ var BaseObservabilityInstance = class extends _mastra_core_base.MastraBase {
|
|
|
6783
6783
|
computeTraceState(tracingOptions) {
|
|
6784
6784
|
const configuredKeys = this.config.requestContextKeys ?? [];
|
|
6785
6785
|
const additionalKeys = tracingOptions?.requestContextKeys ?? [];
|
|
6786
|
-
const allKeys = [...configuredKeys, ...additionalKeys];
|
|
6786
|
+
const allKeys = [.../* @__PURE__ */ new Set([...configuredKeys, ...additionalKeys])];
|
|
6787
6787
|
const hideInput = tracingOptions?.hideInput;
|
|
6788
6788
|
const hideOutput = tracingOptions?.hideOutput;
|
|
6789
6789
|
const nestedUnderParent = tracingOptions?.nestUnderParent === true;
|