Mastra Tracing
Instrument Mastra projects to export AI tracing data to Arize AX using OpenTelemetry and OpenInference semantics.
Mastra integrates directly with Arize AX through the @mastra/arize exporter, enabling OpenTelemetry tracing that follows the OpenInference semantic conventions for enterprise observability.
Prerequisites
Mastra project generated with
npm create mastra@latestNode.js environment configured for your application
Access to an Arize AX space with API credentials
Installation
Install the Mastra Arize exporter alongside your Mastra project dependencies:
Arize AX Setup
Arize AX is the managed Arize AX for production workloads and enterprise governance.
Prerequisites
Arize AX account (
https://app.arize.com)Space ID for your organization
API key with tracing permissions
Environment variables
Basic setup
Advanced configuration
Fine-tune exporter behavior for Arize AX deployments.
Complete configuration
Batch processing options
Resource attributes
Running your Mastra application
Use the Mastra dev server to ensure tracing hooks are initialized and spans are exported.
When the dev server starts, Mastra generates the required instrumentation under .mastra/output/, boots the playground at http://localhost:4111, and begins streaming traces to your configured exporter.
Observe
Once connected, Mastra exports comprehensive traces that include agent steps, tool usage, LLM spans, embeddings, and retrieval analytics. The exporter adheres to OpenTelemetry and OpenInference semantics, streaming telemetry directly into Arize AX.
Resources
Last updated
Was this helpful?

