Skip to content

docs(javascript): rework Mastra guide to SDK-based setup, extend Node guide - #19445

Merged
mydea merged 11 commits into
masterfrom
mastra-guide-sdk-setup
Sep 21, 2026
Merged

mydea merged 11 commits into
masterfrom
mastra-guide-sdk-setup

Conversation

@mydea

@mydea mydea commented Sep 16, 2026

Copy link
Copy Markdown
Member

DESCRIBE YOUR PR

Reworks the standalone Mastra JavaScript guide to the Sentry SDK-based setup, mirroring the Eve guide (#19310). Based on the node-mastra and cloudflare-mastra e2e test apps.

  • Extends the Node guide (fallbackGuide: javascript.node) instead of inheritCommonContent: false, so the Mastra guide inherits the Node common pages. Adds the mastra icon.
  • Replaces the @mastra/sentry exporter with a plain Sentry.init(). Sentry's Mastra integration is enabled by default and auto-bootstraps observability through @mastra/observability. Adds a warning against running the community @mastra/sentry exporter alongside it.
  • Node setup (primary): instrument.mjs in src/mastra/public/, preloaded via mastra dev/start --custom-args="--import=./instrument.mjs".
  • Cloudflare Workers (install variant): @sentry/cloudflare + sentryCloudflareVitePlugin() + src/instrument.server.ts + nodejs_compat.
  • Requires @sentry/node / @sentry/cloudflare >=11.0.0-rc.0 and @mastra/core >=1.63.2; updates the captured-span mapping to the built-in integration.
  • Adds javascript.mastra to every supported/notSupported list in JS common content wherever javascript.eve appears (112 files), so inherited Node sections render and browser-only content is hidden from the Mastra guide. PlatformSection doesn't resolve fallbackGuide, so javascript.mastra must be enumerated alongside javascript.node/javascript.eve in both directions.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace YYYY-MM-DD with the due date. You can update this information later by editing the PR description.

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've supplied a deadline.

Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

🤖 Generated with Claude Code

@vercel

vercel Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sentry-docs Ready Ready Preview Sep 21, 2026 7:19am UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Preview Sep 21, 2026 7:19am UTC

Request Review

Comment thread docs/platforms/javascript/guides/mastra/index.mdx Outdated
Comment thread docs/platforms/javascript/guides/mastra/index.mdx Outdated

The Sentry SDK instruments Mastra on its own — there's no exporter to register and no manual wiring. Sentry's Mastra integration is enabled by default and reads Mastra's AI telemetry, so a plain `Sentry.init()` is all you need.

Running Mastra on Cloudflare Workers? Follow the [Cloudflare Quick Start](./cloudflare/) instead.

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.

Maybe we should put this into a highlighted box.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I updated this generally a bit!

Comment thread docs/platforms/javascript/guides/mastra/index.mdx Outdated
Comment thread docs/platforms/javascript/guides/mastra/index.mdx Outdated
Comment thread docs/platforms/javascript/guides/mastra/index.mdx Outdated
Comment on lines +111 to +122
## Privacy Controls

Generative AI inputs and outputs — the prompts your agent sends and the model responses it receives — are recorded on your AI spans by default. Review the data your agent handles and tighten this before production. To turn recording off, set `genAI.inputs` and `genAI.outputs` to `false` in `dataCollection`:

```javascript {filename:src/mastra/public/instrument.mjs}
Sentry.init({
dsn: "___PUBLIC_DSN___",
dataCollection: {
genAI: { inputs: false, outputs: false },
},
});
```

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.

Other docs show this as part of the "configure" step, I think we could also move this up to be aligned.

https://docs.sentry.io/platforms/javascript/#control-the-data-you-send-to-sentry-optional


## Privacy Controls

Generative AI inputs and outputs — the prompts your agent sends and the model responses it receives — are recorded on your AI spans by default. Review the data your agent handles and tighten this before production. To turn recording off, set `genAI.inputs` and `genAI.outputs` to `false` in `dataCollection`:

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.

Keep in mind, that inputs and outputs handle more than just the prompts. Maybe also link to this page, without listing everything inline: https://docs.sentry.io/platforms/javascript/configuration/options/#dataCollection

From our docs:

For inputs: Include the content of generative AI inputs. This gates system instructions, prompt messages, tool definitions, and tool call arguments.

For outputs: Include the content of generative AI outputs (e.g. completion text, tool call results).

https://develop.sentry.dev/sdk/foundations/client/data-collection/#datacollection-options

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

updates this whole section a bit to reflect this better and link out!

});
```

## Link Conversations

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.

Link Conversations and Next Steps is not part of the numbered view. Usually, the setup guides have numbered items until Next Steps.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

moved this up, good point!


</StepConnector>

## Privacy Controls

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.

Privacy Controls and Link Conversations probably also works in Cloudflare. You could create a platform include and use this in both guides.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I updated this so it is more or less the same in cloudflare and node. moved this into includes!

@RulaKhaled RulaKhaled left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

here

supported:
- javascript.node
- javascript.eve
- javascript.mastra

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed this whole thing and redirecting to the guide now!

@mydea
mydea force-pushed the mastra-guide-sdk-setup branch from 0dbcde0 to a94ac37 Compare September 17, 2026 11:23
@mydea mydea self-assigned this Sep 17, 2026
@mydea
mydea force-pushed the mastra-guide-sdk-setup branch from 1211929 to 5bda762 Compare September 17, 2026 12:49
@mydea
mydea force-pushed the mastra-guide-sdk-setup branch from f29b796 to f232f6c Compare September 18, 2026 07:24
@mydea
mydea marked this pull request as ready for review September 18, 2026 07:58
@codeowner-assignment
codeowner-assignment Bot requested a review from a team September 18, 2026 07:59
@mydea
mydea force-pushed the mastra-guide-sdk-setup branch from 8dccef0 to 67ad3bb Compare September 18, 2026 08:08
Comment thread src/components/sidebar/platformSidebar.tsx
Comment thread includes/mastra/link-conversations.mdx Outdated

@coolguyzone coolguyzone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks for updating!

@codeowner-assignment
codeowner-assignment Bot requested a review from a team September 21, 2026 06:59
Comment thread src/components/sidebar/platformSidebar.tsx
mydea and others added 11 commits September 21, 2026 09:11
… guide

Rework the standalone Mastra guide to the Sentry SDK-based setup (rc.0+),
mirroring the Eve guide.

- Extend the Node guide (fallbackGuide: javascript.node) instead of
  inheritCommonContent: false, with the mastra icon.
- Replace the @mastra/sentry exporter approach with a plain Sentry.init();
  Sentry's Mastra integration is enabled by default and needs @mastra/observability.
- Document the Node setup (instrument.mjs in src/mastra/public, preloaded via
  mastra --custom-args="--import=./instrument.mjs") as primary, with a Cloudflare
  Workers install variant (@sentry/cloudflare + sentryCloudflareVitePlugin +
  instrument.server.ts + nodejs_compat), matching the node-mastra and
  cloudflare-mastra e2e test apps.
- Require @sentry/node / @sentry/cloudflare >=11.0.0-rc.0 and @mastra/core >=1.63.2;
  update the captured-span mapping to the built-in integration.
- Add javascript.mastra to every supported/notSupported list in JS common content
  wherever javascript.eve appears, so inherited Node sections render and browser-only
  content is hidden from the Mastra guide.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Sigrid <32902192+s1gr1d@users.noreply.github.com>
Co-authored-by: Francesco Gringl-Novy <francesconovy@gmail.com>
…ptions

- Rework the Mastra guide's quick start to mirror the Eve guide: StepConnector
  stepper and OnboardingOptionButtons (error-monitoring / performance / profiling,
  performance on by default), with profiling install/config variants.
- Remove the old exporter-based agent-tracing/mastra.mdx subpage and redirect its
  routes (plus the older configuration/integrations and ai-agent-* aliases) directly
  to the standalone guide, matching how Eve was consolidated.
- Surface Mastra and Eve as link-only entries in every JavaScript Agent Tracing
  sidebar that navigate straight to their standalone guides (platformSidebar.tsx),
  reusing the existing Cloudflare alias mechanism. The Agent Tracing index grid keeps
  the Mastra and Eve cards.
- Note that users upgrading from the community @mastra/sentry exporter must remove it,
  and require @mastra/observability (no version pinned).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…stra

Recovers the standalone Cloudflare Quick Start (a force-push had overwritten it)
and reconciles it with the Node onboarding rework.

- Re-add guides/mastra/cloudflare/index.mdx (sidebar_order 0.5) as a self-contained
  Cloudflare Workers quick start that links back to the default quick start.
- Main quick start links to it ("Running Mastra on Cloudflare Workers? Follow the
  Cloudflare Quick Start instead.") and drops the inline Cloudflare Expandable; the
  Node onboarding options (performance default, profiling variants) stay.
- Make the main prerequisites Node-only and note that both `mastra build` and
  `mastra dev` copy `public/`.
- Clarify that Conversation linking is automatic via Mastra's memory thread id — no
  Sentry-specific setup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Move Privacy Controls and Link Conversations under Configuration as h3
  subsections in the main Mastra quick start.
- Rework the Cloudflare Quick Start to mirror the main quick start's structure
  and content (onboarding options, stepper, Configure with Privacy Controls and
  Link Conversations subheadings, Verify, Next Steps, What gets captured,
  Supported Versions), with Cloudflare-specific snippets. Profiling is omitted
  since it isn't available on Workers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract the content shared between the Node and Cloudflare Mastra quick starts
into reusable includes under includes/mastra/ and reference them from both pages:

- sdk-setup-alert, captured-summary, link-conversations, verify, next-steps,
  what-gets-captured.

Page-specific content (install commands, instrument snippets, Privacy Controls
code and its dataCollection link, Supported Versions) stays inline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Mastra guide has its own dedicated quick start, so it no longer inherits the
generic Agent Tracing provider pages. Remove javascript.mastra from the
agent-tracing library pages (openai, anthropic, google-genai, langchain,
langgraph, vercelai, manual-instrumentation, flue) so those pages are no longer
generated under the Mastra guide.

Keep javascript.mastra where the guide still inherits Node content: add it back
alongside javascript.eve in the tracing Session Replay notSupported lists so
browser-only content stays hidden from the Mastra guide.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rename the destructured `guide` in the standalone-guide agent-tracing alias
mapping so it no longer shadows the outer `guide` binding.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
@mydea
mydea force-pushed the mastra-guide-sdk-setup branch from c0fb579 to bda0708 Compare September 21, 2026 07:11
@mydea
mydea merged commit 9e60b4e into master Sep 21, 2026
24 checks passed
@mydea
mydea deleted the mastra-guide-sdk-setup branch September 21, 2026 07:28
RulaKhaled added a commit that referenced this pull request Sep 21, 2026
The Flue guide extends the Node guide through `fallbackGuide`, but
`PlatformSection` doesn't resolve that, so `javascript.flue` has to be
enumerated wherever `javascript.eve` already is — in both directions. Without
it the inherited Node sections don't render in the Flue guide and browser-only
content isn't hidden from it.

102 frontmatter entries and 37 PlatformSection arrays across 106 files, matching
what #19445 does for `javascript.mastra`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
inventarSarah pushed a commit that referenced this pull request Sep 29, 2026
… guide (#19445)

## DESCRIBE YOUR PR

Reworks the standalone **Mastra** JavaScript guide to the Sentry
SDK-based setup, mirroring the Eve guide (#19310). Based on the
[`node-mastra`](https://github.com/getsentry/sentry-javascript/tree/develop/dev-packages/e2e-tests/test-applications/node-mastra)
and
[`cloudflare-mastra`](https://github.com/getsentry/sentry-javascript/tree/develop/dev-packages/e2e-tests/test-applications/cloudflare-mastra)
e2e test apps.

- **Extends the Node guide** (`fallbackGuide: javascript.node`) instead
of `inheritCommonContent: false`, so the Mastra guide inherits the Node
common pages. Adds the `mastra` icon.
- **Replaces the `@mastra/sentry` exporter** with a plain
`Sentry.init()`. Sentry's Mastra integration is enabled by default and
auto-bootstraps observability through `@mastra/observability`. Adds a
warning against running the community `@mastra/sentry` exporter
alongside it.
- **Node setup (primary):** `instrument.mjs` in `src/mastra/public/`,
preloaded via `mastra dev/start
--custom-args="--import=./instrument.mjs"`.
- **Cloudflare Workers (install variant):** `@sentry/cloudflare` +
`sentryCloudflareVitePlugin()` + `src/instrument.server.ts` +
`nodejs_compat`.
- Requires `@sentry/node` / `@sentry/cloudflare` `>=11.0.0-rc.0` and
`@mastra/core` `>=1.63.2`; updates the captured-span mapping to the
built-in integration.
- Adds `javascript.mastra` to every `supported`/`notSupported` list in
JS common content wherever `javascript.eve` appears (112 files), so
inherited Node sections render and browser-only content is hidden from
the Mastra guide. `PlatformSection` doesn't resolve `fallbackGuide`, so
`javascript.mastra` must be enumerated alongside
`javascript.node`/`javascript.eve` in both directions.

## IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the
due date. You can update this information later by editing the PR
description.

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
supplied a deadline.

Thanks in advance for your help!

## PRE-MERGE CHECKLIST

_Make sure you've checked the following before merging your changes:_

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Sigrid <32902192+s1gr1d@users.noreply.github.com>
Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>

This branch was successfully deployed

2 active (1 outdated) deployments
Preview – sentry-docs — bda0708b Deployed Sep 21, 2026 by vercel[bot]
Preview – develop-docs — c1984939 Deployed Sep 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants