Mastra adds trace imports: switch observability vendors without leaving call history behind
Synopsis
Mastra platform now supports trace imports, pulling existing traces from third-party observability providers into Mastra so they sit alongside Mastra-generated traces for debugging, filtering and comparison. Previously Mastra observability data could only be exported to third-party providers, so switching vendors often meant leaving trace history behind. Langfuse is supported first, with more providers to follow; imports preserve span types such as agent_run, model_generation and tool_call, along with parent-child structure, timestamps, inputs, outputs, usage and cost, while scores, feedback, datasets, attachments and logs are omitted.
Interpretation
Mastra platform can now import existing traces from third-party observability providers, and imported traces appear alongside Mastra-generated traces in Mastra platform and deployed Studio, so debugging, filtering and comparison across trace history happen in one place. Before trace imports, Mastra observability data could only be exported to third-party providers, a one-way flow; switching providers often left existing trace history on the previous provider. Imports preserve span types such as agent_run, model_generation and tool_call, along with parent-child structure, timestamps, inputs, outputs, usage and cost; Langfuse is the first supported provider, with more providers stated to follow.
Imports run through the Mastra CLI: upgrade the CLI and @mastra/core dependencies, create an API key for the Langfuse project and add the environment variables, then run the import command with the target project name. The command previews by default, showing the same summary as a real import without uploading when --dry-run is set; omitting that flag uploads, and the CLI shows the summary, asks for confirmation, uploads and then verifies. Imports target a Mastra project deployed to Mastra platform whose access token and ID are already set in .env; LANGFUSE_BASE_URL defaults to the EU region and can point to another region or a self-hosted URL, and --since and --until accept ISO 8601 timestamps while --resume with an import ID continues an interrupted or previewed import.
Perspective
The feature targets projects deployed to Mastra platform, and imported traces appear in Mastra platform and deployed Studio alongside Mastra-generated traces. Langfuse is supported first, with more providers stated to follow. Imports cover trace observations only; scores, feedback, datasets, attachments and logs are outside the import scope.
Imports preserve span types, parent-child structure, timestamps, inputs, outputs, usage and cost, but scores, feedback, datasets, attachments and logs are explicitly excluded, so history that depends on those fields does not move with the traces. LANGFUSE_BASE_URL defaults to the EU region, and other regions or self-hosted deployments require manual configuration.
