@mastra/mcp-docs-server 0.13.24 → 0.13.25-alpha.1
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/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +8 -8
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +2 -0
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +24 -1
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +22 -0
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +46 -46
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +104 -104
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +40 -40
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +59 -59
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +24 -24
- package/.docs/organized/changelogs/%40mastra%2Flance.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +25 -25
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +27 -27
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +73 -73
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Frag.md +22 -22
- package/.docs/organized/changelogs/%40mastra%2Freact.md +17 -0
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +18 -0
- package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +51 -51
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +24 -24
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +20 -3
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +18 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +20 -20
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +19 -19
- package/.docs/organized/changelogs/create-mastra.md +32 -32
- package/.docs/organized/changelogs/mastra.md +64 -64
- package/.docs/organized/code-examples/agent.md +0 -4
- package/.docs/organized/code-examples/ai-elements.md +47 -0
- package/.docs/organized/code-examples/heads-up-game.md +5 -5
- package/.docs/raw/auth/clerk.mdx +3 -3
- package/.docs/raw/index.mdx +1 -0
- package/.docs/raw/observability/ai-tracing/exporters/braintrust.mdx +81 -0
- package/.docs/raw/observability/ai-tracing/exporters/cloud.mdx +120 -0
- package/.docs/raw/observability/ai-tracing/exporters/default.mdx +168 -0
- package/.docs/raw/observability/ai-tracing/exporters/langfuse.mdx +121 -0
- package/.docs/raw/observability/ai-tracing/exporters/langsmith.mdx +88 -0
- package/.docs/raw/observability/ai-tracing/exporters/otel.mdx +250 -0
- package/.docs/raw/observability/ai-tracing/overview.mdx +565 -0
- package/.docs/raw/observability/ai-tracing/processors/sensitive-data-filter.mdx +274 -0
- package/.docs/raw/observability/{tracing.mdx → otel-tracing.mdx} +2 -2
- package/.docs/raw/observability/overview.mdx +66 -0
- package/.docs/raw/reference/agents/generate.mdx +39 -1
- package/.docs/raw/reference/agents/generateVNext.mdx +34 -2
- package/.docs/raw/reference/agents/network.mdx +35 -3
- package/.docs/raw/reference/auth/clerk.mdx +1 -1
- package/.docs/raw/reference/client-js/agents.mdx +4 -13
- package/.docs/raw/reference/client-js/mastra-client.mdx +10 -0
- package/.docs/raw/reference/client-js/observability.mdx +76 -0
- package/.docs/raw/reference/core/getScorer.mdx +75 -0
- package/.docs/raw/reference/core/getScorerByName.mdx +75 -0
- package/.docs/raw/reference/core/getScorers.mdx +42 -0
- package/.docs/raw/reference/core/mastra-class.mdx +7 -0
- package/.docs/raw/reference/observability/ai-tracing/ai-tracing.mdx +182 -0
- package/.docs/raw/reference/observability/ai-tracing/configuration.mdx +234 -0
- package/.docs/raw/reference/observability/ai-tracing/exporters/braintrust.mdx +112 -0
- package/.docs/raw/reference/observability/ai-tracing/exporters/cloud-exporter.mdx +176 -0
- package/.docs/raw/reference/observability/ai-tracing/exporters/console-exporter.mdx +148 -0
- package/.docs/raw/reference/observability/ai-tracing/exporters/default-exporter.mdx +196 -0
- package/.docs/raw/reference/observability/ai-tracing/exporters/langfuse.mdx +116 -0
- package/.docs/raw/reference/observability/ai-tracing/exporters/langsmith.mdx +112 -0
- package/.docs/raw/reference/observability/ai-tracing/exporters/otel.mdx +355 -0
- package/.docs/raw/reference/observability/ai-tracing/interfaces.mdx +651 -0
- package/.docs/raw/reference/observability/ai-tracing/processors/sensitive-data-filter.mdx +178 -0
- package/.docs/raw/reference/observability/ai-tracing/span.mdx +371 -0
- package/.docs/raw/reference/observability/{logger.mdx → logging/pino-logger.mdx} +1 -1
- package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/index.mdx +6 -4
- package/.docs/raw/reference/scorers/create-scorer.mdx +59 -9
- package/.docs/raw/reference/scorers/mastra-scorer.mdx +6 -0
- package/.docs/raw/reference/scorers/run-experiment.mdx +216 -0
- package/.docs/raw/reference/streaming/ChunkType.mdx +3 -2
- package/.docs/raw/reference/streaming/agents/MastraModelOutput.mdx +1 -1
- package/.docs/raw/reference/streaming/agents/stream.mdx +41 -3
- package/.docs/raw/reference/streaming/agents/streamVNext.mdx +34 -2
- package/.docs/raw/reference/streaming/workflows/resumeStreamVNext.mdx +17 -1
- package/.docs/raw/reference/streaming/workflows/stream.mdx +39 -1
- package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +39 -1
- package/.docs/raw/reference/tools/create-tool.mdx +34 -1
- package/.docs/raw/reference/workflows/run-methods/resume.mdx +38 -0
- package/.docs/raw/reference/workflows/run-methods/start.mdx +38 -0
- package/.docs/raw/scorers/custom-scorers.mdx +16 -1
- package/.docs/raw/scorers/overview.mdx +28 -0
- package/CHANGELOG.md +15 -0
- package/package.json +6 -6
- package/.docs/raw/observability/ai-tracing.mdx +0 -597
- /package/.docs/raw/reference/observability/{otel-config.mdx → otel-tracing/otel-config.mdx} +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/arize-ax.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/arize-phoenix.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/braintrust.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/dash0.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/keywordsai.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/laminar.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/langfuse.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/langsmith.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/langwatch.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/new-relic.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/signoz.mdx +0 -0
- /package/.docs/raw/reference/observability/{providers → otel-tracing/providers}/traceloop.mdx +0 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "LangfuseExporter | Exporters | AI Tracing | Reference"
|
|
3
|
+
description: Langfuse exporter for AI tracing
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { PropertiesTable } from "@/components/properties-table";
|
|
7
|
+
|
|
8
|
+
# LangfuseExporter
|
|
9
|
+
|
|
10
|
+
Sends AI tracing data to Langfuse for observability.
|
|
11
|
+
|
|
12
|
+
## Constructor
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
new LangfuseExporter(config: LangfuseExporterConfig)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## LangfuseExporterConfig
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
interface LangfuseExporterConfig {
|
|
22
|
+
publicKey?: string;
|
|
23
|
+
secretKey?: string;
|
|
24
|
+
baseUrl?: string;
|
|
25
|
+
realtime?: boolean;
|
|
26
|
+
logLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
27
|
+
options?: any;
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
<PropertiesTable
|
|
32
|
+
props={[
|
|
33
|
+
{
|
|
34
|
+
name: "publicKey",
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Langfuse API key",
|
|
37
|
+
required: false,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "secretKey",
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Langfuse secret key",
|
|
43
|
+
required: false,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: "baseUrl",
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "Langfuse host URL",
|
|
49
|
+
required: false,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "realtime",
|
|
53
|
+
type: "boolean",
|
|
54
|
+
description: "Enable realtime mode - flushes after each event",
|
|
55
|
+
required: false,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "logLevel",
|
|
59
|
+
type: "'debug' | 'info' | 'warn' | 'error'",
|
|
60
|
+
description: "Logger level (default: 'warn')",
|
|
61
|
+
required: false,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "options",
|
|
65
|
+
type: "any",
|
|
66
|
+
description: "Additional Langfuse client options",
|
|
67
|
+
required: false,
|
|
68
|
+
},
|
|
69
|
+
]}
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
## Methods
|
|
73
|
+
|
|
74
|
+
### exportEvent
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
async exportEvent(event: AITracingEvent): Promise<void>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Exports a tracing event to Langfuse.
|
|
81
|
+
|
|
82
|
+
### export
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
async export(spans: ReadOnlyAISpan[]): Promise<void>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Batch exports spans to Langfuse.
|
|
89
|
+
|
|
90
|
+
### shutdown
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
async shutdown(): Promise<void>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Flushes pending data and shuts down the client.
|
|
97
|
+
|
|
98
|
+
## Usage
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { LangfuseExporter } from '@mastra/langfuse';
|
|
102
|
+
|
|
103
|
+
const exporter = new LangfuseExporter({
|
|
104
|
+
publicKey: process.env.LANGFUSE_PUBLIC_KEY,
|
|
105
|
+
secretKey: process.env.LANGFUSE_SECRET_KEY,
|
|
106
|
+
baseUrl: 'https://cloud.langfuse.com',
|
|
107
|
+
realtime: true,
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Span Mapping
|
|
112
|
+
|
|
113
|
+
- Root spans → Langfuse traces
|
|
114
|
+
- `LLM_GENERATION` spans → Langfuse generations
|
|
115
|
+
- All other spans → Langfuse spans
|
|
116
|
+
- Event spans → Langfuse events
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "LangSmithExporter | Exporters | AI Tracing | Reference"
|
|
3
|
+
description: LangSmith exporter for AI tracing
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { PropertiesTable } from "@/components/properties-table";
|
|
7
|
+
|
|
8
|
+
# LangSmithExporter
|
|
9
|
+
|
|
10
|
+
Sends AI tracing data to LangSmith for observability.
|
|
11
|
+
|
|
12
|
+
## Constructor
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
new LangSmithExporter(config: LangSmithExporterConfig)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## LangSmithExporterConfig
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
interface LangSmithExporterConfig extends ClientConfig {
|
|
22
|
+
logLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
23
|
+
client?: Client;
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
<PropertiesTable
|
|
28
|
+
props={[
|
|
29
|
+
{
|
|
30
|
+
name: "apiKey",
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "LangSmith API key",
|
|
33
|
+
required: false,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "apiUrl",
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "LangSmith API URL",
|
|
39
|
+
required: false,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "callerOptions",
|
|
43
|
+
type: "object",
|
|
44
|
+
description: "HTTP client configuration options",
|
|
45
|
+
required: false,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "hideInputs",
|
|
49
|
+
type: "boolean",
|
|
50
|
+
description: "Hide input data in the LangSmith UI",
|
|
51
|
+
required: false,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "hideOutputs",
|
|
55
|
+
type: "boolean",
|
|
56
|
+
description: "Hide output data in the LangSmith UI",
|
|
57
|
+
required: false,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "logLevel",
|
|
61
|
+
type: "'debug' | 'info' | 'warn' | 'error'",
|
|
62
|
+
description: "Logger level (default: 'warn')",
|
|
63
|
+
required: false,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "client",
|
|
67
|
+
type: "Client",
|
|
68
|
+
description: "Pre-configured LangSmith client instance",
|
|
69
|
+
required: false,
|
|
70
|
+
},
|
|
71
|
+
]}
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
## Methods
|
|
75
|
+
|
|
76
|
+
### exportEvent
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
async exportEvent(event: AITracingEvent): Promise<void>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Exports a tracing event to LangSmith.
|
|
83
|
+
|
|
84
|
+
### shutdown
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
async shutdown(): Promise<void>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Ends all active spans and clears the trace map.
|
|
91
|
+
|
|
92
|
+
## Usage
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
import { LangSmithExporter } from '@mastra/langsmith';
|
|
96
|
+
|
|
97
|
+
const exporter = new LangSmithExporter({
|
|
98
|
+
apiKey: process.env.LANGSMITH_API_KEY,
|
|
99
|
+
apiUrl: 'https://api.smith.langchain.com',
|
|
100
|
+
logLevel: 'info',
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Span Type Mapping
|
|
105
|
+
|
|
106
|
+
| AI Span Type | LangSmith Type |
|
|
107
|
+
|--------------|----------------|
|
|
108
|
+
| `LLM_GENERATION` | `llm` |
|
|
109
|
+
| `LLM_CHUNK` | `llm` |
|
|
110
|
+
| `TOOL_CALL` | `tool` |
|
|
111
|
+
| `MCP_TOOL_CALL` | `tool` |
|
|
112
|
+
| All others | `chain` |
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "OtelExporter | Exporters | AI Tracing | Reference"
|
|
3
|
+
description: OpenTelemetry exporter for AI tracing
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { PropertiesTable } from "@/components/properties-table";
|
|
7
|
+
import { Callout } from "nextra/components";
|
|
8
|
+
|
|
9
|
+
# OtelExporter
|
|
10
|
+
|
|
11
|
+
<Callout type="warning">
|
|
12
|
+
The OtelExporter is currently **experimental**. APIs and configuration options may change in future releases.
|
|
13
|
+
</Callout>
|
|
14
|
+
|
|
15
|
+
Sends AI tracing data to any OpenTelemetry-compatible observability platform using standardized GenAI semantic conventions.
|
|
16
|
+
|
|
17
|
+
## Constructor
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
new OtelExporter(config: OtelExporterConfig)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## OtelExporterConfig
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
interface OtelExporterConfig {
|
|
27
|
+
provider?: ProviderConfig;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
batchSize?: number;
|
|
30
|
+
logLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
<PropertiesTable
|
|
35
|
+
props={[
|
|
36
|
+
{
|
|
37
|
+
name: "provider",
|
|
38
|
+
type: "ProviderConfig",
|
|
39
|
+
description: "Provider-specific configuration (see below)",
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "timeout",
|
|
44
|
+
type: "number",
|
|
45
|
+
description: "Export timeout in milliseconds (default: 30000)",
|
|
46
|
+
required: false,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "batchSize",
|
|
50
|
+
type: "number",
|
|
51
|
+
description: "Number of spans per batch (default: 100)",
|
|
52
|
+
required: false,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "logLevel",
|
|
56
|
+
type: "'debug' | 'info' | 'warn' | 'error'",
|
|
57
|
+
description: "Logger level (default: 'warn')",
|
|
58
|
+
required: false,
|
|
59
|
+
},
|
|
60
|
+
]}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
## Provider Configurations
|
|
64
|
+
|
|
65
|
+
### Dash0Config
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
interface Dash0Config {
|
|
69
|
+
apiKey: string;
|
|
70
|
+
endpoint: string;
|
|
71
|
+
dataset?: string;
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
<PropertiesTable
|
|
76
|
+
props={[
|
|
77
|
+
{
|
|
78
|
+
name: "apiKey",
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "Dash0 API key",
|
|
81
|
+
required: true,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "endpoint",
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "Dash0 ingress endpoint (e.g., ingress.us-west-2.aws.dash0.com:4317)",
|
|
87
|
+
required: true,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "dataset",
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "Optional dataset name for data organization",
|
|
93
|
+
required: false,
|
|
94
|
+
},
|
|
95
|
+
]}
|
|
96
|
+
/>
|
|
97
|
+
|
|
98
|
+
### SignozConfig
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
interface SignozConfig {
|
|
102
|
+
apiKey: string;
|
|
103
|
+
region?: 'us' | 'eu' | 'in';
|
|
104
|
+
endpoint?: string;
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
<PropertiesTable
|
|
109
|
+
props={[
|
|
110
|
+
{
|
|
111
|
+
name: "apiKey",
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "SigNoz ingestion key",
|
|
114
|
+
required: true,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: "region",
|
|
118
|
+
type: "'us' | 'eu' | 'in'",
|
|
119
|
+
description: "SigNoz cloud region (default: 'us')",
|
|
120
|
+
required: false,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "endpoint",
|
|
124
|
+
type: "string",
|
|
125
|
+
description: "Custom endpoint for self-hosted SigNoz",
|
|
126
|
+
required: false,
|
|
127
|
+
},
|
|
128
|
+
]}
|
|
129
|
+
/>
|
|
130
|
+
|
|
131
|
+
### NewRelicConfig
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
interface NewRelicConfig {
|
|
135
|
+
apiKey: string;
|
|
136
|
+
endpoint?: string;
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
<PropertiesTable
|
|
141
|
+
props={[
|
|
142
|
+
{
|
|
143
|
+
name: "apiKey",
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "New Relic license key",
|
|
146
|
+
required: true,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "endpoint",
|
|
150
|
+
type: "string",
|
|
151
|
+
description: "Custom endpoint (default: https://otlp.nr-data.net:443/v1/traces)",
|
|
152
|
+
required: false,
|
|
153
|
+
},
|
|
154
|
+
]}
|
|
155
|
+
/>
|
|
156
|
+
|
|
157
|
+
### TraceloopConfig
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
interface TraceloopConfig {
|
|
161
|
+
apiKey: string;
|
|
162
|
+
destinationId?: string;
|
|
163
|
+
endpoint?: string;
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
<PropertiesTable
|
|
168
|
+
props={[
|
|
169
|
+
{
|
|
170
|
+
name: "apiKey",
|
|
171
|
+
type: "string",
|
|
172
|
+
description: "Traceloop API key",
|
|
173
|
+
required: true,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "destinationId",
|
|
177
|
+
type: "string",
|
|
178
|
+
description: "Optional destination identifier",
|
|
179
|
+
required: false,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: "endpoint",
|
|
183
|
+
type: "string",
|
|
184
|
+
description: "Custom endpoint (default: https://api.traceloop.com/v1/traces)",
|
|
185
|
+
required: false,
|
|
186
|
+
},
|
|
187
|
+
]}
|
|
188
|
+
/>
|
|
189
|
+
|
|
190
|
+
### LaminarConfig
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
interface LaminarConfig {
|
|
194
|
+
apiKey: string;
|
|
195
|
+
teamId?: string;
|
|
196
|
+
endpoint?: string;
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
<PropertiesTable
|
|
201
|
+
props={[
|
|
202
|
+
{
|
|
203
|
+
name: "apiKey",
|
|
204
|
+
type: "string",
|
|
205
|
+
description: "Laminar project API key",
|
|
206
|
+
required: true,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "teamId",
|
|
210
|
+
type: "string",
|
|
211
|
+
description: "Optional team identifier (for backwards compatibility)",
|
|
212
|
+
required: false,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "endpoint",
|
|
216
|
+
type: "string",
|
|
217
|
+
description: "Custom endpoint (default: https://api.lmnr.ai/v1/traces)",
|
|
218
|
+
required: false,
|
|
219
|
+
},
|
|
220
|
+
]}
|
|
221
|
+
/>
|
|
222
|
+
|
|
223
|
+
### CustomConfig
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
interface CustomConfig {
|
|
227
|
+
endpoint: string;
|
|
228
|
+
protocol?: 'http/json' | 'http/protobuf' | 'grpc' | 'zipkin';
|
|
229
|
+
headers?: Record<string, string>;
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
<PropertiesTable
|
|
234
|
+
props={[
|
|
235
|
+
{
|
|
236
|
+
name: "endpoint",
|
|
237
|
+
type: "string",
|
|
238
|
+
description: "OTEL collector endpoint URL",
|
|
239
|
+
required: true,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "protocol",
|
|
243
|
+
type: "'http/json' | 'http/protobuf' | 'grpc' | 'zipkin'",
|
|
244
|
+
description: "Export protocol (default: 'http/json')",
|
|
245
|
+
required: false,
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: "headers",
|
|
249
|
+
type: "Record<string, string>",
|
|
250
|
+
description: "Custom headers for authentication",
|
|
251
|
+
required: false,
|
|
252
|
+
},
|
|
253
|
+
]}
|
|
254
|
+
/>
|
|
255
|
+
|
|
256
|
+
## Methods
|
|
257
|
+
|
|
258
|
+
### exportEvent
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
async exportEvent(event: AITracingEvent): Promise<void>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Exports a tracing event to the configured OTEL backend.
|
|
265
|
+
|
|
266
|
+
### shutdown
|
|
267
|
+
|
|
268
|
+
```typescript
|
|
269
|
+
async shutdown(): Promise<void>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Flushes pending traces and shuts down the exporter.
|
|
273
|
+
|
|
274
|
+
## Usage Examples
|
|
275
|
+
|
|
276
|
+
### Basic Usage
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
import { OtelExporter } from '@mastra/otel-exporter';
|
|
280
|
+
|
|
281
|
+
const exporter = new OtelExporter({
|
|
282
|
+
provider: {
|
|
283
|
+
signoz: {
|
|
284
|
+
apiKey: process.env.SIGNOZ_API_KEY,
|
|
285
|
+
region: 'us',
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### With Custom Endpoint
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
const exporter = new OtelExporter({
|
|
295
|
+
provider: {
|
|
296
|
+
custom: {
|
|
297
|
+
endpoint: 'https://my-collector.example.com/v1/traces',
|
|
298
|
+
protocol: 'http/protobuf',
|
|
299
|
+
headers: {
|
|
300
|
+
'x-api-key': process.env.API_KEY,
|
|
301
|
+
},
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
timeout: 60000,
|
|
305
|
+
logLevel: 'debug',
|
|
306
|
+
});
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Span Mapping
|
|
310
|
+
|
|
311
|
+
The exporter maps Mastra AI spans to OpenTelemetry spans following GenAI semantic conventions:
|
|
312
|
+
|
|
313
|
+
### Span Names
|
|
314
|
+
- `LLM_GENERATION` → `chat {model}` or `tool_selection {model}`
|
|
315
|
+
- `TOOL_CALL` → `tool.execute {tool_name}`
|
|
316
|
+
- `AGENT_RUN` → `agent.{agent_id}`
|
|
317
|
+
- `WORKFLOW_RUN` → `workflow.{workflow_id}`
|
|
318
|
+
|
|
319
|
+
### Span Kinds
|
|
320
|
+
- Root agent/workflow spans → `SERVER`
|
|
321
|
+
- LLM calls → `CLIENT`
|
|
322
|
+
- Tool calls → `INTERNAL` or `CLIENT`
|
|
323
|
+
- Workflow steps → `INTERNAL`
|
|
324
|
+
|
|
325
|
+
### Attributes
|
|
326
|
+
|
|
327
|
+
The exporter maps to standard OTEL GenAI attributes:
|
|
328
|
+
|
|
329
|
+
| Mastra Attribute | OTEL Attribute |
|
|
330
|
+
|------------------|----------------|
|
|
331
|
+
| `model` | `gen_ai.request.model` |
|
|
332
|
+
| `provider` | `gen_ai.system` |
|
|
333
|
+
| `inputTokens` / `promptTokens` | `gen_ai.usage.input_tokens` |
|
|
334
|
+
| `outputTokens` / `completionTokens` | `gen_ai.usage.output_tokens` |
|
|
335
|
+
| `temperature` | `gen_ai.request.temperature` |
|
|
336
|
+
| `maxOutputTokens` | `gen_ai.request.max_tokens` |
|
|
337
|
+
| `finishReason` | `gen_ai.response.finish_reasons` |
|
|
338
|
+
|
|
339
|
+
## Protocol Requirements
|
|
340
|
+
|
|
341
|
+
Different providers require different OTEL exporter packages:
|
|
342
|
+
|
|
343
|
+
| Protocol | Required Package | Providers |
|
|
344
|
+
|----------|------------------|-----------|
|
|
345
|
+
| gRPC | `@opentelemetry/exporter-trace-otlp-grpc` | Dash0 |
|
|
346
|
+
| HTTP/Protobuf | `@opentelemetry/exporter-trace-otlp-proto` | SigNoz, New Relic, Laminar |
|
|
347
|
+
| HTTP/JSON | `@opentelemetry/exporter-trace-otlp-http` | Traceloop, Custom |
|
|
348
|
+
| Zipkin | `@opentelemetry/exporter-zipkin` | Zipkin collectors |
|
|
349
|
+
|
|
350
|
+
## Parent-Child Relationships
|
|
351
|
+
|
|
352
|
+
The exporter preserves span hierarchy from Mastra's AI tracing:
|
|
353
|
+
- Uses `parentSpanId` directly from Mastra spans
|
|
354
|
+
- Maintains correct nesting for agents, workflows, LLM calls, and tools
|
|
355
|
+
- Exports complete traces with all relationships intact
|