@traceroot-ai/mastra exporter package. This integrates with Mastra’s built-in OpenTelemetry observability system.
Install
- TypeScript
Set up
Configure TraceRoot as an exporter in your Mastra instance:Usage
Once configured, all agent calls are traced automatically:Verify
Run your code and confirm the trace arrives:- In the TraceRoot UI: Navigate to Tracing > Traces in TraceRoot Cloud. You should see a trace with root span
agent run: 'weatherAgent', named after the agent id. - Via the CLI: Run
traceroot traces listto inspect your recent traces from the terminal.
What gets captured
Limitations
- Tracing requires exporting spans through the
@traceroot-ai/mastraexporter package configured in Mastra’sObservabilitysystem.
Run the example
Clone the repo and run a complete agent end-to-end.TypeScript
Run the TypeScript example
Next steps
TypeScript SDK Reference
Explore the full TypeScript SDK reference and configuration options.
Cost Tracking
Learn how TraceRoot calculates token costs and tracks model spend.

