Mastra Platform adds trace imports, starting with Langfuse support

Mastra has introduced trace imports for Mastra platform, letting users bring existing traces from third-party observability providers into the service. Langfuse is supported at launch, with more providers to follow, according to Mastra.
- Mastra platform can now import existing traces from third-party observability providers, starting with Langfuse.
- Imported traces keep span types, parent-child structure, timestamps, inputs, outputs, usage and cost.
- Scores, feedback, datasets, attachments and logs are not imported.
- Imports run via the mastra traces import langfuse command, with --dry-run, --since, --until and --resume options.
- The feature requires [email protected] and @mastra/[email protected] or later.
What trace imports do
Imported traces appear next to Mastra-generated traces in Mastra platform and in deployed Studio. According to Mastra, this lets developers debug, filter and compare across their full trace history without switching between tools.
The company frames the feature around a common pain point: switching observability providers often means losing valuable trace history, because existing data stays behind on the previous provider. With trace imports, teams can move to Mastra and take that history with them.
Until now, Mastra observability data could only be exported to third-party providers. Trace imports add the opposite direction. Mastra says the imported details are preserved: span types such as agent_run, model_generation and tool_call stay intact, along with parent-child structure, timestamps, inputs, outputs, usage and cost.
There are limits. Only trace observations are imported. Scores, feedback, datasets, attachments and logs are omitted.
Setting up an import from Langfuse
Users first need to upgrade the Mastra CLI and the @mastra/core dependency to the latest versions. Mastra states the feature requires [email protected] and @mastra/[email protected] or later.
Trace imports target a Mastra project that is already deployed to Mastra platform, and the project's access token and ID should already be set in the .env file as MASTRA_PLATFORM_ACCESS_TOKEN and MASTRA_PROJECT_ID.
On the Langfuse side, users create an API key under Settings, then API Keys, and add three environment variables: LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY and LANGFUSE_BASE_URL. The base URL defaults to the EU region, so users on another Langfuse region or a self-hosted instance need to set it explicitly. The example in the announcement uses https://us.cloud.langfuse.com.
Previewing, running and resuming imports
The import is run through the CLI with the command mastra traces import langfuse and a --target-project flag naming the deployed Mastra project. Adding --dry-run previews the import first.
In Mastra's example, the preview reported an import ID, the source Langfuse project, the target Mastra Platform project, the date window, and the volume of data: 6 traces and 146 spans prepared, none skipped, with 916.5 KiB of local data. The dry run ends with a command for uploading later using the import ID.
Without --dry-run, the CLI shows the same summary, asks for confirmation, uploads the traces and then verifies a sample through Mastra Platform. The --yes flag skips the confirmation. In the example, the result was 6 traces and 146 spans imported, with a report saved under the local ~/.mastra/imports/traces directory.
- --since and --until limit the import to a date range, using ISO 8601 timestamps.
- --resume with the import ID continues an interrupted import or uploads one previously previewed with --dry-run.
What it means for teams
For teams already using Langfuse, the feature removes one obstacle to trying Mastra platform: older traces no longer have to stay in a separate tool. Date filters and resumable uploads make it possible to move history in stages. Because scores, feedback, datasets, attachments and logs are not carried over, teams that rely on those will still need to keep them in Langfuse. Mastra has not said which providers will be supported after Langfuse.


