Skip to main content
All Mastra integration capabilities

About

Stream Mastra agent traces into Sazabi. Add Mastra’s OtelExporter to your app’s observability config and point it at a Sazabi endpoint. Mastra creates and batches spans for your agent runs, so traces flow to Sazabi without you setting up the OpenTelemetry SDK yourself.

Prerequisites

  • A Mastra application using @mastra/core. You also need @mastra/otel-exporter and @mastra/observability.
  • Your Sazabi intake URL (shown above).

Set up in the dashboard

1

Set the intake URL

Set SAZABI_INTAKE_URL to your intake URL (shown above) in the application that initializes Mastra. Mastra’s custom OTLP exporter reads this environment variable.
2

Configure Mastra

Add Sazabi as a custom OTLP exporter in your Mastra observability config:
3

Redeploy the service

Redeploy or restart the service so Mastra picks up the new observability configuration and the SAZABI_INTAKE_URL environment variable.
4

Hand off the change

Commit these changes on a new branch, push it, and open a pull request. Keep the intake URL and any keys in environment variables or a secret store, and commit only configuration that references them.

Set up with the CLI

You can also register the Mastra log source with the Sazabi CLI (installed and authenticated — see CLI reference). Registering the source mints the same intake URL the dashboard shows above (the public key is embedded in its hostname):
The command prints the intake URL for the new source — copy the whole URL and point your sender at it using the configuration shown above. Run sazabi log-sources get <log-source-id> at any time to reprint the endpoint, or sazabi log-sources list to see every log source in the project.

Verify

Run a Mastra agent, tool, or workflow to generate a trace. Open the Intake page in the Sazabi dashboard and confirm traces from the Mastra source appear. Records typically arrive within a minute or two of the run.

Troubleshooting

No traces appear after running an agent — Confirm SAZABI_INTAKE_URL is set in the process environment and that new Observability({ configs: { default: { exporters: [...] } } }) is wired into the Mastra constructor. Check the application logs for exporter initialization errors. Spans have no agent or tool attributes — The OtelExporter sends spans produced by Mastra’s built-in instrumentation. If the agent definition is not registered with the Mastra instance, its runs produce no spans.

Further reading

Intake

See per-source ingestion volume and health in the Intake page.

Instrument

Learn how to send data to Sazabi.

Log sources

Browse the full log source catalog.