Skip to main content
Quick setup? Instead of following these steps manually, copy a prompt into your coding agent and it will set this up for you automatically.
LangWatch integrates with Mastra through OpenTelemetry to capture traces from your Mastra agents automatically.

Installation

Usage

Configure your Mastra instance with OpenTelemetry exporter pointing to LangWatch:
Mastra automatically sends traces to LangWatch through the OpenTelemetry exporter. All agent interactions, tool calls, and workflow executions will be captured.

Check it worked

Run the example. The SDK flushes pending spans when the process exits. Then open your project in LangWatch: a new trace appears in the traces list within a few seconds. Open it to see the Mastra agent run and its model calls. If no trace appears, check that LANGWATCH_API_KEY is set in the environment the process runs in.
Last modified on October 29, 2026