What your Mastra traces turn into
Complete agent and workflow runs you can inspect end to end, with recurring failures already grouped for you.
- Complete agent and workflow runsFollow one request across agent execution, workflow branches, nested steps, and model calls.
- Steps, tools, and modelsMastra agent runs, workflow steps, tool executions, and model interactions appear as nested spans.
- Failures and suspended runsFailed steps carry their error type and message, and a run that suspends and never resumes shows it.
- Cost, latency, and metadataFilter by token usage, estimated cost, duration, model, provider, tool, and status.
Three steps to your first Mastra trace
Add Mastra’s native OpenTelemetry exporter to the observability config you already use.
Install the exporter
Mastra and Latitude use standard OTLP over HTTP/Protobuf.
Point Mastra at Latitude
Add the exporter to Mastra’s Observability config. Agent runs, workflow steps, tools, and model calls emit automatically.
Run one workflow
Open Traces. Follow the workflow timeline and inspect each agent, step, tool, and model interaction. Mastra names step spans after the workflow, so you read a step from its input and output.
Serverless and short-lived runtimes should await mastra.observability.flush()before the runtime pauses or exits. Long-running servers export in the background. Mastra integration guide →
Debug Mastra failures in production
The workflow-state, retry, tool, and model failures that emerge after real traffic reaches branching agents.
Workflow steps fail or take the wrong branch
A step throws, or a condition routes production input down the wrong path. The failed step arrives with its error type and its input, and every branch condition arrives with the value it evaluated to, so the path taken is visible in the execution tree.
Retries hide a persistent failure
Mastra retries a failing step in place, so all attempts collapse into one span carrying the final error. A deterministic failure looks like a single bad run each time. Counting how many runs it affects is what turns it into one tracked Signal.
Suspended runs never resume
A workflow waits for approval, callback data, or a resource. A suspended run exports with its input and no output, and its resume lands in the same trace marked as resumed. The runs with no resume are the ones stuck.
Regressions after a workflow change
A prompt, tool, schema, model, or control-flow release raises failure rates. Tag traces by release and let resolved Signals reopen when the issue returns.
Find recurring failures hidden across Mastra runs
Reading traces one at a time finds the failure you went looking for. Latitude surfaces the one costing you the most sessions.
Search
Describe it in plain language
Find sessions by meaning, exact text, or metadata. The query above finds traces that never use those words.
Behaviors
Grouped by what users tried to do
Whole sessions clustered by intent and outcome, so patterns surface without you writing the query.
Signals
One named, tracked problem
Repeated failures become one Signal with a trend, affected sessions, and a lifecycle. Flaggers feed it automatically.
From production failure to verified fix
Turn a recurring Mastra failure into a regression test, an opened PR, and a verified fix.
Latitude detects and verifies. Your coding agent writes the fix. You review the PR.
Fits the Mastra stack you already have
- TypeScript
- Native Mastra OTLP exporter
- Agents, workflows, tools, and suspend/resume
- Any model provider
- Mastra Studio can stay enabled
- Latitude Cloud or self-hosted (MIT)
Using Mastra Studio or another observability backend?
Keep it. Mastra accepts multiple exporters. Retain MastraStorageExporter orMastraPlatformExporter for Studio and hosted Mastra visibility, then add Latitude’s OTLP destination to the same config.
Latitude begins building Search, Behaviors, and Signals from newly exported traces. Historical Mastra Platform or Studio traces are not imported.
When do you need more than Mastra logs and traces?
Mastra observability explains individual runs. Latitude adds cross-session discovery, recurring failure lifecycle, production evals, and coding-agent dispatch.
| Capability | Application logs | Mastra observability | Latitude |
|---|---|---|---|
| Complete agent sessions | Limited | Yes | Yes |
| Semantic search across sessions | No | Varies | Yes |
| Recurring failure detection | Manual | Varies | Signals |
| Production traces into evals | No | Varies | Yes |
| Dispatch and verification | No | No | Yes |
MIT
Open source, 4.6k stars
20K
Free credits a month, 30-day retention
Unlimited
Seats on every plan, no per-user pricing
GDPR
Compliant, data in AWS eu-central-1
Mastra observability FAQ
How do I send Mastra traces to Latitude?
Install @mastra/observability, @mastra/otel-exporter, and @opentelemetry/exporter-trace-otlp-proto. Add an OtelExporter with endpoint https://ingest.latitude.so/v1/traces, protocol http/protobuf, and the Latitude Authorization and X-Latitude-Project headers to your Mastra Observability config.
What does Latitude trace in Mastra?
Mastra emits spans for workflow runs and their steps, agent runs, tool calls, and model calls. Model spans carry the messages, model name, provider, token counts, and finish reason, so Latitude shows them with latency and estimated cost. Tool spans carry the tool name, arguments, and result. Workflow and step spans carry their input and output, and every Mastra attribute is kept on the span. One naming detail to expect: Mastra names step spans after the workflow rather than the step, so a step is identified by its input and output.
Can I keep Mastra Studio observability?
Yes. Keep MastraStorageExporter for Studio and MastraPlatformExporter for hosted Mastra, then add Latitude’s OTLP exporter to the exporters array. Mastra sends each completed span to the configured destinations.
What should I do in serverless Mastra deployments?
Use external storage for persisted Mastra observability and await mastra.observability.flush() before the runtime pauses or exits. Spans are batched with a delay of a few seconds, so the flush is what gives them time to reach Latitude.
Does Latitude sample Mastra traces?
Latitude captures 100% of the traces it ingests within your retention window. Mastra can apply its own trace sampling before export. Latitude’s LLM-based flaggers and evaluations can also sample at analysis time, starting around 10% by default.
Trace your first Mastra workflow
Connect Mastra’s native OTLP exporter, run one production-like agent or workflow, and inspect the complete execution in Latitude.
No credit card required.
Trace your Mastra agents and workflows in production