Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/platforms/javascript/common/agent-tracing/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ On Cloudflare, how much setup you need depends on the library. Enabling tracing
- <PlatformLink to="/configuration/integrations/google-genai/">Google Gen AI SDK</PlatformLink>
- <PlatformLink to="/configuration/integrations/langchain/">LangChain</PlatformLink>
- <PlatformLink to="/configuration/integrations/langgraph/">LangGraph</PlatformLink>
- <PlatformLink to="/configuration/integrations/mastra/">Mastra</PlatformLink>
</PlatformSection>

<PlatformSection supported={["javascript.deno"]}>
Expand Down Expand Up @@ -213,7 +214,7 @@ You can also instrument agent spans yourself. See <PlatformLink to="/agent-traci

If you're using an AI framework with a Sentry exporter, you can send traces to Sentry:

- <PlatformLink to="/agent-tracing/mastra/">Mastra Sentry Exporter</PlatformLink>
- <PlatformLink to="/configuration/integrations/mastra/">Mastra Sentry Exporter</PlatformLink>

</PlatformSection>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Mastra
sidebar_title: Mastra
sidebar_order: 100
description: "Learn how to export Mastra AI tracing to Sentry."
supported:
- javascript.node
Expand Down
5 changes: 4 additions & 1 deletion docs/product/agents/naming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ const agent = new Agent({
});
```

<PlatformLink platform="javascript.node" to="/agent-tracing/mastra/">
<PlatformLink
platform="javascript.node"
to="/configuration/integrations/mastra/"
>
Mastra integration docs
</PlatformLink>

Expand Down
63 changes: 63 additions & 0 deletions redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -2222,6 +2222,69 @@ const userDocsRedirects = [
source: '/product/insights/:path*',
destination: '/product/dashboards/sentry-dashboards/',
},
// Mastra moved from Agent Tracing to JavaScript integrations
// Map older Agent Tracing names directly to avoid redirect chains.
{
source: '/platforms/javascript/ai-agent-monitoring/mastra.md',
destination: '/platforms/javascript/configuration/integrations/mastra.md',
},
{
source: '/platforms/javascript/ai-agent-monitoring/mastra/:path*',
destination:
'/platforms/javascript/configuration/integrations/mastra/:path*',
},
{
source:
'/platforms/javascript/guides/:guide/ai-agent-monitoring/mastra.md',
destination:
'/platforms/javascript/guides/:guide/configuration/integrations/mastra.md',
},
{
source:
'/platforms/javascript/guides/:guide/ai-agent-monitoring/mastra/:path*',
destination:
'/platforms/javascript/guides/:guide/configuration/integrations/mastra/:path*',
},
{
source: '/platforms/javascript/ai-agent-tracing/mastra.md',
destination: '/platforms/javascript/configuration/integrations/mastra.md',
},
{
source: '/platforms/javascript/ai-agent-tracing/mastra/:path*',
destination:
'/platforms/javascript/configuration/integrations/mastra/:path*',
},
{
source: '/platforms/javascript/guides/:guide/ai-agent-tracing/mastra.md',
destination:
'/platforms/javascript/guides/:guide/configuration/integrations/mastra.md',
},
{
source:
'/platforms/javascript/guides/:guide/ai-agent-tracing/mastra/:path*',
destination:
'/platforms/javascript/guides/:guide/configuration/integrations/mastra/:path*',
},
{
source: '/platforms/javascript/agent-tracing/mastra.md',
destination: '/platforms/javascript/configuration/integrations/mastra.md',
},
{
source: '/platforms/javascript/agent-tracing/mastra/:path*',
destination:
'/platforms/javascript/configuration/integrations/mastra/:path*',
},
{
source: '/platforms/javascript/guides/:guide/agent-tracing/mastra.md',
destination:
'/platforms/javascript/guides/:guide/configuration/integrations/mastra.md',
},
{
source:
'/platforms/javascript/guides/:guide/agent-tracing/mastra/:path*',
destination:
'/platforms/javascript/guides/:guide/configuration/integrations/mastra/:path*',
},
Comment on lines +2277 to +2287

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.

Bug: The new redirects for Mastra documentation do not handle the canonical URL with a trailing slash, /agent-tracing/mastra/, which will cause a 404 error.
Severity: MEDIUM

Suggested Fix

Add a new redirect rule to specifically handle the canonical URL with a trailing slash. For example: { source: '/platforms/javascript/agent-tracing/mastra/', destination: '/platforms/javascript/configuration/integrations/mastra/' }.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: redirects.js#L2272-L2287

Potential issue: The new redirect rules for the moved Mastra documentation page are
incomplete. While they handle paths like `/agent-tracing/mastra.md` and sub-paths like
`/agent-tracing/mastra/:path*`, they fail to redirect the canonical URL
`/platforms/javascript/agent-tracing/mastra/` (with a trailing slash). The `:path*`
wildcard pattern does not match an empty segment following a path separator.
Consequently, users accessing the old canonical URL via bookmarks or search engine
results will encounter a 404 error instead of being redirected to the new location at
`/platforms/javascript/configuration/integrations/mastra/`.

Also affects:

  • redirects.js:2227~2247
  • redirects.js:2248~2268

Did we get this right? 👍 / 👎 to inform future reviews.

// Agent Tracing moved to top-level feature
{
source:
Expand Down
Loading