@mastra/arize 1.3.12 → 1.3.13-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/README.md +13 -176
- package/dist/openInferenceOTLPExporter.d.ts.map +1 -1
- package/dist/tracing.d.ts.map +1 -1
- package/package.json +7 -8
- package/CHANGELOG.md +0 -1658
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @mastra/arize
|
|
1
|
+
# @mastra/arize
|
|
2
2
|
|
|
3
3
|
Export Mastra traces to any OpenTelemetry observability platform that supports OpenInference, like [Arize AX](https://arize.com/generative-ai/), or [Phoenix](https://phoenix.arize.com/).
|
|
4
4
|
|
|
@@ -10,198 +10,35 @@ For more information on OpenInference, see the [OpenInference Semantic Conventio
|
|
|
10
10
|
npm install @mastra/arize
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Usage
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
The exporter automatically reads credentials from environment variables, enabling zero-config setup.
|
|
18
|
-
|
|
19
|
-
### Phoenix (Zero-Config)
|
|
20
|
-
|
|
21
|
-
Set environment variables and use zero-config:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
# Required - endpoint must end in /v1/traces
|
|
25
|
-
PHOENIX_COLLECTOR_ENDPOINT=http://localhost:6006/v1/traces
|
|
26
|
-
|
|
27
|
-
# Optional - for authenticated Phoenix instances
|
|
28
|
-
PHOENIX_API_KEY=your-api-key
|
|
29
|
-
|
|
30
|
-
# Optional - project name
|
|
31
|
-
PHOENIX_PROJECT_NAME=my-project
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
import { ArizeExporter } from '@mastra/arize';
|
|
36
|
-
import { Mastra } from '@mastra/core/mastra';
|
|
37
|
-
|
|
38
|
-
const mastra = new Mastra({
|
|
39
|
-
...,
|
|
40
|
-
observability: {
|
|
41
|
-
configs: {
|
|
42
|
-
arize: {
|
|
43
|
-
serviceName: 'my-service',
|
|
44
|
-
exporters: [new ArizeExporter()],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Phoenix (Explicit Configuration)
|
|
15
|
+
Set `PHOENIX_COLLECTOR_ENDPOINT` and, for authenticated instances, `PHOENIX_API_KEY`.
|
|
52
16
|
|
|
53
17
|
```typescript
|
|
54
|
-
import { ArizeExporter } from '@mastra/arize';
|
|
55
18
|
import { Mastra } from '@mastra/core/mastra';
|
|
56
|
-
|
|
57
|
-
const mastra = new Mastra({
|
|
58
|
-
...,
|
|
59
|
-
observability: {
|
|
60
|
-
configs: {
|
|
61
|
-
arize: {
|
|
62
|
-
serviceName: 'my-service',
|
|
63
|
-
exporters: [
|
|
64
|
-
new ArizeExporter({
|
|
65
|
-
endpoint: 'http://localhost:6006/v1/traces',
|
|
66
|
-
apiKey: 'your-api-key', // Optional
|
|
67
|
-
projectName: 'my-project', // Optional
|
|
68
|
-
}),
|
|
69
|
-
],
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
> [!TIP]
|
|
77
|
-
> You can easily use this exporter with both [self-hosted Phoenix](https://docs.arize.com/phoenix/deployment), or, [Phoenix Cloud](https://app.phoenix.arize.com/login).
|
|
78
|
-
>
|
|
79
|
-
> To quickly verify functionality, you can try out a local in-memory Phoenix instance:
|
|
80
|
-
>
|
|
81
|
-
> ```bash
|
|
82
|
-
> docker run --pull=always -d --name arize-phoenix -p 6006:6006 -e PHOENIX_SQL_DATABASE_URL="sqlite:///:memory:" arizephoenix/phoenix:latest
|
|
83
|
-
> ```
|
|
84
|
-
>
|
|
85
|
-
> Configure your `ArizeExporter` endpoint to `http://localhost:6006/v1/traces` and run the default Mastra weather agent to see traces!
|
|
86
|
-
|
|
87
|
-
### Arize AX (Zero-Config)
|
|
88
|
-
|
|
89
|
-
Set environment variables and use zero-config:
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
# Required
|
|
93
|
-
ARIZE_SPACE_ID=your-space-id
|
|
94
|
-
ARIZE_API_KEY=your-api-key
|
|
95
|
-
|
|
96
|
-
# Optional
|
|
97
|
-
ARIZE_PROJECT_NAME=my-project
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
```typescript
|
|
19
|
+
import { Observability } from '@mastra/observability';
|
|
101
20
|
import { ArizeExporter } from '@mastra/arize';
|
|
102
|
-
import { Mastra } from '@mastra/core/mastra';
|
|
103
21
|
|
|
104
|
-
const mastra = new Mastra({
|
|
105
|
-
|
|
106
|
-
observability: {
|
|
22
|
+
export const mastra = new Mastra({
|
|
23
|
+
observability: new Observability({
|
|
107
24
|
configs: {
|
|
108
25
|
arize: {
|
|
109
26
|
serviceName: 'my-service',
|
|
110
27
|
exporters: [new ArizeExporter()],
|
|
111
28
|
},
|
|
112
29
|
},
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Arize AX (Explicit Configuration)
|
|
118
|
-
|
|
119
|
-
```typescript
|
|
120
|
-
import { ArizeExporter } from '@mastra/arize';
|
|
121
|
-
import { Mastra } from '@mastra/core/mastra';
|
|
122
|
-
|
|
123
|
-
const mastra = new Mastra({
|
|
124
|
-
...,
|
|
125
|
-
observability: {
|
|
126
|
-
configs: {
|
|
127
|
-
arize: {
|
|
128
|
-
serviceName: 'my-service',
|
|
129
|
-
exporters: [
|
|
130
|
-
new ArizeExporter({
|
|
131
|
-
spaceId: 'your-space-id',
|
|
132
|
-
apiKey: 'your-api-key',
|
|
133
|
-
projectName: 'my-project', // Optional
|
|
134
|
-
}),
|
|
135
|
-
],
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
},
|
|
30
|
+
}),
|
|
139
31
|
});
|
|
140
32
|
```
|
|
141
33
|
|
|
142
|
-
|
|
143
|
-
> Need an Arize AX API key? [Get one here](https://app.arize.com/).
|
|
34
|
+
## Documentation
|
|
144
35
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
You can configure the `ArizeExporter` to tweak the underlying OpenTelemetry `BatchSpanProcessor`, or add additional resource attributes to each span.
|
|
148
|
-
|
|
149
|
-
```typescript
|
|
150
|
-
import { ArizeExporter } from '@mastra/arize';
|
|
151
|
-
import { Mastra } from '@mastra/core/mastra';
|
|
152
|
-
|
|
153
|
-
const mastra = new Mastra({
|
|
154
|
-
...,
|
|
155
|
-
observability: {
|
|
156
|
-
configs: {
|
|
157
|
-
arize: {
|
|
158
|
-
serviceName: 'mastra-service',
|
|
159
|
-
exporters: [
|
|
160
|
-
new ArizeExporter({
|
|
161
|
-
// Required at runtime
|
|
162
|
-
endpoint: 'https://your-collector.example.com/v1/traces',
|
|
163
|
-
// Required if using authenticated endpoint
|
|
164
|
-
apiKey: "your-api-key",
|
|
165
|
-
// Optional headers to be added to each OTLP request, in addition to authentication headers
|
|
166
|
-
headers: {
|
|
167
|
-
'x-api-key': process.env.API_KEY,
|
|
168
|
-
},
|
|
169
|
-
// Optional log level for debugging the exporter
|
|
170
|
-
logLevel: 'debug',
|
|
171
|
-
// Optional batch size for the underlying BatchSpanProcessor, before spans are exported
|
|
172
|
-
batchSize: 512,
|
|
173
|
-
// Optional timeout for the underlying BatchSpanProcessor, before spans are exported
|
|
174
|
-
timeout: 30000,
|
|
175
|
-
// Optional resource attributes to be added to each span
|
|
176
|
-
resourceAttributes: {
|
|
177
|
-
'custom.attribute': 'value',
|
|
178
|
-
},
|
|
179
|
-
})
|
|
180
|
-
],
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
});
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Custom metadata
|
|
188
|
-
|
|
189
|
-
Any custom span attributes that are not part of the standard Mastra/OpenInference fields are serialized into the OpenInference `metadata` payload and shown in Arize/Phoenix. An easy way to add them is through `tracingOptions.metadata`:
|
|
190
|
-
|
|
191
|
-
```ts
|
|
192
|
-
await agent.generate(input, {
|
|
193
|
-
tracingOptions: {
|
|
194
|
-
metadata: {
|
|
195
|
-
companyId: 'acme-co',
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
});
|
|
199
|
-
```
|
|
36
|
+
- [@mastra/arize documentation](https://mastra.ai/integrations/observability/arize)
|
|
200
37
|
|
|
201
|
-
##
|
|
38
|
+
## Changelog
|
|
202
39
|
|
|
203
|
-
|
|
40
|
+
See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/observability/arize/CHANGELOG.md) for version history and release notes.
|
|
204
41
|
|
|
205
|
-
##
|
|
42
|
+
## Support
|
|
206
43
|
|
|
207
|
-
|
|
44
|
+
We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openInferenceOTLPExporter.d.ts","sourceRoot":"","sources":["../src/openInferenceOTLPExporter.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAiIlE,qBAAa,8BAA+B,SAAQ,iBAAiB;IACnE,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"openInferenceOTLPExporter.d.ts","sourceRoot":"","sources":["../src/openInferenceOTLPExporter.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAiIlE,qBAAa,8BAA+B,SAAQ,iBAAiB;IACnE,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,QA+F3E;CACF"}
|
package/dist/tracing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../src/tracing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG;IACvE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,qBAAa,aAAc,SAAQ,YAAY;IAC7C,IAAI,SAAW;
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../src/tracing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG;IACvE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC,CAAC;AAEF,qBAAa,aAAc,SAAQ,YAAY;IAC7C,IAAI,SAAW;IAEf,YAAY,MAAM,GAAE,mBAAwB,EA2E3C;CACF"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/arize",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.13-alpha.1",
|
|
4
4
|
"description": "Arize observability provider for Mastra - includes tracing and future observability features",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
"CHANGELOG.md"
|
|
9
|
+
"dist"
|
|
11
10
|
],
|
|
12
11
|
"exports": {
|
|
13
12
|
".": {
|
|
@@ -31,7 +30,7 @@
|
|
|
31
30
|
"@opentelemetry/resources": "^2.10.0",
|
|
32
31
|
"@opentelemetry/sdk-trace-base": "^2.10.0",
|
|
33
32
|
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
34
|
-
"@mastra/otel-exporter": "1.3.
|
|
33
|
+
"@mastra/otel-exporter": "1.3.13-alpha.1"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@types/node": "22.20.1",
|
|
@@ -39,11 +38,11 @@
|
|
|
39
38
|
"@vitest/ui": "4.1.10",
|
|
40
39
|
"eslint": "^10.7.0",
|
|
41
40
|
"tsdown": "0.22.9",
|
|
42
|
-
"typescript": "^
|
|
41
|
+
"typescript": "^7.0.2",
|
|
43
42
|
"vitest": "4.1.10",
|
|
44
|
-
"@internal/types-builder": "0.0.
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
43
|
+
"@internal/types-builder": "0.0.104",
|
|
44
|
+
"@internal/lint": "0.0.129",
|
|
45
|
+
"@mastra/core": "1.64.0-alpha.7"
|
|
47
46
|
},
|
|
48
47
|
"peerDependencies": {
|
|
49
48
|
"@mastra/core": ">=1.16.0-0 <2.0.0-0"
|