You can now import existing traces from third-party observability providers using trace imports.
Imported traces show up alongside your Mastra-generated traces in Mastra platform (and deployed Studio), letting you debug, filter and compare across your trace history without switching between tools.
We're starting today with Langfuse support, with more providers to follow.
Switching observability providers often means losing valuable trace history, with existing data left behind on the previous provider. By using trace imports, you can switch to Mastra and bring your trace history with you.
Before trace imports, Mastra observability data could only be exported to third-party providers. Now you can pull it back with the details preserved: span types like agent_run, model_generation and tool_call stay intact, along with parent-child structure, timestamps, inputs, outputs, usage and cost. Only trace observations are imported; scores, feedback, datasets, attachments and logs are omitted.
Get started
Upgrade the Mastra CLI and @mastra/core dependencies:
npm install -g mastra@latest
npm install @mastra/core@latestTrace imports target a Mastra project deployed to Mastra platform. The project's access token and ID should already be set in .env:
MASTRA_PLATFORM_ACCESS_TOKEN=
MASTRA_PROJECT_ID=To import traces from a Langfuse project, create an API key under Settings → API Keys in Langfuse, then add the following environment variables to your .env:
LANGFUSE_PUBLIC_KEY=
LANGFUSE_SECRET_KEY=
LANGFUSE_BASE_URL=https://us.cloud.langfuse.comLANGFUSE_BASE_URL defaults to the EU region. Set it to your Langfuse region, or self-hosted URL.
Preview an import
Set --target-project to the name of your deployed Mastra project, and use --dry-run to preview an import:
mastra traces import langfuse --target-project mastra-trace-imports --dry-runOutput:
┌ Mastra trace import
│
◇ Resolving Mastra Platform project
│
◇ Reading langfuse traces
│
◇ Prepared trace import ─────────────────────────────────────────────────╮
│ │
│ Import ID: 25992b5f... │
│ Source: Langfuse project "langfuse-trace-imports" │
│ (cmv54rv6...) at https://us.cloud.langfuse.com │
│ Target: Mastra Platform project "mastra-trace-imports" │
│ (53fc3cf2...) │
│ Window: 2026-09-14T08:57:54.479Z to 2026-10-14T08:57:54.479Z │
│ Prepared: 6 traces / 146 spans │
│ Skipped: 0 traces / 0 spans │
│ Local data: 916.5 KiB │
│ │
├─────────────────────────────────────────────────────────────────────────╯
│
└ Dry run complete. Upload later with:
mastra traces import langfuse --resume 25992b5f... --target-project mastra-trace-importsImport
Omit --dry-run to import the traces. The CLI shows the same summary, asks for confirmation, uploads, then verifies. You can use --yes to skip the confirmation:
mastra traces import langfuse --target-project mastra-trace-imports --yes◇ Uploading prepared traces
│
◇ Verifying a sample through Mastra Platform
│
◆ Imported 6 traces / 146 spans.
│
└ Trace import complete. Report: ~/.mastra/imports/traces/53fc3cf2.../25992b5f.../report.jsonDate window
To import traces from a specific date range, use the --since and --until flags with ISO 8601 timestamps:
mastra traces import langfuse --target-project ... --since 2026-10-01T00:00:00Z --until 2026-10-12T00:00:00ZResume
To continue an import that was interrupted, or to upload one you previewed with --dry-run, use the --resume flag with the import ID:
mastra traces import langfuse --target-project ... --resume 25992b5f...For more information and full configuration options, see:
