Skip to content

docs(javascript): promote Mastra to a first-class framework guide - #19140

Open
sentry-junior[bot] wants to merge 4 commits into
masterfrom
docs/mastra-framework-guide
Open

docs(javascript): promote Mastra to a first-class framework guide#19140
sentry-junior[bot] wants to merge 4 commits into
masterfrom
docs/mastra-framework-guide

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Mastra was buried under host-framework configuration/integrations (e.g. Next.js), which doesn’t match how people actually run it.

This adds /platforms/javascript/guides/mastra/ as the canonical guide:

  • setup via @mastra/sentry on the Mastra instance (standalone first)
  • thin sections for server adapters + embed, linking out to Express/Hono/Next/etc.
  • redirects from old integration / agent-tracing Mastra URLs
  • product Agents getting-started + naming links updated
  • browser-only common pages mark javascript.mastra as notSupported

Requested by David Cramer.

--

View Junior Session [Sentry]

Move Mastra out of configuration/integrations under host frameworks into
/platforms/javascript/guides/mastra/. Keep setup on @mastra/sentry, link
host SDK guides for adapters/embed cases, and redirect old URLs.

Co-Authored-By: David Cramer <david@sentry.io>
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview Aug 26, 2026 11:12pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Preview Aug 26, 2026 11:12pm

Request Review

@github-actions github-actions Bot added the Priority: Needs Triage The PR description is missing valid priority information label Aug 26, 2026
@codeowner-assignment
codeowner-assignment Bot requested a review from a team August 26, 2026 22:36
Match the Elysia/Nitro/Effect guide shell: StepConnector, SplitLayout,
Install/Configure/Verify/Next Steps, Title Case headings, and DSN
placeholder. Keep adapter notes as linked callouts.

Co-Authored-By: David Cramer <david@sentry.io>
@dcramer
dcramer marked this pull request as ready for review August 26, 2026 22:44
@github-actions

Copy link
Copy Markdown
Contributor

Please update the IS YOUR CHANGE URGENT? section of the PR description:

  • Select exactly one option.
  • If you selected an urgent or other deadline, provide the date as YYYY-MM-DD.

This information helps the Docs team prioritize your review.

CI link check failed on privacy.mdx after the packages/replay path was
removed. Point at the last commit that still hosts that migration note.
Mastra uses @mastra/sentry, so the inherited Node CJS/ESM instrument.js
install tree is the wrong setup path. Match elysia/hono and exclude it.

Co-Authored-By: David Cramer <david@sentry.io>

Add the exporter on your Mastra instance. This is the supported path for Mastra agent tracing.

### Zero-Config Setup

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a weird title IMHO because it is not zero config, you still configure something (just not passing any options to it, but under zero config I'd understand "you need to do nothing")

- [Fastify](/platforms/javascript/guides/fastify/)
- [Koa](/platforms/javascript/guides/koa/)
- [NestJS](/platforms/javascript/guides/nestjs/)
- [Elysia](/platforms/javascript/guides/elysia/)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should likely also have a link to general node docs I suppose for "other framework/setup"?


1. Keep `@mastra/sentry` on the Mastra instance (this guide).
2. Set up the host framework SDK for the rest of the app, for example [Next.js](/platforms/javascript/guides/nextjs/) or [Astro](/platforms/javascript/guides/astro/).
3. On serverless hosts, call `await exporter.flush()` before the runtime freezes if spans are missing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should not really be necessary, the serverless SDKs etc. (and variants, e.g. running next.js on serverless etc) should do this for you I think.

@mydea

mydea commented Aug 27, 2026

Copy link
Copy Markdown
Member

One thing is missing, from looking over this (can also be added in a follow up I suppose):

  • A mastra icon (uses the default JS one which is not nice).

- [NestJS](/platforms/javascript/guides/nestjs/)
- [Elysia](/platforms/javascript/guides/elysia/)

### Embedded in Another App

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, after looking into this a bit more, I do not think this actually works 🤔 the mastra exporter runs it's own Sentry.init() from the node package, so this will likely not play together nicely with a next.js setup. generally, this will probably wipe away any other setup you've done (??) so as of now you can only really use this standalone, I think - but needs more testing to verify.

@stephanie-anderson

Copy link
Copy Markdown
Contributor

Replied on Slack, we should do this differently. Mind closing this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Needs Triage The PR description is missing valid priority information

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants