@mastra/arize 1.3.13-alpha.0 → 1.3.13-alpha.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.
Files changed (2) hide show
  1. package/README.md +13 -176
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @mastra/arize - OpenTelemetry + OpenInference Tracing Exporter
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
- ## Configuration
13
+ ## Usage
14
14
 
15
- You can add `ArizeExporter` to your Mastra configuration to export traces to Arize AX or Phoenix, or any other OpenTelemetry compatible observability platform that supports OpenInference.
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
- > [!TIP]
143
- > Need an Arize AX API key? [Get one here](https://app.arize.com/).
34
+ ## Documentation
144
35
 
145
- ## Optional Configuration
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
- ## OpenInference Semantic Conventions
38
+ ## Changelog
202
39
 
203
- This exporter follows the [OpenInference Semantic Conventions](https://github.com/Arize-ai/openinference/tree/main/spec) for generative AI applications.
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
- ## License
42
+ ## Support
206
43
 
207
- Apache 2.0
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/arize",
3
- "version": "1.3.13-alpha.0",
3
+ "version": "1.3.13-alpha.2",
4
4
  "description": "Arize observability provider for Mastra - includes tracing and future observability features",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,7 +30,7 @@
30
30
  "@opentelemetry/resources": "^2.10.0",
31
31
  "@opentelemetry/sdk-trace-base": "^2.10.0",
32
32
  "@opentelemetry/semantic-conventions": "^1.43.0",
33
- "@mastra/otel-exporter": "1.3.13-alpha.0"
33
+ "@mastra/otel-exporter": "1.3.13-alpha.2"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "22.20.1",
@@ -40,9 +40,9 @@
40
40
  "tsdown": "0.22.9",
41
41
  "typescript": "^7.0.2",
42
42
  "vitest": "4.1.10",
43
- "@internal/lint": "0.0.129",
44
43
  "@internal/types-builder": "0.0.104",
45
- "@mastra/core": "1.64.0-alpha.2"
44
+ "@internal/lint": "0.0.129",
45
+ "@mastra/core": "1.64.0-alpha.8"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@mastra/core": ">=1.16.0-0 <2.0.0-0"