diff --git a/docs/platforms/javascript/common/agent-tracing/index.mdx b/docs/platforms/javascript/common/agent-tracing/index.mdx index 9cc6e87e90d02..d39129ee4619b 100644 --- a/docs/platforms/javascript/common/agent-tracing/index.mdx +++ b/docs/platforms/javascript/common/agent-tracing/index.mdx @@ -7,6 +7,61 @@ sidebar_section: features new_until: 2027-02-17 supportedCategories: - server +integration_grid: + - to: "/agent-tracing/workers-ai/" + href: "/platforms/javascript/guides/cloudflare/agent-tracing/workers-ai/" + title: "Workers AI" + icon: "cloudflare" + - to: "/agent-tracing/agents-sdk/" + href: "/platforms/javascript/guides/cloudflare/agent-tracing/agents-sdk/" + title: "Agents SDK" + icon: "cloudflare" + - to: "/configuration/integrations/vercelai/" + title: "Vercel AI SDK" + icon: "vercel" + - to: "/configuration/integrations/openai/" + title: "OpenAI" + icon: "openai" + - to: "/configuration/integrations/anthropic/" + title: "Anthropic" + icon: "anthropic" + - to: "/configuration/integrations/google-genai/" + title: "Google Gen AI SDK" + icon: "google-genai" + - to: "/configuration/integrations/langchain/" + title: "LangChain" + icon: "langchain" + - to: "/configuration/integrations/langgraph/" + title: "LangGraph" + icon: "langgraph" + - to: "/configuration/integrations/mistral/" + title: "Mistral AI" + icon: "mistral" + - to: "/configuration/integrations/groq/" + title: "Groq" + icon: "groq" + - to: "/configuration/integrations/together-ai/" + title: "Together AI" + icon: "together-ai" + - to: "/configuration/integrations/typesafe/" + title: "TypeSafe" + icon: "typesafe-ai" + - to: "/agent-tracing/mastra/" + href: "/platforms/javascript/guides/mastra/" + title: "Mastra" + icon: "mastra" + - to: "/agent-tracing/eve/" + href: "/platforms/javascript/guides/eve/" + title: "Eve" + icon: "eve" + - to: "/agent-tracing/flue/" + href: "/platforms/javascript/guides/flue/" + title: "Flue" + icon: "flue" + - to: "/agent-tracing/pi-durable/" + href: "/platforms/javascript/guides/pi-durable/" + title: "Pi Durable" + icon: "pi-durable" --- With Sentry Agent Tracing, you can monitor and debug your AI systems with full-stack context. You'll be able to track key insights like token usage, latency, tool usage, and error rates — and group multi-turn chats in Conversations. Agent Tracing data is fully connected to your other Sentry data like logs, errors, and traces. @@ -17,96 +72,7 @@ With Sentry Agent Tracing, you can As of SDK version `11.0.0`, Sentry auto-instruments the most popular AI SDKs and frameworks out of the box — you don't need to add their integrations yourself. Just enable tracing, then pick your AI stack below. Each integration page has the details. To group multi-turn chats in Conversations, also [track conversations](#tracking-conversations) in the requests that make AI calls. - + diff --git a/docs/platforms/python/agent-tracing/index.mdx b/docs/platforms/python/agent-tracing/index.mdx index bfbe5926a0a8e..1c97debc94d5a 100644 --- a/docs/platforms/python/agent-tracing/index.mdx +++ b/docs/platforms/python/agent-tracing/index.mdx @@ -5,6 +5,43 @@ sidebar_order: 7 sidebar_section: features description: "Monitor agents with token usage, latency, tool execution, and error tracking." new_until: 2027-02-17 +integration_grid: + - to: "/agent-tracing/bedrock/" + title: "Amazon Bedrock" + icon: "aws" + - to: "/agent-tracing/anthropic/" + title: "Anthropic" + icon: "anthropic" + - to: "/agent-tracing/google-genai/" + title: "Google Gen AI" + icon: "google-genai" + - to: "/agent-tracing/openai/" + title: "OpenAI" + icon: "openai" + - to: "/agent-tracing/openai-agents/" + title: "OpenAI Agents SDK" + icon: "openai" + - to: "/agent-tracing/langchain/" + title: "LangChain" + icon: "langchain" + - to: "/agent-tracing/langgraph/" + title: "LangGraph" + icon: "langgraph" + - to: "/agent-tracing/litellm/" + title: "LiteLLM" + icon: "litellm" + - to: "/agent-tracing/pydantic-ai/" + title: "Pydantic AI" + icon: "pydantic-ai" + - to: "/agent-tracing/huggingface_hub/" + title: "Hugging Face Hub" + icon: "huggingface_hub" + - to: "/agent-tracing/mistral/" + title: "Mistral" + icon: "mistral" + - to: "/agent-tracing/typesafe/" + title: "TypeSafe AI" + icon: "typesafe-ai" --- With Sentry Agent Tracing, you can monitor and debug your AI systems with full-stack context. You'll be able to track key insights like token usage, latency, tool usage, and error rates — and group multi-turn chats in Conversations. Agent Tracing data is fully connected to your other Sentry data like logs, errors, and traces. @@ -32,22 +69,7 @@ sentry_sdk.init( Pick your AI stack. Each page has install and verify details. - + ## Tracking Conversations diff --git a/docs/product/agents/getting-started.mdx b/docs/product/agents/getting-started.mdx index eff22be0f0183..672f27bf1aeb7 100644 --- a/docs/product/agents/getting-started.mdx +++ b/docs/product/agents/getting-started.mdx @@ -25,22 +25,39 @@ Sentry Agent Tracing helps you track and debug agent applications using our supp To use [Conversations](/product/agents/conversations/), set a conversation ID for each chat. Sentry uses the `gen_ai.conversation.id` attribute to group related AI spans, and some SDK integrations set it automatically. -To start sending agent data to Sentry, make sure you've created a Sentry project for your AI-enabled repository and follow one of the guides below: - -- [Claude Platform](/concepts/otlp/direct/claude-platform/) -- [Cloudflare](/platforms/javascript/guides/cloudflare/agent-tracing/) -- [Eve](/platforms/javascript/guides/eve/) -- [Flue](/platforms/javascript/guides/flue/) -- [Laravel](/platforms/php/guides/laravel/agent-tracing/) -- [Mastra](/platforms/javascript/guides/mastra/) -- [Flue](/platforms/javascript/guides/flue/) -- [Eve](/platforms/javascript/guides/eve/) -- [Next.js](/platforms/javascript/guides/nextjs/agent-tracing/) -- [Node.js](/platforms/javascript/guides/node/agent-tracing/) -- [Pi Durable](/platforms/javascript/guides/pi-durable/) -- [Python](/platforms/python/agent-tracing/) -- [Ruby](/platforms/ruby/tracing/instrumentation/custom-instrumentation/ai-agents-module/) -- [.NET](/platforms/dotnet/tracing/instrumentation/ai-agents-module/) +To start sending agent data to Sentry, make sure you've created a Sentry project for your AI-enabled repository and follow the guide for your platform or one of its integrations: + + After setup, send an agent request and open [**Explore → Agents**](https://sentry.io/orgredirect/organizations/:orgslug/explore/agents/) to verify that its data arrived. Then [name your agents](/product/agents/naming/) so you can identify and filter them. diff --git a/src/components/integrationGrid.tsx b/src/components/integrationGrid.tsx index 2160d17a69e97..aa585c497c36c 100644 --- a/src/components/integrationGrid.tsx +++ b/src/components/integrationGrid.tsx @@ -1,32 +1,60 @@ import Link from 'next/link'; import {DOCS_ORIGIN} from 'sentry-docs/docsSite.mjs'; -import {getCurrentPlatformOrGuide, nodeForPath} from 'sentry-docs/docTree'; +import {DocNode, getCurrentPlatformOrGuide, nodeForPath} from 'sentry-docs/docTree'; import {serverContext} from 'sentry-docs/serverContext'; +import {IntegrationGridItem, Platform, PlatformGuide} from 'sentry-docs/types'; import {PlatformIcon} from './platformIcon'; import {isPlatformSupported} from './platformSection'; -type Integration = { - /** Platform icon key, e.g. "anthropic", "openai", "langchain". */ - icon: string; - /** Display name of the integration. */ - title: string; - /** Absolute path for links that target a different platform or guide. */ - href?: string; - /** Platform-relative path, e.g. "/integrations/anthropic/". */ - to: string; - /** Optional one-line description shown under the title. */ - description?: string; - /** Platform/guide keys that hide this card, like `PlatformSection`. */ - notSupported?: string[]; - /** Platform/guide keys that show this card, like `PlatformSection`. */ - supported?: string[]; -}; - type Props = { - integrations: Integration[]; + /** Defaults to the `integration_grid` frontmatter of the current page. */ + integrations?: IntegrationGridItem[]; }; +type ResolvedIntegration = IntegrationGridItem & {url: string}; + +/** + * Resolves integration links for a platform or guide and drops the ones that + * don't apply to it, either through `supported`/`notSupported` or because the + * target page doesn't exist. + */ +export function resolveIntegrations( + rootNode: DocNode, + platformOrGuide: Platform | PlatformGuide | undefined, + integrations: IntegrationGridItem[] +): ResolvedIntegration[] { + const withUrls = integrations.map(integration => ({ + ...integration, + url: + integration.href ?? + (platformOrGuide + ? platformOrGuide.url + integration.to.slice(1) + : `/platform-redirect/?next=${encodeURIComponent(integration.to)}`), + })); + + if (!platformOrGuide) { + return withUrls; + } + + return withUrls.filter(({url, supported, notSupported}) => { + if (!isPlatformSupported(rootNode, platformOrGuide, supported, notSupported)) { + return false; + } + + const targetUrl = new URL(url, DOCS_ORIGIN); + if (targetUrl.origin !== DOCS_ORIGIN) { + return true; + } + + const targetNode = nodeForPath( + rootNode, + targetUrl.pathname.split('/').filter(Boolean) + ); + return Boolean(targetNode && !targetNode.missing); + }); +} + /** * A responsive grid of integration cards, each showing the integration's logo * and name. Links resolve relative to the current platform (like PlatformLink). @@ -37,37 +65,16 @@ type Props = { * {to: "/integrations/anthropic/", title: "Anthropic", icon: "anthropic"}, * ]} * /> + * + * Without `integrations`, it renders the page's `integration_grid` frontmatter. */ export function IntegrationGrid({integrations}: Props) { const {rootNode, path} = serverContext(); - const currentPlatformOrGuide = getCurrentPlatformOrGuide(rootNode, path); - - const hrefFor = (to: string, href?: string) => - href ?? - (currentPlatformOrGuide - ? currentPlatformOrGuide.url + to.slice(1) - : `/platform-redirect/?next=${encodeURIComponent(to)}`); - - const visibleIntegrations = currentPlatformOrGuide - ? integrations.filter(({to, href, supported, notSupported}) => { - if ( - !isPlatformSupported(rootNode, currentPlatformOrGuide, supported, notSupported) - ) { - return false; - } - - const targetUrl = new URL(hrefFor(to, href), DOCS_ORIGIN); - if (targetUrl.origin !== DOCS_ORIGIN) { - return true; - } - - const targetNode = nodeForPath( - rootNode, - targetUrl.pathname.split('/').filter(Boolean) - ); - return Boolean(targetNode && !targetNode.missing); - }) - : integrations; + const visibleIntegrations = resolveIntegrations( + rootNode, + getCurrentPlatformOrGuide(rootNode, path), + integrations ?? nodeForPath(rootNode, path)?.frontmatter.integration_grid ?? [] + ); if (visibleIntegrations.length === 0) { return null; @@ -75,10 +82,10 @@ export function IntegrationGrid({integrations}: Props) { return (
- {visibleIntegrations.map(({icon, title, href, to, description}) => ( + {visibleIntegrations.map(({icon, title, url, description}) => ( + */ +export function PlatformIntegrationList({platforms}: Props) { + const {rootNode} = serverContext(); + + return ( +
    + {platforms.map(({title, to}) => { + const pathSegments = to.split('/').filter(Boolean); + const platformOrGuide = getCurrentPlatformOrGuide(rootNode, pathSegments); + const integrations = resolveIntegrations( + rootNode, + platformOrGuide, + nodeForPath(rootNode, pathSegments)?.frontmatter.integration_grid ?? [] + ).filter(({url}) => !platformOrGuide || url.startsWith(platformOrGuide.url)); + + return ( +
  • + {title} + {integrations.length > 0 && ( +
      + {integrations.map(integration => ( +
    • + {integration.title} +
    • + ))} +
    + )} +
  • + ); + })} +
+ ); +} diff --git a/src/mdxComponents.ts b/src/mdxComponents.ts index 85c9d6dad9b5a..6fa42b048013e 100644 --- a/src/mdxComponents.ts +++ b/src/mdxComponents.ts @@ -47,6 +47,7 @@ import {PlatformCategorySection} from './components/platformCategorySection'; import {PlatformFilter} from './components/platformFilter'; import {PlatformGrid} from './components/platformGrid'; import {PlatformIdentifier} from './components/platformIdentifier'; +import {PlatformIntegrationList} from './components/platformIntegrationList'; import {PlatformLink} from './components/platformLink'; import {PlatformLinkWithLogo} from './components/platformLinkWithLogo'; import {PlatformOrGuideName} from './components/platformOrGuideName'; @@ -118,6 +119,7 @@ export function mdxComponents( PiiFields, PlatformGrid, PlatformIdentifier, + PlatformIntegrationList, PlatformLink, PlatformLinkWithLogo, PlatformSection, diff --git a/src/types/frontmatter.ts b/src/types/frontmatter.ts index f9ca00dc86214..b92f37bede4c4 100644 --- a/src/types/frontmatter.ts +++ b/src/types/frontmatter.ts @@ -1,6 +1,26 @@ import {PaginationNavNode} from './paginationNavNode'; import {PlatformCategory} from './platform'; +/** + * One card in an `IntegrationGrid`. + */ +export type IntegrationGridItem = { + /** Platform icon key, e.g. "anthropic", "openai", "langchain". */ + icon: string; + /** Display name of the integration. */ + title: string; + /** Platform-relative path, e.g. "/integrations/anthropic/". */ + to: string; + /** Optional one-line description shown under the title. */ + description?: string; + /** Absolute path for links that target a different platform or guide. */ + href?: string; + /** Platform/guide keys that hide this card, like `PlatformSection`. */ + notSupported?: string[]; + /** Platform/guide keys that show this card, like `PlatformSection`. */ + supported?: string[]; +}; + /** ** a YAML-formatted blob defined at the top of every markdown or mdx file */ @@ -38,6 +58,12 @@ export interface FrontMatter { */ fullWidth?: boolean; + /** + * Integrations that `` renders on this page. Keeping them + * in frontmatter lets other pages, such as the Agents setup page, list them too. + */ + integration_grid?: IntegrationGridItem[]; + /** * A list of keywords for indexing with search. */