Introducing Trace Imports for Mastra Platform

Import and inspect existing trace history.

Paul ScanlonPaul Scanlon·

Oct 14, 2026

·

3 min read

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:

GNU BashTerminal
npm install -g mastra@latest
npm install @mastra/core@latest
note

Requires mastra@1.34.1 and @mastra/core@1.77.0 or later, added in PR #24145 and PR #26779.

Trace imports target a Mastra project deployed to Mastra platform. The project's access token and ID should already be set in .env:

GNU Bash.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:

GNU Bash.env
LANGFUSE_PUBLIC_KEY=
LANGFUSE_SECRET_KEY=
LANGFUSE_BASE_URL=https://us.cloud.langfuse.com

LANGFUSE_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:

GNU BashTerminal
mastra traces import langfuse --target-project mastra-trace-imports --dry-run

Output:

┌  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-imports

Import

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:

GNU BashTerminal
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.json

Date window

To import traces from a specific date range, use the --since and --until flags with ISO 8601 timestamps:

GNU BashTerminal
mastra traces import langfuse --target-project ... --since 2026-10-01T00:00:00Z --until 2026-10-12T00:00:00Z

Resume

To continue an import that was interrupted, or to upload one you previewed with --dry-run, use the --resume flag with the import ID:

GNU BashTerminal
mastra traces import langfuse --target-project ... --resume 25992b5f...

For more information and full configuration options, see:

Share on X or LinkedIn
Paul Scanlon
Paul ScanlonTechnical Product Marketing Manager

Paul Scanlon sits between Developer Education and Product Marketing at Mastra. Previously, he was a Technical Product Marketing Manager at Neon and worked in Developer Relations at Gatsby, where he created educational content and developer experiences.

All articles by Paul Scanlon →