Skip to main content
Available via: native OpenTelemetry export (TypeScript). This is not a Zespan SDK wrapper — see Send traces from any OTel-instrumented app for how the underlying endpoint works.
Mastra has a built-in OTLP exporter as part of its Observability system — point it at Zespan and every agent run, workflow step, and tool call is traced with no separate instrumentation package.
Mastra’s telemetry API has changed across versions (telemetry config → Observability/OtelExporter), and an open proposal in Mastra’s repo discusses deprecating the OTel-based system in favor of a new one. Check Mastra’s current observability docs for the exporter shape on the version you’re running before copying this verbatim.

Installation

Setup

What gets captured

Agent runs, workflow steps, and tool calls map through the standard OpenTelemetry GenAI semantic conventions Zespan reads — model, tokens, prompts, and completions per step, connected into one trace per run.