Skip to content

Conversation

@sergical
Copy link
Member

@sergical sergical commented Jan 22, 2026

DESCRIBE YOUR PR

This PR restructures the JavaScript AI Agent Monitoring documentation:

Documentation Changes

  • Move to top-level feature: AI Agent Monitoring is now a standalone feature section instead of being nested under tracing/instrumentation
  • Browser-specific docs: Created separate ai-agent-monitoring-browser/ page for Browser JavaScript with appropriate content
  • Add MCP Server section: New section documenting Model Context Protocol server monitoring
  • Improved layout: Added SplitLayout pattern for better code/text presentation with side-by-side views
  • Better content organization:
    • Added Prerequisites section linking to tracing setup
    • Added Options section documenting recordInputs/recordOutputs privacy controls
    • Highlighted key span attributes inline for easier scanning

Platform Switching Improvements

  • Cross-platform redirect: When switching platforms via dropdown, the sidebar now correctly redirects between ai-agent-monitoring (Node.js) and ai-agent-monitoring-browser (Browser JS) paths instead of falling back to the platform root
  • Path equivalence mapping: Added EQUIVALENT_PATHS constant in sidebar to handle pages that exist at different paths on different platforms

IS YOUR CHANGE URGENT?

  • Urgent deadline (GA date, etc.)
  • Other deadline
  • None: Not urgent, can wait up to 1 week+

PRE-MERGE CHECKLIST

  • 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
Copy link

vercel bot commented Jan 22, 2026

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

Project Deployment Review Updated (UTC)
sentry-docs Ready Ready Preview, Comment Jan 23, 2026 4:11pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
develop-docs Ignored Ignored Preview Jan 23, 2026 4:11pm

Request Review

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


## Manual Instrumentation

If you're using a library that Sentry does not automatically instrument, you can manually instrument your code to capture spans. For your AI agents data to show up in the Sentry [AI Agents Insights](https://sentry.io/orgredirect/organizations/:orgslug/insights/ai/agents/), spans must have well-defined names and data attributes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you're using a library that Sentry does not automatically instrument, you can manually instrument your code to capture spans. For your AI agents data to show up in the Sentry [AI Agents Insights](https://sentry.io/orgredirect/organizations/:orgslug/insights/ai/agents/), spans must have well-defined names and data attributes.
If you're using a library that Sentry does not automatically instrument, you can manually instrument your code to capture spans. For your AI agents data to show up in Sentry [AI Agents Insights](https://sentry.io/orgredirect/organizations/:orgslug/insights/ai/agents/), spans must have well-defined names and data attributes.

Comment on lines 132 to 134
<Expandable title="All AI Request span attributes">
<Include name="tracing/ai-agents-module/ai-client-span" />
</Expandable>
Copy link
Contributor

Choose a reason for hiding this comment

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

The table inside this collapsed section, because of the two column layout, is reaaaallly hard. I can hardly see what's on the table and it feels like infinite scroll to see what else is there. Anything else we can do with this content to make it easier to read?

Comment on lines 190 to 192
<Expandable title="All Invoke Agent span attributes">
<Include name="tracing/ai-agents-module/invoke-agent-span" />
</Expandable>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same with this one. The table nested in here is unreadable.

- [Python](/platforms/python/tracing/instrumentation/custom-instrumentation/ai-agents-module)
- [Node.js](/platforms/javascript/guides/node/tracing/instrumentation/ai-agents-module/)
- [Browser (JavaScript)](/platforms/javascript/tracing/instrumentation/ai-agents-module-browser/)
- [Node.js](/platforms/javascript/guides/node/ai-agent-monitoring/)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a redirect for this old path, or good to go?

Copy link
Member Author

Choose a reason for hiding this comment

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

redirects are setup!

Comment on lines 120 to 122
<Expandable title="All AI Request span attributes">
<Include name="tracing/ai-agents-module/ai-client-span" />
</Expandable>
Copy link
Contributor

Choose a reason for hiding this comment

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

Highlighting that the same problem is here with the nested table

Comment on lines 176 to 178
<Expandable title="All Invoke Agent span attributes">
<Include name="tracing/ai-agents-module/invoke-agent-span" />
</Expandable>
Copy link
Contributor

Choose a reason for hiding this comment

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

And here with that table

Comment on lines 220 to 222
<Expandable title="All Execute Tool span attributes">
<Include name="tracing/ai-agents-module/execute-tool-span" />
</Expandable>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same with the table in here

sergical and others added 14 commits January 23, 2026 10:23
Move AI Agent Monitoring from /tracing/instrumentation/ai-agents-module/
to a new top-level /ai-agent-monitoring/ feature across all JavaScript SDKs.

- Create new ai-agent-monitoring directory with index.mdx and browser.mdx
- Add redirects from old paths to new paths
- Update internal links in Next.js docs and product docs
- Delete old ai-agents-module files

Co-Authored-By: Claude <noreply@anthropic.com>
- Add SplitLayout pattern for better code/text presentation
- Add Prerequisites section linking to tracing setup
- Add Options section documenting recordInputs/recordOutputs
- Wrap all span examples in SplitLayout for side-by-side view

Co-Authored-By: Claude <noreply@anthropic.com>
Fill the dead space in SplitLayout sections by listing the most
important attributes upfront, with expandables for the full reference.

Co-Authored-By: Claude <noreply@anthropic.com>
- Change sidebar title from "AI Agent Monitoring" to "AI Monitoring"
- Add MCP Server Monitoring section with link to instrumentation docs

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
When someone navigates to /platforms/javascript/ai-agent-monitoring/
(the browser SDK which doesn't support server-side AI monitoring),
redirect to the browser-specific page instead of 404.

Co-Authored-By: Claude <noreply@anthropic.com>
When switching between platforms/SDKs in the dropdown, the selector now
tries to maintain the current page context by extracting the relative
path and using /platform-redirect to find the equivalent page on the
target platform.

For example, switching from Next.js AI Agent Monitoring to JavaScript
will now redirect to the browser-specific AI monitoring page instead
of the platform root.

Co-Authored-By: Claude <noreply@anthropic.com>
When switching platforms via the dropdown, the sidebar now correctly
redirects between ai-agent-monitoring and ai-agent-monitoring-browser
paths instead of falling back to the platform root.

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix destination for guide browser redirects to point to base browser page
- Fix base JS redirect to use correct ai-agent-monitoring-browser path

Co-Authored-By: Claude <noreply@anthropic.com>
…edirect

The sidebar already computes the correct URL for each platform including
equivalent path handling. Using platform-redirect bypassed this logic and
caused incorrect redirects for pages like ai-agent-monitoring-browser.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Common pages are inherited by guides, so the redirect should maintain
the guide path (e.g., /guides/react/ai-agent-monitoring-browser/).

Co-Authored-By: Claude <noreply@anthropic.com>
…older

Update AI monitoring docs to use dynamic SDK package names so the
correct package is shown for each platform (e.g., @sentry/nextjs on
Next.js pages, @sentry/react on React pages).

Co-Authored-By: Claude <noreply@anthropic.com>
- Replace AI Request Span with AI Client Span (op: gen_ai.chat) in browser docs
- Update all span examples to use verbose style with agent/AI object definitions
- Move Expandables outside SplitLayout per review feedback
- Inline handoff span attributes in description (short content)
- Inline Common Span Attributes table in browser docs

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@sfanahata sfanahata left a comment

Choose a reason for hiding this comment

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

👏

@sergical sergical merged commit d653b8e into master Jan 23, 2026
16 checks passed
@sergical sergical deleted the docs/js-ai-monitoring-clean branch January 23, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants