From c5acda6606899671f654e7a26d814dd949a45b57 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 16 Sep 2026 16:58:47 +0200 Subject: [PATCH 01/11] docs(javascript): rework Mastra guide to SDK-based setup, extend Node 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) --- .../common/agent-tracing/anthropic.mdx | 11 +- .../javascript/common/agent-tracing/flue.mdx | 7 +- .../common/agent-tracing/google-genai.mdx | 11 +- .../common/agent-tracing/langchain.mdx | 11 +- .../common/agent-tracing/langgraph.mdx | 11 +- .../agent-tracing/manual-instrumentation.mdx | 1 + .../common/agent-tracing/mastra.mdx | 1 + .../common/agent-tracing/openai.mdx | 13 +- .../common/agent-tracing/vercelai.mdx | 1 + .../common/best-practices/index.mdx | 1 + .../common/best-practices/micro-frontends.mdx | 1 + .../multiple-sentry-instances.mdx | 1 + .../common/best-practices/offline-caching.mdx | 1 + .../best-practices/shared-environments.mdx | 1 + .../common/best-practices/web-workers.mdx | 1 + .../common/configuration/async-context.mdx | 1 + .../common/configuration/event-loop-block.mdx | 1 + .../configuration/integrations/amqplib.mdx | 1 + .../common/configuration/integrations/anr.mdx | 1 + .../integrations/breadcrumbs.mdx | 1 + .../integrations/browserapierrors.mdx | 1 + .../integrations/browserprofiling.mdx | 1 + .../integrations/browsersession.mdx | 1 + .../integrations/browsertracing.mdx | 1 + .../integrations/childProcess.mdx | 1 + .../configuration/integrations/console.mdx | 1 + .../integrations/contextlines.mdx | 1 + .../configuration/integrations/dataloader.mdx | 1 + .../integrations/elementtiming.mdx | 1 + .../integrations/event-loop-block.mdx | 1 + .../configuration/integrations/fastify.mdx | 1 + .../configuration/integrations/firebase.mdx | 1 + .../common/configuration/integrations/fs.mdx | 1 + .../integrations/genericpool.mdx | 1 + .../integrations/globalhandlers.mdx | 1 + .../configuration/integrations/graphql.mdx | 1 + .../integrations/graphqlclient.mdx | 1 + .../configuration/integrations/hapi.mdx | 1 + .../configuration/integrations/http.mdx | 1 + .../configuration/integrations/httpclient.mdx | 1 + .../integrations/httpcontext.mdx | 1 + .../configuration/integrations/kafka.mdx | 1 + .../configuration/integrations/knex.mdx | 1 + .../common/configuration/integrations/koa.mdx | 1 + .../integrations/launchdarkly.mdx | 1 + .../integrations/localvariables.mdx | 1 + .../integrations/lrumemoizer.mdx | 1 + .../integrations/modulemetadata.mdx | 1 + .../configuration/integrations/modules.mdx | 1 + .../configuration/integrations/mongo.mdx | 1 + .../configuration/integrations/mongoose.mdx | 1 + .../configuration/integrations/mysql.mdx | 1 + .../configuration/integrations/mysql2.mdx | 1 + .../configuration/integrations/nest.mdx | 1 + .../integrations/nodecontext.mdx | 1 + .../configuration/integrations/nodefetch.mdx | 1 + .../integrations/nodeprofiling.mdx | 1 + .../integrations/noderuntimemetrics.mdx | 1 + .../integrations/onuncaughtexception.mdx | 1 + .../integrations/openfeature.mdx | 1 + .../configuration/integrations/pino.mdx | 1 + .../configuration/integrations/postgres.mdx | 1 + .../configuration/integrations/prisma.mdx | 1 + .../integrations/prisma__v8.x.mdx | 1 + .../configuration/integrations/redis.mdx | 1 + .../configuration/integrations/replay.mdx | 1 + .../integrations/replaycanvas.mdx | 1 + .../integrations/reportingobserver.mdx | 1 + .../integrations/requestdata.mdx | 1 + .../configuration/integrations/statsig.mdx | 1 + .../configuration/integrations/supabase.mdx | 1 + .../configuration/integrations/tedious.mdx | 1 + .../configuration/integrations/trpc.mdx | 1 + .../integrations/unhandledrejection.mdx | 1 + .../configuration/integrations/unleash.mdx | 1 + .../configuration/integrations/webworker.mdx | 1 + .../common/configuration/transports.mdx | 1 + .../javascript/common/crons/index.mdx | 1 + .../common/crons/troubleshooting.mdx | 1 + .../data-management/data-collected/index.mdx | 2 +- .../request-isolation/index.mdx | 1 + .../javascript/common/feature-flags/index.mdx | 1 + .../javascript/common/install/index.mdx | 1 + .../javascript/common/install/loader.mdx | 1 + .../javascript/common/install/npm.mdx | 1 + .../javascript/common/logs/index.mdx | 4 +- .../javascript/common/metrics/index.mdx | 2 +- .../migration/v7-to-v8/v8-opentelemetry.mdx | 1 + .../common/opentelemetry/custom-setup.mdx | 3 +- .../javascript/common/opentelemetry/index.mdx | 1 + .../using-opentelemetry-apis.mdx | 1 + .../common/session-replay/configuration.mdx | 1 + .../common/session-replay/index.mdx | 1 + .../common/session-replay/issue-types.mdx | 1 + .../common/session-replay/privacy.mdx | 1 + .../common/session-replay/troubleshooting.mdx | 1 + .../session-replay/understanding-sessions.mdx | 1 + .../sourcemaps/uploading/hosting-publicly.mdx | 1 + .../dealing-with-cors-issues/index.mdx | 1 + .../tracing/instrumentation/caches-module.mdx | 3 +- .../tracing/instrumentation/queues-module.mdx | 1 + .../troubleshooting/supported-browsers.mdx | 1 + .../user-feedback/configuration/index.mdx | 3 +- .../configuration/index__v7.x.mdx | 3 +- .../javascript/common/user-feedback/index.mdx | 3 +- .../javascript/guides/mastra/index.mdx | 217 ++++++++++++------ 106 files changed, 289 insertions(+), 106 deletions(-) diff --git a/docs/platforms/javascript/common/agent-tracing/anthropic.mdx b/docs/platforms/javascript/common/agent-tracing/anthropic.mdx index 52f5435bf37be..9194b1382df18 100644 --- a/docs/platforms/javascript/common/agent-tracing/anthropic.mdx +++ b/docs/platforms/javascript/common/agent-tracing/anthropic.mdx @@ -5,6 +5,7 @@ sidebar_order: 22 supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -33,13 +34,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.anthropicAIIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, you need to use **[Manual Instrumentation](#manual-instrumentation)** to explicitly wrap your AI client instance instead. @@ -53,7 +54,7 @@ supported: - + ## Manual Instrumentation @@ -111,7 +112,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `anthropicAIIntegration` integration for **automatic instrumentation**: @@ -130,7 +131,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def - + Using the `instrumentAnthropicAiClient` wrapper for **manual instrumentation**: diff --git a/docs/platforms/javascript/common/agent-tracing/flue.mdx b/docs/platforms/javascript/common/agent-tracing/flue.mdx index db903967a4e56..be32f124363a3 100644 --- a/docs/platforms/javascript/common/agent-tracing/flue.mdx +++ b/docs/platforms/javascript/common/agent-tracing/flue.mdx @@ -6,6 +6,7 @@ description: "Learn how to send Flue agent traces, logs, and errors to Sentry." supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.cloudflare --- @@ -17,7 +18,7 @@ With a valid `SENTRY_DSN`, Flue can send three connected signals to Sentry: - **Logs**: With `enableLogs: true` in the generated Sentry SDK configuration, every `log.info`, `log.warn`, and `log.error` call from your tools and hooks appears as Sentry Logs. When tracing is enabled, Sentry correlates these logs with the trace. - **Issues**: The generated bridge captures terminal failures, such as a failed prompt, skill, task, or shell operation, as Sentry error issues. Recovered tool errors remain diagnostic context on the trace when tracing is enabled and don't create issues. - + @@ -54,7 +55,7 @@ The generated module reads its configuration from environment variables. Only `S | `SENTRY_AI_RECORD_INPUTS` | `false` | Set to `true` to include prompts, system instructions, and tool definitions and arguments in spans. | | `SENTRY_AI_RECORD_OUTPUTS` | `false` | Set to `true` to include model output, tool results, and exception messages and stacks in spans. | - + ```bash {filename:.env} SENTRY_DSN="___PUBLIC_DSN___" @@ -92,7 +93,7 @@ Review the data your agent handles before you enable these options in production ## How It Works - + On Node.js, the generated `sentry.ts` calls `Sentry.init` at module scope. Sentry becomes the global OpenTelemetry tracer provider, so the spans from `@flue/opentelemetry` flow to Sentry without extra wiring. The following abridged example shows the core of the generated file. It omits helper definitions and the terminal-failure capture implementation, so use the file generated by the blueprint rather than copying this example: diff --git a/docs/platforms/javascript/common/agent-tracing/google-genai.mdx b/docs/platforms/javascript/common/agent-tracing/google-genai.mdx index 1f4b5f8bb4d3a..0d77a4f90aeda 100644 --- a/docs/platforms/javascript/common/agent-tracing/google-genai.mdx +++ b/docs/platforms/javascript/common/agent-tracing/google-genai.mdx @@ -5,6 +5,7 @@ sidebar_order: 23 supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -33,13 +34,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.googleGenAIIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, you need to use **[Manual Instrumentation](#manual-instrumentation)** to explicitly wrap your AI client instance instead. @@ -53,7 +54,7 @@ supported: - + ## Manual Instrumentation @@ -107,7 +108,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `googleGenAIIntegration` integration for **automatic instrumentation**: @@ -126,7 +127,7 @@ Sentry.init({ - + Using the `instrumentGoogleGenAIClient` wrapper for **manual instrumentation**: diff --git a/docs/platforms/javascript/common/agent-tracing/langchain.mdx b/docs/platforms/javascript/common/agent-tracing/langchain.mdx index c6f230c55139e..e2a6d5b7552e9 100644 --- a/docs/platforms/javascript/common/agent-tracing/langchain.mdx +++ b/docs/platforms/javascript/common/agent-tracing/langchain.mdx @@ -5,6 +5,7 @@ sidebar_order: 24 supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -33,13 +34,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.langChainIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, you need to use **[Manual Instrumentation](#manual-instrumentation)** to explicitly wrap your AI client instance instead. @@ -53,7 +54,7 @@ supported: - + ## Manual Instrumentation @@ -111,7 +112,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `langChainIntegration` integration for **automatic instrumentation**: @@ -130,7 +131,7 @@ Sentry.init({ - + Using the `createLangChainCallbackHandler` wrapper for **manual instrumentation**: diff --git a/docs/platforms/javascript/common/agent-tracing/langgraph.mdx b/docs/platforms/javascript/common/agent-tracing/langgraph.mdx index d624bf14c23f4..32bf29abff637 100644 --- a/docs/platforms/javascript/common/agent-tracing/langgraph.mdx +++ b/docs/platforms/javascript/common/agent-tracing/langgraph.mdx @@ -5,6 +5,7 @@ sidebar_order: 25 supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -33,13 +34,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.langGraphIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, you need to use **[Manual Instrumentation](#manual-instrumentation)** to explicitly wrap your AI client instance instead. @@ -53,7 +54,7 @@ supported: - + ## Manual Instrumentation @@ -133,7 +134,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `langGraphIntegration` integration for **automatic instrumentation**: @@ -152,7 +153,7 @@ Sentry.init({ - + Using the `instrumentLangGraph` wrapper for **manual instrumentation**: diff --git a/docs/platforms/javascript/common/agent-tracing/manual-instrumentation.mdx b/docs/platforms/javascript/common/agent-tracing/manual-instrumentation.mdx index 98657524519c3..7cea6bb825db7 100644 --- a/docs/platforms/javascript/common/agent-tracing/manual-instrumentation.mdx +++ b/docs/platforms/javascript/common/agent-tracing/manual-instrumentation.mdx @@ -6,6 +6,7 @@ description: "Learn how to manually instrument your agents to capture spans, tok supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.bun diff --git a/docs/platforms/javascript/common/agent-tracing/mastra.mdx b/docs/platforms/javascript/common/agent-tracing/mastra.mdx index ba86d6c4f97c5..7433d2beadce7 100644 --- a/docs/platforms/javascript/common/agent-tracing/mastra.mdx +++ b/docs/platforms/javascript/common/agent-tracing/mastra.mdx @@ -6,6 +6,7 @@ sidebar_order: 26 supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/agent-tracing/openai.mdx b/docs/platforms/javascript/common/agent-tracing/openai.mdx index 4f7dcea270c05..b0fee5ba72ea6 100644 --- a/docs/platforms/javascript/common/agent-tracing/openai.mdx +++ b/docs/platforms/javascript/common/agent-tracing/openai.mdx @@ -5,6 +5,7 @@ sidebar_order: 21 supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -33,13 +34,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.openAIIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, **[wrap the client](#instrument-the-client)** with `instrumentOpenAiClient` instead. @@ -53,7 +54,7 @@ supported: - + ## Instrument the Client @@ -156,7 +157,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `openAIIntegration` integration for **automatic instrumentation**: @@ -175,7 +176,7 @@ Sentry.init({ - + Using the `instrumentOpenAiClient` wrapper: @@ -204,7 +205,7 @@ Instrumented calls record model, token usage, latency, and (when enabled) inputs The OpenAI SDK does **not** run your tools — your application does, after the model returns `tool_calls`. Because of that, `instrumentOpenAiClient` / `openAIIntegration` do **not** create `gen_ai.execute_tool` spans for local tool handlers. - + To get the full agent tree (`gen_ai.invoke_agent` → `gen_ai.chat` + `gen_ai.execute_tool`), wrap your tool loop with manual instrumentation. diff --git a/docs/platforms/javascript/common/agent-tracing/vercelai.mdx b/docs/platforms/javascript/common/agent-tracing/vercelai.mdx index e9fcdfda98cfc..e9162937a68e0 100644 --- a/docs/platforms/javascript/common/agent-tracing/vercelai.mdx +++ b/docs/platforms/javascript/common/agent-tracing/vercelai.mdx @@ -5,6 +5,7 @@ sidebar_order: 20 supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.bun diff --git a/docs/platforms/javascript/common/best-practices/index.mdx b/docs/platforms/javascript/common/best-practices/index.mdx index 57cdce4fcceaa..6fbf731a00c1d 100644 --- a/docs/platforms/javascript/common/best-practices/index.mdx +++ b/docs/platforms/javascript/common/best-practices/index.mdx @@ -6,6 +6,7 @@ sidebar_section: configuration notSupported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/best-practices/micro-frontends.mdx b/docs/platforms/javascript/common/best-practices/micro-frontends.mdx index bf50bf3a9805e..69fde67ba8326 100644 --- a/docs/platforms/javascript/common/best-practices/micro-frontends.mdx +++ b/docs/platforms/javascript/common/best-practices/micro-frontends.mdx @@ -5,6 +5,7 @@ description: Learn how to identify the source of errors and route events to diff notSupported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/best-practices/multiple-sentry-instances.mdx b/docs/platforms/javascript/common/best-practices/multiple-sentry-instances.mdx index 0344370105230..f8f01830c2263 100644 --- a/docs/platforms/javascript/common/best-practices/multiple-sentry-instances.mdx +++ b/docs/platforms/javascript/common/best-practices/multiple-sentry-instances.mdx @@ -5,6 +5,7 @@ description: Learn how to manage several Sentry instances by creating your own c notSupported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/best-practices/offline-caching.mdx b/docs/platforms/javascript/common/best-practices/offline-caching.mdx index 57e3bd0da439d..87f29ea9e809f 100644 --- a/docs/platforms/javascript/common/best-practices/offline-caching.mdx +++ b/docs/platforms/javascript/common/best-practices/offline-caching.mdx @@ -9,6 +9,7 @@ notSupported: - javascript.wasm - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/best-practices/shared-environments.mdx b/docs/platforms/javascript/common/best-practices/shared-environments.mdx index 37df027b4baf7..82ae8d0786ce9 100644 --- a/docs/platforms/javascript/common/best-practices/shared-environments.mdx +++ b/docs/platforms/javascript/common/best-practices/shared-environments.mdx @@ -5,6 +5,7 @@ description: Learn how to use Sentry in shared environments (for example in brow notSupported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/best-practices/web-workers.mdx b/docs/platforms/javascript/common/best-practices/web-workers.mdx index 01b4155158c1e..f701b72c57370 100644 --- a/docs/platforms/javascript/common/best-practices/web-workers.mdx +++ b/docs/platforms/javascript/common/best-practices/web-workers.mdx @@ -9,6 +9,7 @@ notSupported: - javascript.cordova - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/async-context.mdx b/docs/platforms/javascript/common/configuration/async-context.mdx index 774ac970e84fa..ecd7a100c3c38 100644 --- a/docs/platforms/javascript/common/configuration/async-context.mdx +++ b/docs/platforms/javascript/common/configuration/async-context.mdx @@ -5,6 +5,7 @@ description: "Learn more about how to isolate Sentry scope and breadcrumbs acros supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/event-loop-block.mdx b/docs/platforms/javascript/common/configuration/event-loop-block.mdx index 08e8f23867274..0f29e92c06620 100644 --- a/docs/platforms/javascript/common/configuration/event-loop-block.mdx +++ b/docs/platforms/javascript/common/configuration/event-loop-block.mdx @@ -5,6 +5,7 @@ description: Monitor for blocked event loops in Node.js applications supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/amqplib.mdx b/docs/platforms/javascript/common/configuration/integrations/amqplib.mdx index 765b47e3fd338..2c64c54c7e15a 100644 --- a/docs/platforms/javascript/common/configuration/integrations/amqplib.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/amqplib.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Amqplib. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.astro - javascript.aws-lambda - javascript.azure-functions diff --git a/docs/platforms/javascript/common/configuration/integrations/anr.mdx b/docs/platforms/javascript/common/configuration/integrations/anr.mdx index 9ce2402119572..80ff2fc2af6d5 100644 --- a/docs/platforms/javascript/common/configuration/integrations/anr.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/anr.mdx @@ -4,6 +4,7 @@ description: "Capture events when the event loop is blocked and the application supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/breadcrumbs.mdx b/docs/platforms/javascript/common/configuration/integrations/breadcrumbs.mdx index c716a0b9d7f63..0ff566f0344e7 100644 --- a/docs/platforms/javascript/common/configuration/integrations/breadcrumbs.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/breadcrumbs.mdx @@ -5,6 +5,7 @@ description: "Wraps native browser APIs to capture breadcrumbs. (default)" notSupported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/browserapierrors.mdx b/docs/platforms/javascript/common/configuration/integrations/browserapierrors.mdx index 313f75aa9c4b3..8935b212dd3b4 100644 --- a/docs/platforms/javascript/common/configuration/integrations/browserapierrors.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/browserapierrors.mdx @@ -5,6 +5,7 @@ notSupported: - javascript.electron - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx b/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx index bbc4597c1dc41..5b513a24670f4 100644 --- a/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx @@ -6,6 +6,7 @@ notSupported: - javascript.capacitor - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/browsersession.mdx b/docs/platforms/javascript/common/configuration/integrations/browsersession.mdx index f616107f64c8c..c692cda4cd908 100644 --- a/docs/platforms/javascript/common/configuration/integrations/browsersession.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/browsersession.mdx @@ -5,6 +5,7 @@ notSupported: - javascript.cordova - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/browsertracing.mdx b/docs/platforms/javascript/common/configuration/integrations/browsertracing.mdx index 7023b09a91373..edc9e23fb6c7d 100644 --- a/docs/platforms/javascript/common/configuration/integrations/browsertracing.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/browsertracing.mdx @@ -5,6 +5,7 @@ notSupported: - javascript.cordova - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/childProcess.mdx b/docs/platforms/javascript/common/configuration/integrations/childProcess.mdx index 0aaaf5c3eaa56..61e0ef1e52b4f 100644 --- a/docs/platforms/javascript/common/configuration/integrations/childProcess.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/childProcess.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for child processes and worker threads (defau supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/console.mdx b/docs/platforms/javascript/common/configuration/integrations/console.mdx index 22dc2061773b7..2f5142476012c 100644 --- a/docs/platforms/javascript/common/configuration/integrations/console.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/console.mdx @@ -5,6 +5,7 @@ customCanonicalTag: "/platforms/javascript/guides/express/configuration/integrat supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/contextlines.mdx b/docs/platforms/javascript/common/configuration/integrations/contextlines.mdx index bc795fb4e9909..3a56175f82bbe 100644 --- a/docs/platforms/javascript/common/configuration/integrations/contextlines.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/contextlines.mdx @@ -5,6 +5,7 @@ notSupported: - javascript.cordova - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/dataloader.mdx b/docs/platforms/javascript/common/configuration/integrations/dataloader.mdx index 15e3d3e46831d..1dc82214c26dd 100644 --- a/docs/platforms/javascript/common/configuration/integrations/dataloader.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/dataloader.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Dataloader." supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/elementtiming.mdx b/docs/platforms/javascript/common/configuration/integrations/elementtiming.mdx index 92420c8534a2c..c66d4b1b44885 100644 --- a/docs/platforms/javascript/common/configuration/integrations/elementtiming.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/elementtiming.mdx @@ -7,6 +7,7 @@ notSupported: - javascript.capacitor - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/event-loop-block.mdx b/docs/platforms/javascript/common/configuration/integrations/event-loop-block.mdx index 9d4984ee0f9e9..c13728f4ddd06 100644 --- a/docs/platforms/javascript/common/configuration/integrations/event-loop-block.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/event-loop-block.mdx @@ -4,6 +4,7 @@ description: "Monitor for blocked event loops in all threads of a Node.js applic supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/fastify.mdx b/docs/platforms/javascript/common/configuration/integrations/fastify.mdx index fd749df93d73b..2a3100fddb41c 100644 --- a/docs/platforms/javascript/common/configuration/integrations/fastify.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/fastify.mdx @@ -4,6 +4,7 @@ description: "Adds performance instrumentation for Fastify. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.fastify --- diff --git a/docs/platforms/javascript/common/configuration/integrations/firebase.mdx b/docs/platforms/javascript/common/configuration/integrations/firebase.mdx index fb9c9f00f4cd3..6e381f067960c 100644 --- a/docs/platforms/javascript/common/configuration/integrations/firebase.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/firebase.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Firebase. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.firebase - javascript.gcp-functions - javascript.astro diff --git a/docs/platforms/javascript/common/configuration/integrations/fs.mdx b/docs/platforms/javascript/common/configuration/integrations/fs.mdx index 661bacd94e01c..50f2aeac1f41d 100644 --- a/docs/platforms/javascript/common/configuration/integrations/fs.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/fs.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for filesystem operations." supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/genericpool.mdx b/docs/platforms/javascript/common/configuration/integrations/genericpool.mdx index 0aa1350f115fd..3b9bd2f879aae 100644 --- a/docs/platforms/javascript/common/configuration/integrations/genericpool.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/genericpool.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Generic Pool. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/globalhandlers.mdx b/docs/platforms/javascript/common/configuration/integrations/globalhandlers.mdx index f07bdf244fde3..f2239b1366843 100644 --- a/docs/platforms/javascript/common/configuration/integrations/globalhandlers.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/globalhandlers.mdx @@ -5,6 +5,7 @@ notSupported: - javascript.electron - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/graphql.mdx b/docs/platforms/javascript/common/configuration/integrations/graphql.mdx index 9edaeac99c8ba..61dd3b73cc9fc 100644 --- a/docs/platforms/javascript/common/configuration/integrations/graphql.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/graphql.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for GraphQL. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/graphqlclient.mdx b/docs/platforms/javascript/common/configuration/integrations/graphqlclient.mdx index 98cad960e93a8..15adb4dc4a114 100644 --- a/docs/platforms/javascript/common/configuration/integrations/graphqlclient.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/graphqlclient.mdx @@ -4,6 +4,7 @@ description: "Enhance spans and breadcrumbs with data from GraphQL requests." notSupported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/hapi.mdx b/docs/platforms/javascript/common/configuration/integrations/hapi.mdx index 6314788ed8812..f2718375fbe47 100644 --- a/docs/platforms/javascript/common/configuration/integrations/hapi.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/hapi.mdx @@ -4,6 +4,7 @@ description: "Adds performance instrumentation for Hapi. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.hapi --- diff --git a/docs/platforms/javascript/common/configuration/integrations/http.mdx b/docs/platforms/javascript/common/configuration/integrations/http.mdx index 0f77b8856ad11..c3666472ad12d 100644 --- a/docs/platforms/javascript/common/configuration/integrations/http.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/http.mdx @@ -4,6 +4,7 @@ description: "Capture spans & breadcrumbs for http requests. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/httpclient.mdx b/docs/platforms/javascript/common/configuration/integrations/httpclient.mdx index b144ecd9154ad..03c2af4347a65 100644 --- a/docs/platforms/javascript/common/configuration/integrations/httpclient.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/httpclient.mdx @@ -4,6 +4,7 @@ description: "Captures errors on failed requests from Fetch and XHR and attaches notSupported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/httpcontext.mdx b/docs/platforms/javascript/common/configuration/integrations/httpcontext.mdx index d8823c58e92f7..716d0a59f7650 100644 --- a/docs/platforms/javascript/common/configuration/integrations/httpcontext.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/httpcontext.mdx @@ -5,6 +5,7 @@ notSupported: - javascript.electron - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/kafka.mdx b/docs/platforms/javascript/common/configuration/integrations/kafka.mdx index 5ae1028210873..aa048fc9c1a25 100644 --- a/docs/platforms/javascript/common/configuration/integrations/kafka.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/kafka.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for KafkaJS. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/knex.mdx b/docs/platforms/javascript/common/configuration/integrations/knex.mdx index d06ea622f3630..0cdb4eae51065 100644 --- a/docs/platforms/javascript/common/configuration/integrations/knex.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/knex.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Knex." supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/koa.mdx b/docs/platforms/javascript/common/configuration/integrations/koa.mdx index 61d424f1ce3ee..3c0b8788c33bd 100644 --- a/docs/platforms/javascript/common/configuration/integrations/koa.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/koa.mdx @@ -4,6 +4,7 @@ description: "Adds performance instrumentation for Koa. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.koa --- diff --git a/docs/platforms/javascript/common/configuration/integrations/launchdarkly.mdx b/docs/platforms/javascript/common/configuration/integrations/launchdarkly.mdx index b163fb03f3213..703ec0813b086 100644 --- a/docs/platforms/javascript/common/configuration/integrations/launchdarkly.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/launchdarkly.mdx @@ -21,6 +21,7 @@ notSupported: - javascript.nestjs - javascript.node - javascript.eve + - javascript.mastra - javascript.wasm --- diff --git a/docs/platforms/javascript/common/configuration/integrations/localvariables.mdx b/docs/platforms/javascript/common/configuration/integrations/localvariables.mdx index 1c50a5f3a95b0..ff7f83c571988 100644 --- a/docs/platforms/javascript/common/configuration/integrations/localvariables.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/localvariables.mdx @@ -4,6 +4,7 @@ description: "Add local variables to exception frames. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/lrumemoizer.mdx b/docs/platforms/javascript/common/configuration/integrations/lrumemoizer.mdx index 80d0fd3a30dbd..bc87ce11fc413 100644 --- a/docs/platforms/javascript/common/configuration/integrations/lrumemoizer.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/lrumemoizer.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for LRU Memoizer. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.astro - javascript.aws-lambda - javascript.azure-functions diff --git a/docs/platforms/javascript/common/configuration/integrations/modulemetadata.mdx b/docs/platforms/javascript/common/configuration/integrations/modulemetadata.mdx index f85e2a883a497..65a000d072cda 100644 --- a/docs/platforms/javascript/common/configuration/integrations/modulemetadata.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/modulemetadata.mdx @@ -5,6 +5,7 @@ notSupported: - javascript.electron - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/modules.mdx b/docs/platforms/javascript/common/configuration/integrations/modules.mdx index e40b89abb5f73..f79fe7574066e 100644 --- a/docs/platforms/javascript/common/configuration/integrations/modules.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/modules.mdx @@ -4,6 +4,7 @@ description: "Add node modules / packages to the event. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/mongo.mdx b/docs/platforms/javascript/common/configuration/integrations/mongo.mdx index 3d85d4b179e79..4f5b313332c7b 100644 --- a/docs/platforms/javascript/common/configuration/integrations/mongo.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/mongo.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for MongoDB. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/mongoose.mdx b/docs/platforms/javascript/common/configuration/integrations/mongoose.mdx index 96e408d5425c7..8f459e2fbebe4 100644 --- a/docs/platforms/javascript/common/configuration/integrations/mongoose.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/mongoose.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Mongoose. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/mysql.mdx b/docs/platforms/javascript/common/configuration/integrations/mysql.mdx index b7fba3defe1b7..cf22d747a0c6d 100644 --- a/docs/platforms/javascript/common/configuration/integrations/mysql.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/mysql.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for MySQL. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/mysql2.mdx b/docs/platforms/javascript/common/configuration/integrations/mysql2.mdx index 373a1b27f9207..4484cec1d5ee0 100644 --- a/docs/platforms/javascript/common/configuration/integrations/mysql2.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/mysql2.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for MySQL2. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/nest.mdx b/docs/platforms/javascript/common/configuration/integrations/nest.mdx index 1a6802fb6650e..b9108b6a2e2db 100644 --- a/docs/platforms/javascript/common/configuration/integrations/nest.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/nest.mdx @@ -4,6 +4,7 @@ description: "Adds performance instrumentation for Nest.js. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.nestjs --- diff --git a/docs/platforms/javascript/common/configuration/integrations/nodecontext.mdx b/docs/platforms/javascript/common/configuration/integrations/nodecontext.mdx index 00dd25b4ca4a0..220f09a3aabf7 100644 --- a/docs/platforms/javascript/common/configuration/integrations/nodecontext.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/nodecontext.mdx @@ -4,6 +4,7 @@ description: "Capture context about the environment and the device that the clie supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/nodefetch.mdx b/docs/platforms/javascript/common/configuration/integrations/nodefetch.mdx index db82aabe65cc4..e18f6fea19c0b 100644 --- a/docs/platforms/javascript/common/configuration/integrations/nodefetch.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/nodefetch.mdx @@ -5,6 +5,7 @@ customCanonicalTag: "/platforms/javascript/guides/nuxt/configuration/integration supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/nodeprofiling.mdx b/docs/platforms/javascript/common/configuration/integrations/nodeprofiling.mdx index 791eaf85f08c6..8b1d4ab7b8b1e 100644 --- a/docs/platforms/javascript/common/configuration/integrations/nodeprofiling.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/nodeprofiling.mdx @@ -4,6 +4,7 @@ description: "Capture profiling data for Node.js applications." supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/noderuntimemetrics.mdx b/docs/platforms/javascript/common/configuration/integrations/noderuntimemetrics.mdx index 0e5a92497e4b3..bc90666643df9 100644 --- a/docs/platforms/javascript/common/configuration/integrations/noderuntimemetrics.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/noderuntimemetrics.mdx @@ -4,6 +4,7 @@ description: "Collect Node.js runtime health metrics such as memory usage, CPU u supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/onuncaughtexception.mdx b/docs/platforms/javascript/common/configuration/integrations/onuncaughtexception.mdx index 484e79e031c69..479fa2081d112 100644 --- a/docs/platforms/javascript/common/configuration/integrations/onuncaughtexception.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/onuncaughtexception.mdx @@ -4,6 +4,7 @@ description: "Registers handlers to capture global uncaught exceptions. (default supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/openfeature.mdx b/docs/platforms/javascript/common/configuration/integrations/openfeature.mdx index a9627d67176b8..0bee6933df36c 100644 --- a/docs/platforms/javascript/common/configuration/integrations/openfeature.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/openfeature.mdx @@ -21,6 +21,7 @@ notSupported: - javascript.nestjs - javascript.node - javascript.eve + - javascript.mastra - javascript.wasm --- diff --git a/docs/platforms/javascript/common/configuration/integrations/pino.mdx b/docs/platforms/javascript/common/configuration/integrations/pino.mdx index dbe804bf90558..2fc6e9da2a295 100644 --- a/docs/platforms/javascript/common/configuration/integrations/pino.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/pino.mdx @@ -4,6 +4,7 @@ description: "Capture logs and errors from Pino." supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.astro - javascript.aws-lambda - javascript.azure-functions diff --git a/docs/platforms/javascript/common/configuration/integrations/postgres.mdx b/docs/platforms/javascript/common/configuration/integrations/postgres.mdx index aec67e91dc941..9f6e47b0daedd 100644 --- a/docs/platforms/javascript/common/configuration/integrations/postgres.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/postgres.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Postgres. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/prisma.mdx b/docs/platforms/javascript/common/configuration/integrations/prisma.mdx index 2bec381ae26e9..2c4236eea6161 100644 --- a/docs/platforms/javascript/common/configuration/integrations/prisma.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/prisma.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Prisma. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/prisma__v8.x.mdx b/docs/platforms/javascript/common/configuration/integrations/prisma__v8.x.mdx index f80a1e160eca7..0f300c55cbf0e 100644 --- a/docs/platforms/javascript/common/configuration/integrations/prisma__v8.x.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/prisma__v8.x.mdx @@ -5,6 +5,7 @@ noindex: true # Not indexed because it is a versioned docs page supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/redis.mdx b/docs/platforms/javascript/common/configuration/integrations/redis.mdx index f4c58b07063ed..168b28a253474 100644 --- a/docs/platforms/javascript/common/configuration/integrations/redis.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/redis.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Redis. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/replay.mdx b/docs/platforms/javascript/common/configuration/integrations/replay.mdx index 86d835b4ddfdc..7b6a1b36eb1ed 100644 --- a/docs/platforms/javascript/common/configuration/integrations/replay.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/replay.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/replaycanvas.mdx b/docs/platforms/javascript/common/configuration/integrations/replaycanvas.mdx index e43d41949c299..8d3980d15bcfc 100644 --- a/docs/platforms/javascript/common/configuration/integrations/replaycanvas.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/replaycanvas.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/reportingobserver.mdx b/docs/platforms/javascript/common/configuration/integrations/reportingobserver.mdx index f74cb23c5e0ab..ab021304ea27a 100644 --- a/docs/platforms/javascript/common/configuration/integrations/reportingobserver.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/reportingobserver.mdx @@ -4,6 +4,7 @@ description: "Captures the reports collected via the `ReportingObserver` interfa notSupported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/requestdata.mdx b/docs/platforms/javascript/common/configuration/integrations/requestdata.mdx index 50d66b3e590b0..85ab98339e6ae 100644 --- a/docs/platforms/javascript/common/configuration/integrations/requestdata.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/requestdata.mdx @@ -6,6 +6,7 @@ supported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/statsig.mdx b/docs/platforms/javascript/common/configuration/integrations/statsig.mdx index b7acf31037ead..dbf21bebf6985 100644 --- a/docs/platforms/javascript/common/configuration/integrations/statsig.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/statsig.mdx @@ -19,6 +19,7 @@ notSupported: - javascript.nestjs - javascript.node - javascript.eve + - javascript.mastra - javascript.wasm --- diff --git a/docs/platforms/javascript/common/configuration/integrations/supabase.mdx b/docs/platforms/javascript/common/configuration/integrations/supabase.mdx index 1531e7a70c7dc..944fbfd3f595e 100644 --- a/docs/platforms/javascript/common/configuration/integrations/supabase.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/supabase.mdx @@ -5,6 +5,7 @@ supported: - javascript.browser - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/tedious.mdx b/docs/platforms/javascript/common/configuration/integrations/tedious.mdx index e342f6524fc8b..d2b70c6fa8208 100644 --- a/docs/platforms/javascript/common/configuration/integrations/tedious.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/tedious.mdx @@ -4,6 +4,7 @@ description: "Adds instrumentation for Tedious. (default)" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.astro - javascript.aws-lambda - javascript.azure-functions diff --git a/docs/platforms/javascript/common/configuration/integrations/trpc.mdx b/docs/platforms/javascript/common/configuration/integrations/trpc.mdx index cb211e252282b..5cfeaf8b22fff 100644 --- a/docs/platforms/javascript/common/configuration/integrations/trpc.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/trpc.mdx @@ -4,6 +4,7 @@ description: "Capture spans & errors for tRPC handlers." supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/unhandledrejection.mdx b/docs/platforms/javascript/common/configuration/integrations/unhandledrejection.mdx index f57ae4218345e..07d9795ff2dbe 100644 --- a/docs/platforms/javascript/common/configuration/integrations/unhandledrejection.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/unhandledrejection.mdx @@ -4,6 +4,7 @@ description: "Registers handlers to capture global unhandled promise rejections. supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/integrations/unleash.mdx b/docs/platforms/javascript/common/configuration/integrations/unleash.mdx index f31d32a915cf4..18c8db7c8ec08 100644 --- a/docs/platforms/javascript/common/configuration/integrations/unleash.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/unleash.mdx @@ -21,6 +21,7 @@ notSupported: - javascript.nestjs - javascript.node - javascript.eve + - javascript.mastra - javascript.wasm --- diff --git a/docs/platforms/javascript/common/configuration/integrations/webworker.mdx b/docs/platforms/javascript/common/configuration/integrations/webworker.mdx index f11d69067ac62..95aa1d28f5002 100644 --- a/docs/platforms/javascript/common/configuration/integrations/webworker.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/webworker.mdx @@ -5,6 +5,7 @@ notSupported: - javascript.cordova - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/configuration/transports.mdx b/docs/platforms/javascript/common/configuration/transports.mdx index bb01428c92151..1a3ba82cc54a4 100644 --- a/docs/platforms/javascript/common/configuration/transports.mdx +++ b/docs/platforms/javascript/common/configuration/transports.mdx @@ -9,6 +9,7 @@ notSupported: - javascript.wasm - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/crons/index.mdx b/docs/platforms/javascript/common/crons/index.mdx index 62421f5321de0..ee288f1048ebe 100644 --- a/docs/platforms/javascript/common/crons/index.mdx +++ b/docs/platforms/javascript/common/crons/index.mdx @@ -14,6 +14,7 @@ supported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/crons/troubleshooting.mdx b/docs/platforms/javascript/common/crons/troubleshooting.mdx index 31a92b14ea988..3d3822f44d4bf 100644 --- a/docs/platforms/javascript/common/crons/troubleshooting.mdx +++ b/docs/platforms/javascript/common/crons/troubleshooting.mdx @@ -13,6 +13,7 @@ supported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/data-management/data-collected/index.mdx b/docs/platforms/javascript/common/data-management/data-collected/index.mdx index 45c42550f58d4..8945a902a7a2f 100644 --- a/docs/platforms/javascript/common/data-management/data-collected/index.mdx +++ b/docs/platforms/javascript/common/data-management/data-collected/index.mdx @@ -149,7 +149,7 @@ By default, the Sentry SDK sends information about the device and runtime to Sen - + ## Session Replay diff --git a/docs/platforms/javascript/common/enriching-events/request-isolation/index.mdx b/docs/platforms/javascript/common/enriching-events/request-isolation/index.mdx index 1084ec01f5736..f03d771f8d06f 100644 --- a/docs/platforms/javascript/common/enriching-events/request-isolation/index.mdx +++ b/docs/platforms/javascript/common/enriching-events/request-isolation/index.mdx @@ -5,6 +5,7 @@ supported: - javascript.nextjs - javascript.node - javascript.eve + - javascript.mastra - javascript.connect - javascript.express - javascript.fastify diff --git a/docs/platforms/javascript/common/feature-flags/index.mdx b/docs/platforms/javascript/common/feature-flags/index.mdx index 02b943bf8c329..b1675d674b265 100644 --- a/docs/platforms/javascript/common/feature-flags/index.mdx +++ b/docs/platforms/javascript/common/feature-flags/index.mdx @@ -6,6 +6,7 @@ sidebar_section: features description: "With Feature Flags, Sentry tracks feature flag evaluations in your application using the Sentry JavaScript SDK, keeps an audit log of feature flag changes, and reports any suspicious updates that may have caused an error." notSupported: - javascript.eve + - javascript.mastra --- ## Prerequisites diff --git a/docs/platforms/javascript/common/install/index.mdx b/docs/platforms/javascript/common/install/index.mdx index 890fe54413bc7..07508f115f535 100644 --- a/docs/platforms/javascript/common/install/index.mdx +++ b/docs/platforms/javascript/common/install/index.mdx @@ -4,6 +4,7 @@ sidebar_order: 1 description: "Review our alternate installation methods." notSupported: - javascript.eve + - javascript.mastra - javascript.angular - javascript.astro - javascript.bun diff --git a/docs/platforms/javascript/common/install/loader.mdx b/docs/platforms/javascript/common/install/loader.mdx index 2faf83c9ac603..d3e03fa9c8abc 100644 --- a/docs/platforms/javascript/common/install/loader.mdx +++ b/docs/platforms/javascript/common/install/loader.mdx @@ -24,6 +24,7 @@ notSupported: - javascript.sveltekit - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/install/npm.mdx b/docs/platforms/javascript/common/install/npm.mdx index ee96257346d9a..02d5422d9c7f7 100644 --- a/docs/platforms/javascript/common/install/npm.mdx +++ b/docs/platforms/javascript/common/install/npm.mdx @@ -25,6 +25,7 @@ notSupported: - javascript.sveltekit - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/logs/index.mdx b/docs/platforms/javascript/common/logs/index.mdx index 7d4e8f57d22fc..f6ceea5a991c6 100644 --- a/docs/platforms/javascript/common/logs/index.mdx +++ b/docs/platforms/javascript/common/logs/index.mdx @@ -209,7 +209,7 @@ Sentry.init({ Everything in Sentry is linked by trace. When you're viewing a log, you can jump to the parent trace to see the full request context. When you're viewing a trace, you can see all logs emitted during that operation. This connection makes it easy to move between high-level performance data and detailed diagnostic logs. - **[Traces](/product/trace-explorer/)** — Logs emitted during an active span automatically include `sentry.trace.parent_span_id`. Click through from any log to see the full trace, or filter logs by trace ID to see everything that happened during a specific request. -- **[Session Replay](/product/session-replay/)** — Logs include `sentry.replay_id` when a replay is active. Jump from a log entry directly to the replay to see what the user was doing when the log was emitted. +- **[Session Replay](/product/session-replay/)** — Logs include `sentry.replay_id` when a replay is active. Jump from a log entry directly to the replay to see what the user was doing when the log was emitted. - **[Errors](/product/issues/)** — Logs capture the journey leading up to a failure. When an error occurs, your logs show what data was processed, which code paths executed, and what state the system was in — context that stack traces alone can't provide. ## Best Practices @@ -228,6 +228,6 @@ Any attributes set via `Sentry.setAttribute()` / `Sentry.setAttributes()` (or di ## Related Features - Tracing — Logs are automatically linked to traces, so you can see logs in the context of the request or operation that produced them. -- Session Replay — Logs are automatically linked to replays, letting you jump from a log entry to see what the user was doing. +- Session Replay — Logs are automatically linked to replays, letting you jump from a log entry to see what the user was doing. - Error Monitoring — Use logs to add diagnostic context that helps you understand what led to an error. - Attributes — Set attributes once and have them automatically included on all your logs. diff --git a/docs/platforms/javascript/common/metrics/index.mdx b/docs/platforms/javascript/common/metrics/index.mdx index 38719d739d7c7..1e3ad433ef4e9 100644 --- a/docs/platforms/javascript/common/metrics/index.mdx +++ b/docs/platforms/javascript/common/metrics/index.mdx @@ -34,7 +34,7 @@ With [Sentry's Application Metrics](/product/metrics/), you can send counters, g ## Integrations - + - `elementTimingIntegration` diff --git a/docs/platforms/javascript/common/migration/v7-to-v8/v8-opentelemetry.mdx b/docs/platforms/javascript/common/migration/v7-to-v8/v8-opentelemetry.mdx index d16ba4a9f772f..f2c096e76c4f3 100644 --- a/docs/platforms/javascript/common/migration/v7-to-v8/v8-opentelemetry.mdx +++ b/docs/platforms/javascript/common/migration/v7-to-v8/v8-opentelemetry.mdx @@ -6,6 +6,7 @@ description: "Learn OpenTelemetry support in SDK 8.x" supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/opentelemetry/custom-setup.mdx b/docs/platforms/javascript/common/opentelemetry/custom-setup.mdx index a294374981683..75417420afe61 100644 --- a/docs/platforms/javascript/common/opentelemetry/custom-setup.mdx +++ b/docs/platforms/javascript/common/opentelemetry/custom-setup.mdx @@ -5,6 +5,7 @@ supported: - javascript.nextjs - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.bun @@ -39,7 +40,7 @@ If you are looking to simply add individual OpenTelemetry instrumentation to you - + If you don't need the full `@sentry/node` SDK and want a simpler way to bridge your existing OpenTelemetry setup with Sentry, consider using lightweight mode with the OTLP integration instead. It requires significantly less manual wiring. diff --git a/docs/platforms/javascript/common/opentelemetry/index.mdx b/docs/platforms/javascript/common/opentelemetry/index.mdx index 468373c3a6025..fbde8fe769b4c 100644 --- a/docs/platforms/javascript/common/opentelemetry/index.mdx +++ b/docs/platforms/javascript/common/opentelemetry/index.mdx @@ -7,6 +7,7 @@ supported: - javascript.nextjs - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.bun diff --git a/docs/platforms/javascript/common/opentelemetry/using-opentelemetry-apis.mdx b/docs/platforms/javascript/common/opentelemetry/using-opentelemetry-apis.mdx index 8d0aaa5120a4a..40bc8d5179743 100644 --- a/docs/platforms/javascript/common/opentelemetry/using-opentelemetry-apis.mdx +++ b/docs/platforms/javascript/common/opentelemetry/using-opentelemetry-apis.mdx @@ -5,6 +5,7 @@ supported: - javascript.nextjs - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.bun diff --git a/docs/platforms/javascript/common/session-replay/configuration.mdx b/docs/platforms/javascript/common/session-replay/configuration.mdx index 84acbfae9b5a3..e60c10c2290aa 100644 --- a/docs/platforms/javascript/common/session-replay/configuration.mdx +++ b/docs/platforms/javascript/common/session-replay/configuration.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/session-replay/index.mdx b/docs/platforms/javascript/common/session-replay/index.mdx index 3425738c5b120..d5ecc2efacf98 100644 --- a/docs/platforms/javascript/common/session-replay/index.mdx +++ b/docs/platforms/javascript/common/session-replay/index.mdx @@ -10,6 +10,7 @@ notSupported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/session-replay/issue-types.mdx b/docs/platforms/javascript/common/session-replay/issue-types.mdx index 952e3ec81101c..bf47c56691c1c 100644 --- a/docs/platforms/javascript/common/session-replay/issue-types.mdx +++ b/docs/platforms/javascript/common/session-replay/issue-types.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/session-replay/privacy.mdx b/docs/platforms/javascript/common/session-replay/privacy.mdx index 0db38b2eeb2c1..4293be0fbaf74 100644 --- a/docs/platforms/javascript/common/session-replay/privacy.mdx +++ b/docs/platforms/javascript/common/session-replay/privacy.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/session-replay/troubleshooting.mdx b/docs/platforms/javascript/common/session-replay/troubleshooting.mdx index b3c077f924ac4..440d3a34f732b 100644 --- a/docs/platforms/javascript/common/session-replay/troubleshooting.mdx +++ b/docs/platforms/javascript/common/session-replay/troubleshooting.mdx @@ -9,6 +9,7 @@ notSupported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx b/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx index 65b23532e112f..9acad435ba912 100644 --- a/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx +++ b/docs/platforms/javascript/common/session-replay/understanding-sessions.mdx @@ -8,6 +8,7 @@ notSupported: - javascript.deno - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/sourcemaps/uploading/hosting-publicly.mdx b/docs/platforms/javascript/common/sourcemaps/uploading/hosting-publicly.mdx index 268c9c4edaed3..47620afa80fdd 100644 --- a/docs/platforms/javascript/common/sourcemaps/uploading/hosting-publicly.mdx +++ b/docs/platforms/javascript/common/sourcemaps/uploading/hosting-publicly.mdx @@ -5,6 +5,7 @@ sidebar_order: 10 notSupported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/tracing/distributed-tracing/dealing-with-cors-issues/index.mdx b/docs/platforms/javascript/common/tracing/distributed-tracing/dealing-with-cors-issues/index.mdx index 2d5297f318241..9a0469fb29ebb 100644 --- a/docs/platforms/javascript/common/tracing/distributed-tracing/dealing-with-cors-issues/index.mdx +++ b/docs/platforms/javascript/common/tracing/distributed-tracing/dealing-with-cors-issues/index.mdx @@ -5,6 +5,7 @@ notSupported: - javascript.cordova - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/tracing/instrumentation/caches-module.mdx b/docs/platforms/javascript/common/tracing/instrumentation/caches-module.mdx index af5c625753735..04cf8593c1dbd 100644 --- a/docs/platforms/javascript/common/tracing/instrumentation/caches-module.mdx +++ b/docs/platforms/javascript/common/tracing/instrumentation/caches-module.mdx @@ -5,6 +5,7 @@ description: "Learn how to manually instrument your code to use Sentry's Cache m supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -51,7 +52,7 @@ If you're using anything other than Sentry's Redis integration, you'll need to m You'll need to create two spans - one indicating that something is being put into the cache, and a second one indicating that something is being fetched from the cache. - + Make sure that there's an active span before you create your cache spans. If you're using a web framework like Express, a span will be created for you automatically. See Tracing for more information. diff --git a/docs/platforms/javascript/common/tracing/instrumentation/queues-module.mdx b/docs/platforms/javascript/common/tracing/instrumentation/queues-module.mdx index 752ce6b633531..36c4f25dfea89 100644 --- a/docs/platforms/javascript/common/tracing/instrumentation/queues-module.mdx +++ b/docs/platforms/javascript/common/tracing/instrumentation/queues-module.mdx @@ -5,6 +5,7 @@ sidebar_order: 20 supported: - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/troubleshooting/supported-browsers.mdx b/docs/platforms/javascript/common/troubleshooting/supported-browsers.mdx index 0c6f6ebff99b3..32a83dd416604 100644 --- a/docs/platforms/javascript/common/troubleshooting/supported-browsers.mdx +++ b/docs/platforms/javascript/common/troubleshooting/supported-browsers.mdx @@ -6,6 +6,7 @@ notSupported: - javascript.cordova - javascript.node - javascript.eve + - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect diff --git a/docs/platforms/javascript/common/user-feedback/configuration/index.mdx b/docs/platforms/javascript/common/user-feedback/configuration/index.mdx index e776b6bb0d1d7..26359e0ac6796 100644 --- a/docs/platforms/javascript/common/user-feedback/configuration/index.mdx +++ b/docs/platforms/javascript/common/user-feedback/configuration/index.mdx @@ -5,9 +5,10 @@ description: Learn about general User Feedback configuration fields. og_image: /og-images/platforms-javascript-common-user-feedback-configuration.png notSupported: - javascript.eve + - javascript.mastra --- - + ## User Feedback Widget diff --git a/docs/platforms/javascript/common/user-feedback/configuration/index__v7.x.mdx b/docs/platforms/javascript/common/user-feedback/configuration/index__v7.x.mdx index 30060620d149f..e696f17382cbe 100644 --- a/docs/platforms/javascript/common/user-feedback/configuration/index__v7.x.mdx +++ b/docs/platforms/javascript/common/user-feedback/configuration/index__v7.x.mdx @@ -8,6 +8,7 @@ og_image: >- /og-images/platforms-javascript-common-user-feedback-configuration-index__v7.x.png notSupported: - javascript.eve + - javascript.mastra --- @@ -16,7 +17,7 @@ In version 7 of our JavaScript SDK, User Feedback was released as a Beta integra - + ## User Feedback Widget diff --git a/docs/platforms/javascript/common/user-feedback/index.mdx b/docs/platforms/javascript/common/user-feedback/index.mdx index e1972e64c8a42..55ce4afc68739 100644 --- a/docs/platforms/javascript/common/user-feedback/index.mdx +++ b/docs/platforms/javascript/common/user-feedback/index.mdx @@ -7,6 +7,7 @@ sidebar_section: features og_image: /og-images/platforms-javascript-common-user-feedback.png notSupported: - javascript.eve + - javascript.mastra --- The User Feedback feature allows you to collect user feedback from anywhere inside your application at any time, without needing an error event to occur first. The [Crash-Report Modal](#crash-report-modal) feature, on the other hand, lets you prompt for user feedback when an error event occurs. @@ -17,7 +18,7 @@ The User Feedback feature allows you to collect user feedback from anywhere insi feature. Lower versions may have limited functionality. - + ## User Feedback Widget diff --git a/docs/platforms/javascript/guides/mastra/index.mdx b/docs/platforms/javascript/guides/mastra/index.mdx index 57252d6e24262..a06edf505ae11 100644 --- a/docs/platforms/javascript/guides/mastra/index.mdx +++ b/docs/platforms/javascript/guides/mastra/index.mdx @@ -1,8 +1,9 @@ --- title: Mastra -description: Learn how to send Mastra agent traces, model calls, and tool executions to Sentry. +description: Learn how to send Mastra agent traces, model calls, tool executions, and errors to Sentry with the Sentry SDK. sdk: sentry.javascript.node -inheritCommonContent: false +fallbackGuide: javascript.node +icon: mastra categories: - javascript - server @@ -14,126 +15,206 @@ keywords: - agent tracing --- -[Mastra](https://mastra.ai/) is a TypeScript framework for building AI applications and agents. This guide configures Mastra's `@mastra/sentry` exporter to send agent runs, model generations, tool calls, and workflows to [Sentry Agent Tracing](/product/agents/). +[Mastra](https://mastra.ai/) is a TypeScript framework for building AI applications and agents. This guide sets up the Sentry SDK in a Mastra app so agent runs, model generations, tool calls, workflows, and errors flow into [Sentry Agent Tracing](/product/agents/). -The exporter uses `@sentry/node` internally, so it can send Mastra telemetry directly to a Sentry project without another Sentry SDK. + + +This guide covers the Sentry SDK-based setup, which replaces the earlier `@mastra/sentry` exporter. It requires JavaScript SDK version `11.0.0-rc.0` or later. + + + +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. ## Prerequisites Before you begin, you need: -- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/). The project's DSN tells the exporter where to send data. -- A Mastra application using `@mastra/core`. -- Node.js 22.13.0 or newer. The Mastra Sentry exporter does not support browser or edge runtimes. +- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/). The project's DSN tells the SDK where to send data. +- A Mastra application using `@mastra/core` version `1.63.2` or later. +- `@sentry/node` (or `@sentry/cloudflare`) version `11.0.0-rc.0` or later, and `@mastra/observability`. The SDK runs in Node.js and on Cloudflare Workers; it doesn't support browser runtimes. + + + +Don't run this setup alongside the community `@mastra/sentry` exporter. It calls `Sentry.init()` itself and exports spans in parallel, which conflicts with the built-in integration. Remove `@mastra/sentry` from your Mastra `exporters`. + + ## Install -Install the Mastra Sentry exporter and observability packages: +Install the Sentry Node SDK and Mastra's observability package: ```bash {tabTitle:npm} -npm install @mastra/sentry@latest @mastra/observability@latest +npm install @sentry/node@^11.0.0-rc.0 @mastra/observability@latest ``` ```bash {tabTitle:yarn} -yarn add @mastra/sentry@latest @mastra/observability@latest +yarn add @sentry/node@^11.0.0-rc.0 @mastra/observability@latest ``` ```bash {tabTitle:pnpm} -pnpm add @mastra/sentry@latest @mastra/observability@latest +pnpm add @sentry/node@^11.0.0-rc.0 @mastra/observability@latest ``` -You don't need to install or initialize `@sentry/node` separately for this setup. The exporter includes it as a dependency and initializes it for you. +Sentry's Mastra integration needs `@mastra/observability` present so it can attach its exporter to Mastra's telemetry pipeline. If Mastra can't load it, the integration warns and creates no spans. -## Configure + -Add your Sentry DSN to the environment. You can find it in **Project Settings > Client Keys (DSN)**. +To run Mastra on Cloudflare Workers, use `@sentry/cloudflare` in place of `@sentry/node`. -```bash {filename:.env} -SENTRY_DSN=___PUBLIC_DSN___ +Install the packages: + +```bash {tabTitle:npm} +npm install @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest +``` + +```bash {tabTitle:yarn} +yarn add @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest ``` -Add the Sentry exporter to your Mastra observability configuration: - -```typescript {filename:src/mastra/index.ts} -import { Mastra } from "@mastra/core"; -import { Observability } from "@mastra/observability"; -import { SentryExporter } from "@mastra/sentry"; - -export const mastra = new Mastra({ - // agents, workflows, ... - observability: new Observability({ - configs: { - sentry: { - serviceName: "my-mastra-service", - exporters: [ - new SentryExporter({ - tracesSampleRate: 1.0, - }), - ], - }, - }, - }), +```bash {tabTitle:pnpm} +pnpm add @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest +``` + +Add the Sentry Vite plugin to your Vite config. It wraps your Worker entry with Sentry at build time: + +```typescript {filename:vite.config.mts} +import { cloudflare } from "@cloudflare/vite-plugin"; +import { sentryCloudflareVitePlugin } from "@sentry/cloudflare/vite"; +import { defineConfig } from "vite"; + +export default defineConfig({ + plugins: [cloudflare(), sentryCloudflareVitePlugin()], }); ``` -Mastra sends agent data to Sentry as traces. Keep `tracesSampleRate` above `0` to enable tracing. The example sends every trace so you can verify the setup; lower the value in production if needed. +Create an `instrument.server.ts` file next to your Worker entry (the file named in wrangler's `main`). The plugin picks it up by convention and uses its default export as the Sentry options: -The exporter also reads `SENTRY_ENVIRONMENT` and `SENTRY_RELEASE` when those environment variables are set. You can instead pass `dsn`, `environment`, and `release` directly to `SentryExporter`. +```typescript {filename:src/instrument.server.ts} +export default (env: Env) => ({ + dsn: "___PUBLIC_DSN___", + // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. + // We recommend adjusting this value in production. + tracesSampleRate: 1.0, +}); +``` - +Enable Node.js compatibility in your `wrangler.toml` so Mastra and the SDK can run on Workers: -This setup covers telemetry produced by Mastra. If a frontend or another service communicates with a separate Mastra server, configure that application with its own [JavaScript framework guide](/platforms/javascript/) and use this guide for the Mastra service. +```toml {filename:wrangler.toml} +main = "src/index.ts" +compatibility_date = "2026-04-26" +compatibility_flags = ["nodejs_compat"] +``` -`@mastra/sentry` initializes `@sentry/node` internally. If Mastra runs in the same process as an application that already calls `Sentry.init()`, don't initialize Sentry a second time without first confirming that the two SDK setups are compatible. +With the plugin in place, `Sentry.init()` runs automatically — you don't add an instrument file or `--import` flag as you do for Node. Continue to [Verify](#verify). - + + +## Configure + +Create an instrument file that calls `Sentry.init()`, and preload it so Sentry starts before Mastra and the AI SDK load. + +Place the file in your Mastra `public/` directory. `mastra build` copies `public/` into the build output, so the file lands next to the compiled server as `instrument.mjs`, where `--import=./instrument.mjs` can resolve it: + +```javascript {filename:src/mastra/public/instrument.mjs} +import * as Sentry from "@sentry/node"; + +Sentry.init({ + dsn: "___PUBLIC_DSN___", + + // Set tracesSampleRate to 1.0 to capture 100% + // of spans for tracing. + // We recommend adjusting this value in production. + tracesSampleRate: 1.0, +}); +``` + +Preload the instrument file when you start Mastra by passing it through `--custom-args`: + +```json {filename:package.json} +{ + "scripts": { + "dev": "mastra dev --custom-args=\"--import=./instrument.mjs\"", + "start": "mastra start --custom-args=\"--import=./instrument.mjs\"" + } +} +``` + +With this setup, Sentry captures errors thrown by your agents and AI spans for every run — agent runs, model generations, tool calls, workflows, token usage, and latency — along with outgoing HTTP and `fetch` requests. Prompts and model outputs are recorded on your AI spans by default, so the Agent Tracing transcript shows the full exchange without any extra configuration. + +To review what's captured and turn recording of prompts and responses off, see [Privacy Controls](#privacy-controls). ## Verify -Run one of your Mastra agents, then open the **Agents** page in your Sentry project. You should see an agent run with its model generations, tool calls, token usage, and any related errors. +Run one of your Mastra agents, then open [Agent Tracing](/product/agents/) in Sentry and select the run. The timeline shows the model generations, tool calls, token usage, and latency for that run, plus any errors your agent threw. If no data appears, confirm that: -- `SENTRY_DSN` belongs to the Sentry project you're viewing. +- The `dsn` belongs to the Sentry project you're viewing. - `tracesSampleRate` is greater than `0`. -- Your application completed at least one agent run after you added the exporter. +- `@mastra/observability` is installed, so the integration can attach to Mastra's telemetry. +- Your application completed at least one agent run after you added the setup. + + + +## 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 }, + }, +}); +``` + +## Link Conversations + +To group a multi-turn chat into a single [Conversation](/product/agents/conversations/) in the Agents dashboards, pass a stable thread id when you call an agent. Mastra maps the memory thread id to `gen_ai.conversation.id`, so every run that shares a thread id groups into one conversation: + +```typescript +const result = await agent.generate(message, { + memory: { + thread: "session-123", + resource: "user-456", + }, +}); +``` + +Your agent needs a storage provider configured before Mastra accepts the `memory` option. Reuse the same thread id across the messages in a session. ## Next Steps - [Name your agents](/product/agents/naming/) so you can identify them in the Agents Dashboard. -- Add a stable thread ID to group multi-turn chats in [Conversations](/product/agents/conversations/). Mastra maps `metadata.threadId` to `gen_ai.conversation.id`. -- Review the [Mastra Sentry exporter reference](https://mastra.ai/integrations/observability/sentry). +- [Track AI agent spend with dashboards and alerts](https://sentry.io/cookbook/monitor-ai-agent-spend-with-dashboards-and-alerts/): build a dashboard for cost, tokens, models, and conversations. - Use the appropriate [JavaScript framework guide](/platforms/javascript/) for application monitoring in a separate frontend or service. -Mastra maps its span types to Sentry operations for the Agents dashboards: +Sentry's Mastra integration maps Mastra's span types to Sentry operations for the Agents dashboards: -| Mastra Span Type | Sentry Operation | -| ---------------------- | ---------------------- | -| `AGENT_RUN` | `gen_ai.invoke_agent` | -| `MODEL_GENERATION` | `gen_ai.chat` | -| `TOOL_CALL` | `gen_ai.execute_tool` | -| `MCP_TOOL_CALL` | `gen_ai.execute_tool` | -| `WORKFLOW_RUN` | `workflow.run` | -| `WORKFLOW_STEP` | `workflow.step` | -| `WORKFLOW_CONDITIONAL` | `workflow.conditional` | -| `WORKFLOW_PARALLEL` | `workflow.parallel` | -| `WORKFLOW_LOOP` | `workflow.loop` | -| `PROCESSOR_RUN` | `ai.processor` | -| `GENERIC` | `ai.span` | - -`MODEL_STEP` and `MODEL_CHUNK` spans are skipped. Their data is aggregated into parent `MODEL_GENERATION` spans. +| Mastra Span Type | Sentry Operation | +| -------------------- | --------------------- | +| `AGENT_RUN` | `gen_ai.invoke_agent` | +| `WORKFLOW_RUN` | `gen_ai.invoke_agent` | +| `MODEL_GENERATION` | `gen_ai.chat` | +| `TOOL_CALL` | `gen_ai.execute_tool` | +| `MCP_TOOL_CALL` | `gen_ai.execute_tool` | +| `PROVIDER_TOOL_CALL` | `gen_ai.execute_tool` | +| `CLIENT_TOOL_CALL` | `gen_ai.execute_tool` | +| `RAG_EMBEDDING` | `gen_ai.embeddings` | Spans are tagged with `sentry.origin: auto.ai.mastra`. - - ## Supported Versions -- `@mastra/sentry`: `>=1.0.0` -- Node.js: `>=22.13.0` +- `@sentry/node`: `>=11.0.0-rc.0` +- `@sentry/cloudflare`: `>=11.0.0-rc.0` +- `@mastra/core`: `>=1.63.2` +- `@mastra/observability`: required for the integration to create spans From 6a26bf35b85688ff51cd302d7bea7224e9b644e4 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Thu, 17 Sep 2026 14:21:10 +0200 Subject: [PATCH 02/11] Apply batched suggestions from code review Co-authored-by: Sigrid <32902192+s1gr1d@users.noreply.github.com> Co-authored-by: Francesco Gringl-Novy --- docs/platforms/javascript/guides/mastra/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/guides/mastra/index.mdx b/docs/platforms/javascript/guides/mastra/index.mdx index a06edf505ae11..0556e5da35208 100644 --- a/docs/platforms/javascript/guides/mastra/index.mdx +++ b/docs/platforms/javascript/guides/mastra/index.mdx @@ -23,7 +23,7 @@ This guide covers the Sentry SDK-based setup, which replaces the earlier `@mastr -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. +The Sentry SDK instruments Mastra on its own. Therefore, 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. ## Prerequisites @@ -142,7 +142,7 @@ Preload the instrument file when you start Mastra by passing it through `--custo } ``` -With this setup, Sentry captures errors thrown by your agents and AI spans for every run — agent runs, model generations, tool calls, workflows, token usage, and latency — along with outgoing HTTP and `fetch` requests. Prompts and model outputs are recorded on your AI spans by default, so the Agent Tracing transcript shows the full exchange without any extra configuration. +With this setup, Sentry captures errors thrown by your agents and AI spans for every run (agent runs, model generations, tool calls, workflows, token usage, and latency) along with outgoing HTTP and `fetch` requests. Prompts and model outputs are recorded on your AI spans by default. To review what's captured and turn recording of prompts and responses off, see [Privacy Controls](#privacy-controls). From ac679d270bb7009f993e56ea9c47a6dbe403d1bd Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 17 Sep 2026 14:36:44 +0200 Subject: [PATCH 03/11] docs(javascript): consolidate Mastra into the guide, add onboarding options - 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) --- .../common/agent-tracing/mastra.mdx | 210 ------------------ .../javascript/guides/mastra/index.mdx | 68 +++++- redirects.js | 53 +++-- src/components/sidebar/platformSidebar.tsx | 40 +++- 4 files changed, 126 insertions(+), 245 deletions(-) delete mode 100644 docs/platforms/javascript/common/agent-tracing/mastra.mdx diff --git a/docs/platforms/javascript/common/agent-tracing/mastra.mdx b/docs/platforms/javascript/common/agent-tracing/mastra.mdx deleted file mode 100644 index 7433d2beadce7..0000000000000 --- a/docs/platforms/javascript/common/agent-tracing/mastra.mdx +++ /dev/null @@ -1,210 +0,0 @@ ---- -title: Mastra -sidebar_title: Mastra -description: "Learn how to export Mastra AI tracing to Sentry." -sidebar_order: 26 -supported: - - javascript.node - - javascript.eve - - javascript.mastra - - javascript.aws-lambda - - javascript.azure-functions - - javascript.connect - - javascript.express - - javascript.fastify - - javascript.gcp-functions - - javascript.hapi - - javascript.hono - - javascript.koa - - javascript.nestjs - - javascript.nextjs - - javascript.nuxt - - javascript.astro - - javascript.solidstart - - javascript.sveltekit - - javascript.remix - - javascript.tanstackstart-react ---- - -[Mastra](https://mastra.ai/) is a framework for building AI-powered applications and agents with a modern TypeScript stack. The Mastra Sentry Exporter sends tracing data to Sentry using OpenTelemetry semantic conventions, providing insights into model performance, token usage, and tool executions. - -## Prerequisites - -Before you begin, you need: - -- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/). The project's DSN tells the exporter where to send data. -- A Mastra application using `@mastra/core`. -- Node.js 22.13.0 or newer. The exporter uses `@sentry/node` internally and does not support browser or edge runtimes. - -Mastra sends agent data as traces. Keep `tracesSampleRate` above `0` to enable tracing. - -## Installation - -Install the Mastra Sentry exporter and observability packages: - -```bash {tabTitle:npm} -npm install @mastra/sentry@latest @mastra/observability@latest -``` - -```bash {tabTitle:yarn} -yarn add @mastra/sentry@latest @mastra/observability@latest -``` - -```bash {tabTitle:pnpm} -pnpm add @mastra/sentry@latest @mastra/observability@latest -``` - -You don't need to install or initialize `@sentry/node` separately for this standalone setup. The exporter includes it as a dependency and initializes it for you. - -## Configuration - -### Configure With Environment Variables - -The Sentry exporter can automatically read configuration from environment variables (`SENTRY_DSN`, `SENTRY_ENVIRONMENT`, `SENTRY_RELEASE`): - -```javascript -import { Mastra } from "@mastra/core"; -import { Observability } from "@mastra/observability"; -import { SentryExporter } from "@mastra/sentry"; - -export const mastra = new Mastra({ - observability: new Observability({ - configs: { - sentry: { - serviceName: "my-service", - exporters: [new SentryExporter()], - }, - }, - }), -}); -``` - -### Explicit Configuration - -You can also pass configuration directly: - -```javascript -import { Mastra } from "@mastra/core"; -import { Observability } from "@mastra/observability"; -import { SentryExporter } from "@mastra/sentry"; - -export const mastra = new Mastra({ - observability: new Observability({ - configs: { - sentry: { - serviceName: "my-service", - exporters: [ - new SentryExporter({ - dsn: process.env.SENTRY_DSN, - environment: "production", - tracesSampleRate: 1.0, - }), - ], - }, - }, - }), -}); -``` - - - -Mastra automatically maps its span types to Sentry operations for proper visualization in Sentry's AI monitoring dashboards: - -| Mastra Span Type | Sentry Operation | -| ---------------------- | ---------------------- | -| `AGENT_RUN` | `gen_ai.invoke_agent` | -| `MODEL_GENERATION` | `gen_ai.chat` | -| `TOOL_CALL` | `gen_ai.execute_tool` | -| `MCP_TOOL_CALL` | `gen_ai.execute_tool` | -| `WORKFLOW_RUN` | `workflow.run` | -| `WORKFLOW_STEP` | `workflow.step` | -| `WORKFLOW_CONDITIONAL` | `workflow.conditional` | -| `WORKFLOW_PARALLEL` | `workflow.parallel` | -| `WORKFLOW_LOOP` | `workflow.loop` | -| `PROCESSOR_RUN` | `ai.processor` | -| `GENERIC` | `ai.span` | - -**Note:** `MODEL_STEP` and `MODEL_CHUNK` spans are automatically skipped to simplify trace hierarchy. Their data is aggregated into parent `MODEL_GENERATION` spans. - - - - - -The Sentry exporter captures trace data using Sentry's Agent Tracing attribute names. Use these standard `gen_ai.*` fields when querying Mastra traces in Sentry: - -#### Common Attributes (All Spans) - -- `sentry.origin`: `auto.ai.mastra` (identifies spans from Mastra) -- `ai.span.type`: Mastra span type - -#### Model Generation Spans - -- `gen_ai.operation.name`: Operation name, for example `chat` -- `gen_ai.provider.name`: Model provider, for example `openai` or `anthropic` -- `gen_ai.request.model`: Requested model identifier -- `gen_ai.input.messages`: Input messages/prompts (JSON string) -- `gen_ai.response.model`: Response model -- `gen_ai.output.messages`: Output messages and tool calls (JSON string) -- `gen_ai.usage.input_tokens`: Input token count -- `gen_ai.usage.output_tokens`: Output token count -- `gen_ai.usage.total_tokens`: Total tokens used -- `gen_ai.response.streaming`: Whether streaming was used -- `gen_ai.request.temperature`: Temperature parameter -- `gen_ai.completion_start_time`: Time to first token - -#### Tool Call Spans - -- `gen_ai.operation.name`: `execute_tool` -- `gen_ai.tool.name`: Tool identifier -- `gen_ai.tool.type`: `function` -- `gen_ai.tool.call.id`: Tool call ID -- `gen_ai.tool.call.arguments`: Tool input parameters (JSON string) -- `gen_ai.tool.call.result`: Tool output result (JSON string) -- `tool.success`: Success flag - -#### Agent Run Spans - -- `gen_ai.operation.name`: `invoke_agent` -- `gen_ai.agent.name`: Agent identifier -- `gen_ai.pipeline.name`: Agent name -- `gen_ai.system_instructions`: Agent instructions/system prompt -- `gen_ai.response.model`: Model from child generation -- `gen_ai.response.text`: Output from child generation -- `gen_ai.usage.*`: Token usage aggregated from child spans - - - -## Methods - -### `exportTracingEvent()` - -Exports a tracing event to Sentry. Handles `SPAN_STARTED`, `SPAN_UPDATED`, and `SPAN_ENDED` events. - -```javascript -await exporter.exportTracingEvent(event); -``` - -### `flush()` - -Force flushes any pending spans to Sentry without shutting down the exporter. Waits up to 2 seconds for pending data to be sent. Useful in serverless environments where you need to ensure spans are exported before the runtime terminates. - -```javascript -await exporter.flush(); -``` - -### `shutdown()` - -Ends all active spans, clears internal state, and closes the Sentry connection. Waits up to 2 seconds for pending data to be sent. - -```javascript -await exporter.shutdown(); -``` - -## Learn More - -For a standalone setup walkthrough, see the [Sentry guide for Mastra](/platforms/javascript/guides/mastra/). For complete exporter documentation, see the [Mastra Sentry Exporter documentation](https://mastra.ai/integrations/observability/sentry). - -## Supported Versions - -- `@mastra/sentry`: `>=1.0.0` -- Node.js: `>=22.13.0` diff --git a/docs/platforms/javascript/guides/mastra/index.mdx b/docs/platforms/javascript/guides/mastra/index.mdx index 0556e5da35208..fe6ea0a8e3c28 100644 --- a/docs/platforms/javascript/guides/mastra/index.mdx +++ b/docs/platforms/javascript/guides/mastra/index.mdx @@ -19,31 +19,33 @@ keywords: -This guide covers the Sentry SDK-based setup, which replaces the earlier `@mastra/sentry` exporter. It requires JavaScript SDK version `11.0.0-rc.0` or later. +This guide covers the Sentry SDK-based setup, which replaces the earlier `@mastra/sentry` exporter. It requires JavaScript SDK version `11.0.0-rc.0` or later. If you previously used the `@mastra/sentry` exporter, remove it from your Mastra `exporters` — it calls `Sentry.init()` itself and conflicts with the built-in integration. -The Sentry SDK instruments Mastra on its own. Therefore, 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. - ## Prerequisites Before you begin, you need: - A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/). The project's DSN tells the SDK where to send data. - A Mastra application using `@mastra/core` version `1.63.2` or later. -- `@sentry/node` (or `@sentry/cloudflare`) version `11.0.0-rc.0` or later, and `@mastra/observability`. The SDK runs in Node.js and on Cloudflare Workers; it doesn't support browser runtimes. +- `@mastra/observability`. Sentry's Mastra integration needs it to attach to Mastra's telemetry pipeline. +- `@sentry/node` (or `@sentry/cloudflare`) version `11.0.0-rc.0` or later. The SDK runs in Node.js and on Cloudflare Workers; it doesn't support browser runtimes. - + -Don't run this setup alongside the community `@mastra/sentry` exporter. It calls `Sentry.init()` itself and exports spans in parallel, which conflicts with the built-in integration. Remove `@mastra/sentry` from your Mastra `exporters`. +## Install - +Choose the features you want to configure, and this guide will show you how: - + -## Install +Then install the Sentry Node SDK and Mastra's observability package: -Install the Sentry Node SDK and Mastra's observability package: + ```bash {tabTitle:npm} npm install @sentry/node@^11.0.0-rc.0 @mastra/observability@latest @@ -57,11 +59,29 @@ yarn add @sentry/node@^11.0.0-rc.0 @mastra/observability@latest pnpm add @sentry/node@^11.0.0-rc.0 @mastra/observability@latest ``` -Sentry's Mastra integration needs `@mastra/observability` present so it can attach its exporter to Mastra's telemetry pipeline. If Mastra can't load it, the integration warns and creates no spans. + + + + +```bash {tabTitle:npm} +npm install @sentry/node@^11.0.0-rc.0 @sentry/profiling-node@^11.0.0-rc.0 @mastra/observability@latest +``` + +```bash {tabTitle:yarn} +yarn add @sentry/node@^11.0.0-rc.0 @sentry/profiling-node@^11.0.0-rc.0 @mastra/observability@latest +``` + +```bash {tabTitle:pnpm} +pnpm add @sentry/node@^11.0.0-rc.0 @sentry/profiling-node@^11.0.0-rc.0 @mastra/observability@latest +``` + + + +If Mastra can't load `@mastra/observability`, the integration warns and creates no spans. -To run Mastra on Cloudflare Workers, use `@sentry/cloudflare` in place of `@sentry/node`. +To run Mastra on Cloudflare Workers, use `@sentry/cloudflare` in place of `@sentry/node`. Profiling (`@sentry/profiling-node`) isn't available on Workers, so the profiling option doesn't apply to this setup. Install the packages: @@ -94,9 +114,12 @@ Create an `instrument.server.ts` file next to your Worker entry (the file named ```typescript {filename:src/instrument.server.ts} export default (env: Env) => ({ dsn: "___PUBLIC_DSN___", + // ___PRODUCT_OPTION_START___ performance + // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. // We recommend adjusting this value in production. tracesSampleRate: 1.0, + // ___PRODUCT_OPTION_END___ performance }); ``` @@ -120,14 +143,35 @@ Place the file in your Mastra `public/` directory. `mastra build` copies `public ```javascript {filename:src/mastra/public/instrument.mjs} import * as Sentry from "@sentry/node"; +// ___PRODUCT_OPTION_START___ profiling +import { nodeProfilingIntegration } from "@sentry/profiling-node"; +// ___PRODUCT_OPTION_END___ profiling Sentry.init({ dsn: "___PUBLIC_DSN___", + // ___PRODUCT_OPTION_START___ profiling + + integrations: [ + // Add our Profiling integration + nodeProfilingIntegration(), + ], + // ___PRODUCT_OPTION_END___ profiling + // ___PRODUCT_OPTION_START___ performance // Set tracesSampleRate to 1.0 to capture 100% // of spans for tracing. // We recommend adjusting this value in production. + // Learn more at + // https://docs.sentry.io/platforms/javascript/guides/node/configuration/options/#tracesSampleRate tracesSampleRate: 1.0, + // ___PRODUCT_OPTION_END___ performance + // ___PRODUCT_OPTION_START___ profiling + + // Set profileSessionSampleRate to 1.0 to profile every session. + // Learn more at + // https://docs.sentry.io/platforms/javascript/configuration/options/#profileSessionSampleRate + profileSessionSampleRate: 1.0, + // ___PRODUCT_OPTION_END___ profiling }); ``` diff --git a/redirects.js b/redirects.js index d84976cee1d49..ce4a3cae7c455 100644 --- a/redirects.js +++ b/redirects.js @@ -2312,14 +2312,11 @@ const userDocsRedirects = [ // Cloudflare setup pages moved from Features to Installation Methods. { source: '/platforms/javascript/guides/cloudflare/features/vite-plugin.md', - destination: - '/platforms/javascript/guides/cloudflare/install/vite-plugin.md', + destination: '/platforms/javascript/guides/cloudflare/install/vite-plugin.md', }, { - source: - '/platforms/javascript/guides/cloudflare/features/vite-plugin/:path*', - destination: - '/platforms/javascript/guides/cloudflare/install/vite-plugin/:path*', + source: '/platforms/javascript/guides/cloudflare/features/vite-plugin/:path*', + destination: '/platforms/javascript/guides/cloudflare/install/vite-plugin/:path*', }, // Cloudflare AI pages moved from Features to Agent Tracing. { @@ -2340,56 +2337,72 @@ const userDocsRedirects = [ destination: '/platforms/javascript/guides/cloudflare/agent-tracing/workers-ai/:path*', }, - // Mastra lives under Agent Tracing alongside the other AI library pages. - // Map older names directly to avoid redirect chains. + // Mastra lifted from the Agent Tracing integration page to a standalone guide. + // Map older names directly to the guide to avoid redirect chains. + { + source: '/platforms/javascript/agent-tracing/mastra.md', + destination: '/platforms/javascript/guides/mastra/', + }, + { + source: '/platforms/javascript/agent-tracing/mastra/:path*', + destination: '/platforms/javascript/guides/mastra/', + }, + { + source: '/platforms/javascript/guides/:guide/agent-tracing/mastra.md', + destination: '/platforms/javascript/guides/mastra/', + }, + { + source: '/platforms/javascript/guides/:guide/agent-tracing/mastra/:path*', + destination: '/platforms/javascript/guides/mastra/', + }, { source: '/platforms/javascript/configuration/integrations/mastra.md', - destination: '/platforms/javascript/agent-tracing/mastra.md', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/configuration/integrations/mastra/:path*', - destination: '/platforms/javascript/agent-tracing/mastra/:path*', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/guides/:guide/configuration/integrations/mastra.md', - destination: '/platforms/javascript/guides/:guide/agent-tracing/mastra.md', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/guides/:guide/configuration/integrations/mastra/:path*', - destination: '/platforms/javascript/guides/:guide/agent-tracing/mastra/:path*', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/ai-agent-monitoring/mastra.md', - destination: '/platforms/javascript/agent-tracing/mastra.md', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/ai-agent-monitoring/mastra/:path*', - destination: '/platforms/javascript/agent-tracing/mastra/:path*', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/guides/:guide/ai-agent-monitoring/mastra.md', - destination: '/platforms/javascript/guides/:guide/agent-tracing/mastra.md', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/guides/:guide/ai-agent-monitoring/mastra/:path*', - destination: '/platforms/javascript/guides/:guide/agent-tracing/mastra/:path*', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/ai-agent-tracing/mastra.md', - destination: '/platforms/javascript/agent-tracing/mastra.md', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/ai-agent-tracing/mastra/:path*', - destination: '/platforms/javascript/agent-tracing/mastra/:path*', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/guides/:guide/ai-agent-tracing/mastra.md', - destination: '/platforms/javascript/guides/:guide/agent-tracing/mastra.md', + destination: '/platforms/javascript/guides/mastra/', }, { source: '/platforms/javascript/guides/:guide/ai-agent-tracing/mastra/:path*', - destination: '/platforms/javascript/guides/:guide/agent-tracing/mastra/:path*', + destination: '/platforms/javascript/guides/mastra/', }, // Eve lifted from the Agent Tracing integration page to a standalone guide { diff --git a/src/components/sidebar/platformSidebar.tsx b/src/components/sidebar/platformSidebar.tsx index 8f6ca1b738fd0..12c329bbb5ac0 100644 --- a/src/components/sidebar/platformSidebar.tsx +++ b/src/components/sidebar/platformSidebar.tsx @@ -23,6 +23,19 @@ const AGENT_TRACING_ALIAS_PATH_OVERRIDES: Record> const UNALIASED_AGENT_TRACING_PAGES = new Set(['manual-instrumentation']); const CLOUDFLARE_AGENT_TRACING_PAGE_SLUGS = ['agents-sdk', 'workers-ai']; +// Standalone JavaScript guides that own their Agent Tracing setup. They're +// surfaced in every JavaScript Agent Tracing sidebar as link-only entries that +// navigate to the dedicated guide instead of a page under the current guide. +const STANDALONE_AGENT_TRACING_GUIDES: { + guide: string; + sidebar_order: number; + slug: string; + title: string; +}[] = [ + {guide: 'mastra', slug: 'mastra', title: 'Mastra', sidebar_order: 26}, + {guide: 'eve', slug: 'eve', title: 'Eve', sidebar_order: 27}, +]; + export function PlatformSidebar({ rootNode, platformName, @@ -126,10 +139,31 @@ export function PlatformSidebar({ }; }).filter(alias => alias !== undefined); + // Surface the standalone Mastra and Eve guides from every JavaScript Agent + // Tracing sidebar. Their links navigate to the dedicated guide instead of + // creating an Agent Tracing page under the current guide. + const standaloneGuideAgentTracingAliases = + platformName !== 'javascript' || !agentTracingNode + ? [] + : STANDALONE_AGENT_TRACING_GUIDES.filter(({guide}) => guide !== guideName).map( + ({guide, slug, title, sidebar_order}) => ({ + context: { + platform: {platformName}, + title, + sidebar_order, + href: `/platforms/javascript/guides/${guide}/`, + }, + path: `/${pathRoot}/agent-tracing/${slug}/`, + }) + ); + const tree = toTree( - [...nodes, ...agentTracingAliases, ...cloudflareAgentTracingAliases].filter( - n => !!n.context - ) + [ + ...nodes, + ...agentTracingAliases, + ...cloudflareAgentTracingAliases, + ...standaloneGuideAgentTracingAliases, + ].filter(n => !!n.context) ); // Use "Getting Started" for Next.js, default title for other platforms From 710e8ab84bf579fb694b9d5e84fefe9f6398010c Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 18 Sep 2026 09:17:42 +0200 Subject: [PATCH 04/11] docs(javascript): restore separate Cloudflare Quick Start page for Mastra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../guides/mastra/cloudflare/index.mdx | 79 +++++++++++++++++++ .../javascript/guides/mastra/index.mdx | 66 ++-------------- 2 files changed, 86 insertions(+), 59 deletions(-) create mode 100644 docs/platforms/javascript/guides/mastra/cloudflare/index.mdx diff --git a/docs/platforms/javascript/guides/mastra/cloudflare/index.mdx b/docs/platforms/javascript/guides/mastra/cloudflare/index.mdx new file mode 100644 index 0000000000000..1dd86a057c6d0 --- /dev/null +++ b/docs/platforms/javascript/guides/mastra/cloudflare/index.mdx @@ -0,0 +1,79 @@ +--- +title: Cloudflare Quick Start +sidebar_order: 0.5 +description: Learn how to send Mastra agent traces, model calls, tool executions, and errors to Sentry from Cloudflare Workers. +--- + +Use this setup when your Mastra application runs on Cloudflare Workers. The Sentry Vite plugin wraps your Worker entry at build time and initializes the SDK before Mastra loads. + +Before you begin, you need `@mastra/core` version `1.63.2` or later. + + + +## Install + +Install the Sentry Cloudflare SDK and Mastra's observability package: + +```bash {tabTitle:npm} +npm install @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest +``` + +```bash {tabTitle:yarn} +yarn add @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest +``` + +```bash {tabTitle:pnpm} +pnpm add @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest +``` + +Sentry's Mastra integration needs `@mastra/observability` so it can attach its exporter to Mastra's telemetry pipeline. If Mastra can't load it, the integration warns and creates no spans. + +## Configure + +Add the Sentry Vite plugin to your Vite config. It wraps your Worker entry with Sentry at build time: + +```typescript {filename:vite.config.mts} +import { cloudflare } from "@cloudflare/vite-plugin"; +import { sentryCloudflareVitePlugin } from "@sentry/cloudflare/vite"; +import { defineConfig } from "vite"; + +export default defineConfig({ + plugins: [cloudflare(), sentryCloudflareVitePlugin()], +}); +``` + +Create an `instrument.server.ts` file next to your Worker entry (the file named in Wrangler's `main`). The plugin picks it up by convention and uses its default export as the Sentry options: + +```typescript {filename:src/instrument.server.ts} +export default (env: Env) => ({ + dsn: "___PUBLIC_DSN___", + // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. + // We recommend adjusting this value in production. + tracesSampleRate: 1.0, +}); +``` + +Enable Node.js compatibility in `wrangler.toml` so Mastra and the SDK can run on Workers: + +```toml {filename:wrangler.toml} +main = "src/index.ts" +compatibility_date = "2026-04-26" +compatibility_flags = ["nodejs_compat"] +``` + +With the plugin in place, `Sentry.init()` runs automatically. You don't need to add an instrument file or `--import` flag as you do for Node.js. + +## Verify + +Run one of your Mastra agents, then open [Agent Tracing](/product/agents/) in Sentry and select the run. The timeline shows the model generations, tool calls, token usage, and latency for that run, plus any errors your agent threw. + +If no data appears, confirm that: + +- The `dsn` belongs to the Sentry project you're viewing. +- `tracesSampleRate` is greater than `0`. +- `@mastra/observability` is installed. +- Your application completed at least one agent run after you added the setup. + + + +For privacy controls, conversation linking, and supported versions, return to the [default Mastra Quick Start](../). diff --git a/docs/platforms/javascript/guides/mastra/index.mdx b/docs/platforms/javascript/guides/mastra/index.mdx index fe6ea0a8e3c28..6fe45573b0bcd 100644 --- a/docs/platforms/javascript/guides/mastra/index.mdx +++ b/docs/platforms/javascript/guides/mastra/index.mdx @@ -23,6 +23,8 @@ This guide covers the Sentry SDK-based setup, which replaces the earlier `@mastr +Running Mastra on Cloudflare Workers? Follow the [Cloudflare Quick Start](./cloudflare/) instead. + ## Prerequisites Before you begin, you need: @@ -30,7 +32,7 @@ Before you begin, you need: - A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/). The project's DSN tells the SDK where to send data. - A Mastra application using `@mastra/core` version `1.63.2` or later. - `@mastra/observability`. Sentry's Mastra integration needs it to attach to Mastra's telemetry pipeline. -- `@sentry/node` (or `@sentry/cloudflare`) version `11.0.0-rc.0` or later. The SDK runs in Node.js and on Cloudflare Workers; it doesn't support browser runtimes. +- `@sentry/node` version `11.0.0-rc.0` or later. The SDK runs in Node.js; it doesn't support browser runtimes. @@ -79,67 +81,11 @@ pnpm add @sentry/node@^11.0.0-rc.0 @sentry/profiling-node@^11.0.0-rc.0 @mastra/o If Mastra can't load `@mastra/observability`, the integration warns and creates no spans. - - -To run Mastra on Cloudflare Workers, use `@sentry/cloudflare` in place of `@sentry/node`. Profiling (`@sentry/profiling-node`) isn't available on Workers, so the profiling option doesn't apply to this setup. - -Install the packages: - -```bash {tabTitle:npm} -npm install @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest -``` - -```bash {tabTitle:yarn} -yarn add @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest -``` - -Add the Sentry Vite plugin to your Vite config. It wraps your Worker entry with Sentry at build time: - -```typescript {filename:vite.config.mts} -import { cloudflare } from "@cloudflare/vite-plugin"; -import { sentryCloudflareVitePlugin } from "@sentry/cloudflare/vite"; -import { defineConfig } from "vite"; - -export default defineConfig({ - plugins: [cloudflare(), sentryCloudflareVitePlugin()], -}); -``` - -Create an `instrument.server.ts` file next to your Worker entry (the file named in wrangler's `main`). The plugin picks it up by convention and uses its default export as the Sentry options: - -```typescript {filename:src/instrument.server.ts} -export default (env: Env) => ({ - dsn: "___PUBLIC_DSN___", - // ___PRODUCT_OPTION_START___ performance - - // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. - // We recommend adjusting this value in production. - tracesSampleRate: 1.0, - // ___PRODUCT_OPTION_END___ performance -}); -``` - -Enable Node.js compatibility in your `wrangler.toml` so Mastra and the SDK can run on Workers: - -```toml {filename:wrangler.toml} -main = "src/index.ts" -compatibility_date = "2026-04-26" -compatibility_flags = ["nodejs_compat"] -``` - -With the plugin in place, `Sentry.init()` runs automatically — you don't add an instrument file or `--import` flag as you do for Node. Continue to [Verify](#verify). - - - ## Configure Create an instrument file that calls `Sentry.init()`, and preload it so Sentry starts before Mastra and the AI SDK load. -Place the file in your Mastra `public/` directory. `mastra build` copies `public/` into the build output, so the file lands next to the compiled server as `instrument.mjs`, where `--import=./instrument.mjs` can resolve it: +Place the file in your Mastra `public/` directory. `mastra build` and `mastra dev` copy `public/` into the build output, so the file lands next to the compiled server as `instrument.mjs`, where `--import=./instrument.mjs` can resolve it: ```javascript {filename:src/mastra/public/instrument.mjs} import * as Sentry from "@sentry/node"; @@ -218,7 +164,9 @@ Sentry.init({ ## Link Conversations -To group a multi-turn chat into a single [Conversation](/product/agents/conversations/) in the Agents dashboards, pass a stable thread id when you call an agent. Mastra maps the memory thread id to `gen_ai.conversation.id`, so every run that shares a thread id groups into one conversation: +Sentry groups a multi-turn chat into a single [Conversation](/product/agents/conversations/) automatically — there's no Sentry-specific setup. Mastra maps its memory thread id to `gen_ai.conversation.id`, so agent runs that share a thread id group into one conversation. + +Threads come from Mastra's own memory feature. If your app already passes a thread when it calls an agent — as multi-turn chat apps do — Sentry picks it up as the conversation id with no extra work: ```typescript const result = await agent.generate(message, { From b6e4533cea9c656a7c8bb90e15f68cae4737cd91 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 18 Sep 2026 09:36:14 +0200 Subject: [PATCH 05/11] some fixes --- docs/platforms/javascript/guides/mastra/index.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/guides/mastra/index.mdx b/docs/platforms/javascript/guides/mastra/index.mdx index 6fe45573b0bcd..2decb2a8c3c98 100644 --- a/docs/platforms/javascript/guides/mastra/index.mdx +++ b/docs/platforms/javascript/guides/mastra/index.mdx @@ -32,7 +32,7 @@ Before you begin, you need: - A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/). The project's DSN tells the SDK where to send data. - A Mastra application using `@mastra/core` version `1.63.2` or later. - `@mastra/observability`. Sentry's Mastra integration needs it to attach to Mastra's telemetry pipeline. -- `@sentry/node` version `11.0.0-rc.0` or later. The SDK runs in Node.js; it doesn't support browser runtimes. +- `@sentry/node` version `11.0.0-rc.0` or later, or [`@sentry/cloudflare@^11.0.0-rc.0` when running on Cloudflare](./cloudflare). Browser runtimes are not supported. @@ -151,7 +151,7 @@ If no data appears, confirm that: ## 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`: +The SDK will record generative AI inputs and outputs (the prompts your agent sends and the model responses it receives) by default. To turn recording off, set `genAI.inputs` and `genAI.outputs` to `false` in `dataCollection`: ```javascript {filename:src/mastra/public/instrument.mjs} Sentry.init({ @@ -162,6 +162,8 @@ Sentry.init({ }); ``` +See [`dataCollection` documentation](./configuration/options/#dataCollection) for details on privacy control options. + ## Link Conversations Sentry groups a multi-turn chat into a single [Conversation](/product/agents/conversations/) automatically — there's no Sentry-specific setup. Mastra maps its memory thread id to `gen_ai.conversation.id`, so agent runs that share a thread id group into one conversation. From 52fda6868c3afea5cf2a5f5774bcd646424e7c95 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 18 Sep 2026 09:42:56 +0200 Subject: [PATCH 06/11] docs(javascript): reorganize Mastra guide; align Cloudflare Quick Start - 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) --- .../guides/mastra/cloudflare/index.mdx | 109 ++++++++++++++++-- .../javascript/guides/mastra/index.mdx | 32 ++--- 2 files changed, 116 insertions(+), 25 deletions(-) diff --git a/docs/platforms/javascript/guides/mastra/cloudflare/index.mdx b/docs/platforms/javascript/guides/mastra/cloudflare/index.mdx index 1dd86a057c6d0..c4f4ddaf631ba 100644 --- a/docs/platforms/javascript/guides/mastra/cloudflare/index.mdx +++ b/docs/platforms/javascript/guides/mastra/cloudflare/index.mdx @@ -4,15 +4,37 @@ sidebar_order: 0.5 description: Learn how to send Mastra agent traces, model calls, tool executions, and errors to Sentry from Cloudflare Workers. --- -Use this setup when your Mastra application runs on Cloudflare Workers. The Sentry Vite plugin wraps your Worker entry at build time and initializes the SDK before Mastra loads. +[Mastra](https://mastra.ai/) is a TypeScript framework for building AI applications and agents. This guide sets up the Sentry SDK in a Mastra app running on Cloudflare Workers so agent runs, model generations, tool calls, workflows, and errors flow into [Sentry Agent Tracing](/product/agents/). -Before you begin, you need `@mastra/core` version `1.63.2` or later. + + +This guide covers the Sentry SDK-based setup, which replaces the earlier `@mastra/sentry` exporter. It requires JavaScript SDK version `11.0.0-rc.0` or later. If you previously used the `@mastra/sentry` exporter, remove it from your Mastra `exporters` — it calls `Sentry.init()` itself and conflicts with the built-in integration. + + + +Running Mastra on Node.js? Follow the [Mastra Quick Start](../) instead. + +## Prerequisites + +Before you begin, you need: + +- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/). The project's DSN tells the SDK where to send data. +- A Mastra application using `@mastra/core` version `1.63.2` or later. +- `@mastra/observability`. Sentry's Mastra integration needs it to attach to Mastra's telemetry pipeline. +- `@sentry/cloudflare` version `11.0.0-rc.0` or later. ## Install -Install the Sentry Cloudflare SDK and Mastra's observability package: +Choose the features you want to configure, and this guide will show you how: + + + +Then install the Sentry Cloudflare SDK and Mastra's observability package: ```bash {tabTitle:npm} npm install @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest @@ -26,7 +48,7 @@ yarn add @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest pnpm add @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest ``` -Sentry's Mastra integration needs `@mastra/observability` so it can attach its exporter to Mastra's telemetry pipeline. If Mastra can't load it, the integration warns and creates no spans. +If Mastra can't load `@mastra/observability`, the integration warns and creates no spans. ## Configure @@ -47,13 +69,17 @@ Create an `instrument.server.ts` file next to your Worker entry (the file named ```typescript {filename:src/instrument.server.ts} export default (env: Env) => ({ dsn: "___PUBLIC_DSN___", - // Set tracesSampleRate to 1.0 to capture 100% of spans for tracing. + // ___PRODUCT_OPTION_START___ performance + + // Set tracesSampleRate to 1.0 to capture 100% + // of spans for tracing. // We recommend adjusting this value in production. tracesSampleRate: 1.0, + // ___PRODUCT_OPTION_END___ performance }); ``` -Enable Node.js compatibility in `wrangler.toml` so Mastra and the SDK can run on Workers: +Enable Node.js compatibility in your `wrangler.toml` so Mastra and the SDK can run on Workers: ```toml {filename:wrangler.toml} main = "src/index.ts" @@ -61,7 +87,43 @@ compatibility_date = "2026-04-26" compatibility_flags = ["nodejs_compat"] ``` -With the plugin in place, `Sentry.init()` runs automatically. You don't need to add an instrument file or `--import` flag as you do for Node.js. +With the plugin in place, `Sentry.init()` runs automatically — you don't add an instrument file or `--import` flag as you do for Node.js. + +With this setup, Sentry captures errors thrown by your agents and AI spans for every run (agent runs, model generations, tool calls, workflows, token usage, and latency) along with outgoing HTTP and `fetch` requests. Prompts and model outputs are recorded on your AI spans by default. + +To review what's captured and turn recording of prompts and responses off, see [Privacy Controls](#privacy-controls) below. + +### Privacy Controls + +The SDK will record generative AI inputs and outputs (the prompts your agent sends and the model responses it receives) by default. To turn recording off, set `genAI.inputs` and `genAI.outputs` to `false` in `dataCollection`: + +```typescript {filename:src/instrument.server.ts} +export default (env: Env) => ({ + dsn: "___PUBLIC_DSN___", + dataCollection: { + genAI: { inputs: false, outputs: false }, + }, +}); +``` + +See [`dataCollection` documentation](../configuration/options/#dataCollection) for details on privacy control options. + +### Link Conversations + +Sentry groups a multi-turn chat into a single [Conversation](/product/agents/conversations/) automatically — there's no Sentry-specific setup. Mastra maps its memory thread id to `gen_ai.conversation.id`, so agent runs that share a thread id group into one conversation. + +Threads come from Mastra's own memory feature. If your app already passes a thread when it calls an agent — as multi-turn chat apps do — Sentry picks it up as the conversation id with no extra work: + +```typescript +const result = await agent.generate(message, { + memory: { + thread: "session-123", + resource: "user-456", + }, +}); +``` + +Your agent needs a storage provider configured before Mastra accepts the `memory` option. Reuse the same thread id across the messages in a session. ## Verify @@ -71,9 +133,38 @@ If no data appears, confirm that: - The `dsn` belongs to the Sentry project you're viewing. - `tracesSampleRate` is greater than `0`. -- `@mastra/observability` is installed. +- `@mastra/observability` is installed, so the integration can attach to Mastra's telemetry. - Your application completed at least one agent run after you added the setup. -For privacy controls, conversation linking, and supported versions, return to the [default Mastra Quick Start](../). +## Next Steps + +- [Name your agents](/product/agents/naming/) so you can identify them in the Agents Dashboard. +- [Track AI agent spend with dashboards and alerts](https://sentry.io/cookbook/monitor-ai-agent-spend-with-dashboards-and-alerts/): build a dashboard for cost, tokens, models, and conversations. +- Use the appropriate [JavaScript framework guide](/platforms/javascript/) for application monitoring in a separate frontend or service. + + + +Sentry's Mastra integration maps Mastra's span types to Sentry operations for the Agents dashboards: + +| Mastra Span Type | Sentry Operation | +| -------------------- | --------------------- | +| `AGENT_RUN` | `gen_ai.invoke_agent` | +| `WORKFLOW_RUN` | `gen_ai.invoke_agent` | +| `MODEL_GENERATION` | `gen_ai.chat` | +| `TOOL_CALL` | `gen_ai.execute_tool` | +| `MCP_TOOL_CALL` | `gen_ai.execute_tool` | +| `PROVIDER_TOOL_CALL` | `gen_ai.execute_tool` | +| `CLIENT_TOOL_CALL` | `gen_ai.execute_tool` | +| `RAG_EMBEDDING` | `gen_ai.embeddings` | + +Spans are tagged with `sentry.origin: auto.ai.mastra`. + + + +## Supported Versions + +- `@sentry/cloudflare`: `>=11.0.0-rc.0` +- `@mastra/core`: `>=1.63.2` +- `@mastra/observability`: required for the integration to create spans diff --git a/docs/platforms/javascript/guides/mastra/index.mdx b/docs/platforms/javascript/guides/mastra/index.mdx index 2decb2a8c3c98..aa6f10a2d9759 100644 --- a/docs/platforms/javascript/guides/mastra/index.mdx +++ b/docs/platforms/javascript/guides/mastra/index.mdx @@ -134,22 +134,9 @@ Preload the instrument file when you start Mastra by passing it through `--custo With this setup, Sentry captures errors thrown by your agents and AI spans for every run (agent runs, model generations, tool calls, workflows, token usage, and latency) along with outgoing HTTP and `fetch` requests. Prompts and model outputs are recorded on your AI spans by default. -To review what's captured and turn recording of prompts and responses off, see [Privacy Controls](#privacy-controls). +To review what's captured and turn recording of prompts and responses off, see [Privacy Controls](#privacy-controls) below. -## Verify - -Run one of your Mastra agents, then open [Agent Tracing](/product/agents/) in Sentry and select the run. The timeline shows the model generations, tool calls, token usage, and latency for that run, plus any errors your agent threw. - -If no data appears, confirm that: - -- The `dsn` belongs to the Sentry project you're viewing. -- `tracesSampleRate` is greater than `0`. -- `@mastra/observability` is installed, so the integration can attach to Mastra's telemetry. -- Your application completed at least one agent run after you added the setup. - - - -## Privacy Controls +### Privacy Controls The SDK will record generative AI inputs and outputs (the prompts your agent sends and the model responses it receives) by default. To turn recording off, set `genAI.inputs` and `genAI.outputs` to `false` in `dataCollection`: @@ -164,7 +151,7 @@ Sentry.init({ See [`dataCollection` documentation](./configuration/options/#dataCollection) for details on privacy control options. -## Link Conversations +### Link Conversations Sentry groups a multi-turn chat into a single [Conversation](/product/agents/conversations/) automatically — there's no Sentry-specific setup. Mastra maps its memory thread id to `gen_ai.conversation.id`, so agent runs that share a thread id group into one conversation. @@ -181,6 +168,19 @@ const result = await agent.generate(message, { Your agent needs a storage provider configured before Mastra accepts the `memory` option. Reuse the same thread id across the messages in a session. +## Verify + +Run one of your Mastra agents, then open [Agent Tracing](/product/agents/) in Sentry and select the run. The timeline shows the model generations, tool calls, token usage, and latency for that run, plus any errors your agent threw. + +If no data appears, confirm that: + +- The `dsn` belongs to the Sentry project you're viewing. +- `tracesSampleRate` is greater than `0`. +- `@mastra/observability` is installed, so the integration can attach to Mastra's telemetry. +- Your application completed at least one agent run after you added the setup. + + + ## Next Steps - [Name your agents](/product/agents/naming/) so you can identify them in the Agents Dashboard. From dcd27cfd616a9cf6f1ce891aa7aca5ef07f6d1cd Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 18 Sep 2026 09:51:02 +0200 Subject: [PATCH 07/11] update --- .../guides/mastra/{cloudflare/index.mdx => cloudflare.mdx} | 2 +- docs/platforms/javascript/guides/mastra/index.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename docs/platforms/javascript/guides/mastra/{cloudflare/index.mdx => cloudflare.mdx} (98%) diff --git a/docs/platforms/javascript/guides/mastra/cloudflare/index.mdx b/docs/platforms/javascript/guides/mastra/cloudflare.mdx similarity index 98% rename from docs/platforms/javascript/guides/mastra/cloudflare/index.mdx rename to docs/platforms/javascript/guides/mastra/cloudflare.mdx index c4f4ddaf631ba..5711eaa2aa17d 100644 --- a/docs/platforms/javascript/guides/mastra/cloudflare/index.mdx +++ b/docs/platforms/javascript/guides/mastra/cloudflare.mdx @@ -34,7 +34,7 @@ Choose the features you want to configure, and this guide will show you how: defaults={["performance"]} /> -Then install the Sentry Cloudflare SDK and Mastra's observability package: +Install the Sentry Cloudflare SDK and Mastra's observability package: ```bash {tabTitle:npm} npm install @sentry/cloudflare@^11.0.0-rc.0 @mastra/observability@latest diff --git a/docs/platforms/javascript/guides/mastra/index.mdx b/docs/platforms/javascript/guides/mastra/index.mdx index aa6f10a2d9759..a30d02fc8ea28 100644 --- a/docs/platforms/javascript/guides/mastra/index.mdx +++ b/docs/platforms/javascript/guides/mastra/index.mdx @@ -45,7 +45,7 @@ Choose the features you want to configure, and this guide will show you how: defaults={["performance"]} /> -Then install the Sentry Node SDK and Mastra's observability package: +Install the Sentry Node SDK and Mastra's observability package: From 1911dc61c9da9652845e8d134c40a5cb2d51e577 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 18 Sep 2026 09:58:29 +0200 Subject: [PATCH 08/11] docs(javascript): extract shared Mastra content into includes 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) --- .../javascript/guides/mastra/cloudflare.mdx | 63 ++----------------- .../javascript/guides/mastra/index.mdx | 63 ++----------------- includes/mastra/captured-summary.mdx | 3 + includes/mastra/link-conversations.mdx | 16 +++++ includes/mastra/next-steps.mdx | 5 ++ includes/mastra/sdk-setup-alert.mdx | 5 ++ includes/mastra/verify.mdx | 10 +++ includes/mastra/what-gets-captured.mdx | 18 ++++++ 8 files changed, 69 insertions(+), 114 deletions(-) create mode 100644 includes/mastra/captured-summary.mdx create mode 100644 includes/mastra/link-conversations.mdx create mode 100644 includes/mastra/next-steps.mdx create mode 100644 includes/mastra/sdk-setup-alert.mdx create mode 100644 includes/mastra/verify.mdx create mode 100644 includes/mastra/what-gets-captured.mdx diff --git a/docs/platforms/javascript/guides/mastra/cloudflare.mdx b/docs/platforms/javascript/guides/mastra/cloudflare.mdx index 5711eaa2aa17d..4ef25a0cc8bc7 100644 --- a/docs/platforms/javascript/guides/mastra/cloudflare.mdx +++ b/docs/platforms/javascript/guides/mastra/cloudflare.mdx @@ -6,11 +6,7 @@ description: Learn how to send Mastra agent traces, model calls, tool executions [Mastra](https://mastra.ai/) is a TypeScript framework for building AI applications and agents. This guide sets up the Sentry SDK in a Mastra app running on Cloudflare Workers so agent runs, model generations, tool calls, workflows, and errors flow into [Sentry Agent Tracing](/product/agents/). - - -This guide covers the Sentry SDK-based setup, which replaces the earlier `@mastra/sentry` exporter. It requires JavaScript SDK version `11.0.0-rc.0` or later. If you previously used the `@mastra/sentry` exporter, remove it from your Mastra `exporters` — it calls `Sentry.init()` itself and conflicts with the built-in integration. - - + Running Mastra on Node.js? Follow the [Mastra Quick Start](../) instead. @@ -89,9 +85,7 @@ compatibility_flags = ["nodejs_compat"] With the plugin in place, `Sentry.init()` runs automatically — you don't add an instrument file or `--import` flag as you do for Node.js. -With this setup, Sentry captures errors thrown by your agents and AI spans for every run (agent runs, model generations, tool calls, workflows, token usage, and latency) along with outgoing HTTP and `fetch` requests. Prompts and model outputs are recorded on your AI spans by default. - -To review what's captured and turn recording of prompts and responses off, see [Privacy Controls](#privacy-controls) below. + ### Privacy Controls @@ -108,60 +102,15 @@ export default (env: Env) => ({ See [`dataCollection` documentation](../configuration/options/#dataCollection) for details on privacy control options. -### Link Conversations - -Sentry groups a multi-turn chat into a single [Conversation](/product/agents/conversations/) automatically — there's no Sentry-specific setup. Mastra maps its memory thread id to `gen_ai.conversation.id`, so agent runs that share a thread id group into one conversation. - -Threads come from Mastra's own memory feature. If your app already passes a thread when it calls an agent — as multi-turn chat apps do — Sentry picks it up as the conversation id with no extra work: - -```typescript -const result = await agent.generate(message, { - memory: { - thread: "session-123", - resource: "user-456", - }, -}); -``` - -Your agent needs a storage provider configured before Mastra accepts the `memory` option. Reuse the same thread id across the messages in a session. - -## Verify - -Run one of your Mastra agents, then open [Agent Tracing](/product/agents/) in Sentry and select the run. The timeline shows the model generations, tool calls, token usage, and latency for that run, plus any errors your agent threw. + -If no data appears, confirm that: - -- The `dsn` belongs to the Sentry project you're viewing. -- `tracesSampleRate` is greater than `0`. -- `@mastra/observability` is installed, so the integration can attach to Mastra's telemetry. -- Your application completed at least one agent run after you added the setup. + -## Next Steps - -- [Name your agents](/product/agents/naming/) so you can identify them in the Agents Dashboard. -- [Track AI agent spend with dashboards and alerts](https://sentry.io/cookbook/monitor-ai-agent-spend-with-dashboards-and-alerts/): build a dashboard for cost, tokens, models, and conversations. -- Use the appropriate [JavaScript framework guide](/platforms/javascript/) for application monitoring in a separate frontend or service. - - - -Sentry's Mastra integration maps Mastra's span types to Sentry operations for the Agents dashboards: - -| Mastra Span Type | Sentry Operation | -| -------------------- | --------------------- | -| `AGENT_RUN` | `gen_ai.invoke_agent` | -| `WORKFLOW_RUN` | `gen_ai.invoke_agent` | -| `MODEL_GENERATION` | `gen_ai.chat` | -| `TOOL_CALL` | `gen_ai.execute_tool` | -| `MCP_TOOL_CALL` | `gen_ai.execute_tool` | -| `PROVIDER_TOOL_CALL` | `gen_ai.execute_tool` | -| `CLIENT_TOOL_CALL` | `gen_ai.execute_tool` | -| `RAG_EMBEDDING` | `gen_ai.embeddings` | - -Spans are tagged with `sentry.origin: auto.ai.mastra`. + - + ## Supported Versions diff --git a/docs/platforms/javascript/guides/mastra/index.mdx b/docs/platforms/javascript/guides/mastra/index.mdx index a30d02fc8ea28..1a221d917d186 100644 --- a/docs/platforms/javascript/guides/mastra/index.mdx +++ b/docs/platforms/javascript/guides/mastra/index.mdx @@ -17,11 +17,7 @@ keywords: [Mastra](https://mastra.ai/) is a TypeScript framework for building AI applications and agents. This guide sets up the Sentry SDK in a Mastra app so agent runs, model generations, tool calls, workflows, and errors flow into [Sentry Agent Tracing](/product/agents/). - - -This guide covers the Sentry SDK-based setup, which replaces the earlier `@mastra/sentry` exporter. It requires JavaScript SDK version `11.0.0-rc.0` or later. If you previously used the `@mastra/sentry` exporter, remove it from your Mastra `exporters` — it calls `Sentry.init()` itself and conflicts with the built-in integration. - - + Running Mastra on Cloudflare Workers? Follow the [Cloudflare Quick Start](./cloudflare/) instead. @@ -132,9 +128,7 @@ Preload the instrument file when you start Mastra by passing it through `--custo } ``` -With this setup, Sentry captures errors thrown by your agents and AI spans for every run (agent runs, model generations, tool calls, workflows, token usage, and latency) along with outgoing HTTP and `fetch` requests. Prompts and model outputs are recorded on your AI spans by default. - -To review what's captured and turn recording of prompts and responses off, see [Privacy Controls](#privacy-controls) below. + ### Privacy Controls @@ -151,60 +145,15 @@ Sentry.init({ See [`dataCollection` documentation](./configuration/options/#dataCollection) for details on privacy control options. -### Link Conversations - -Sentry groups a multi-turn chat into a single [Conversation](/product/agents/conversations/) automatically — there's no Sentry-specific setup. Mastra maps its memory thread id to `gen_ai.conversation.id`, so agent runs that share a thread id group into one conversation. - -Threads come from Mastra's own memory feature. If your app already passes a thread when it calls an agent — as multi-turn chat apps do — Sentry picks it up as the conversation id with no extra work: - -```typescript -const result = await agent.generate(message, { - memory: { - thread: "session-123", - resource: "user-456", - }, -}); -``` - -Your agent needs a storage provider configured before Mastra accepts the `memory` option. Reuse the same thread id across the messages in a session. - -## Verify - -Run one of your Mastra agents, then open [Agent Tracing](/product/agents/) in Sentry and select the run. The timeline shows the model generations, tool calls, token usage, and latency for that run, plus any errors your agent threw. + -If no data appears, confirm that: - -- The `dsn` belongs to the Sentry project you're viewing. -- `tracesSampleRate` is greater than `0`. -- `@mastra/observability` is installed, so the integration can attach to Mastra's telemetry. -- Your application completed at least one agent run after you added the setup. + -## Next Steps - -- [Name your agents](/product/agents/naming/) so you can identify them in the Agents Dashboard. -- [Track AI agent spend with dashboards and alerts](https://sentry.io/cookbook/monitor-ai-agent-spend-with-dashboards-and-alerts/): build a dashboard for cost, tokens, models, and conversations. -- Use the appropriate [JavaScript framework guide](/platforms/javascript/) for application monitoring in a separate frontend or service. - - - -Sentry's Mastra integration maps Mastra's span types to Sentry operations for the Agents dashboards: - -| Mastra Span Type | Sentry Operation | -| -------------------- | --------------------- | -| `AGENT_RUN` | `gen_ai.invoke_agent` | -| `WORKFLOW_RUN` | `gen_ai.invoke_agent` | -| `MODEL_GENERATION` | `gen_ai.chat` | -| `TOOL_CALL` | `gen_ai.execute_tool` | -| `MCP_TOOL_CALL` | `gen_ai.execute_tool` | -| `PROVIDER_TOOL_CALL` | `gen_ai.execute_tool` | -| `CLIENT_TOOL_CALL` | `gen_ai.execute_tool` | -| `RAG_EMBEDDING` | `gen_ai.embeddings` | - -Spans are tagged with `sentry.origin: auto.ai.mastra`. + - + ## Supported Versions diff --git a/includes/mastra/captured-summary.mdx b/includes/mastra/captured-summary.mdx new file mode 100644 index 0000000000000..653845bed99ed --- /dev/null +++ b/includes/mastra/captured-summary.mdx @@ -0,0 +1,3 @@ +With this setup, Sentry captures errors thrown by your agents and AI spans for every run (agent runs, model generations, tool calls, workflows, token usage, and latency) along with outgoing HTTP and `fetch` requests. Prompts and model outputs are recorded on your AI spans by default. + +To review what's captured and turn recording of prompts and responses off, see [Privacy Controls](#privacy-controls) below. diff --git a/includes/mastra/link-conversations.mdx b/includes/mastra/link-conversations.mdx new file mode 100644 index 0000000000000..9161ecbf0a182 --- /dev/null +++ b/includes/mastra/link-conversations.mdx @@ -0,0 +1,16 @@ +### Link Conversations + +Sentry groups a multi-turn chat into a single [Conversation](/product/agents/conversations/) automatically — there's no Sentry-specific setup. Mastra maps its memory thread id to `gen_ai.conversation.id`, so agent runs that share a thread id group into one conversation. + +Threads come from Mastra's own memory feature. If your app already passes a thread when it calls an agent — as multi-turn chat apps do — Sentry picks it up as the conversation id with no extra work: + +```typescript +const result = await agent.generate(message, { + memory: { + thread: "session-123", + resource: "user-456", + }, +}); +``` + +Your agent needs a storage provider configured before Mastra accepts the `memory` option. Reuse the same thread id across the messages in a session. diff --git a/includes/mastra/next-steps.mdx b/includes/mastra/next-steps.mdx new file mode 100644 index 0000000000000..d464558613e6b --- /dev/null +++ b/includes/mastra/next-steps.mdx @@ -0,0 +1,5 @@ +## Next Steps + +- [Name your agents](/product/agents/naming/) so you can identify them in the Agents Dashboard. +- [Track AI agent spend with dashboards and alerts](https://sentry.io/cookbook/monitor-ai-agent-spend-with-dashboards-and-alerts/): build a dashboard for cost, tokens, models, and conversations. +- Use the appropriate [JavaScript framework guide](/platforms/javascript/) for application monitoring in a separate frontend or service. diff --git a/includes/mastra/sdk-setup-alert.mdx b/includes/mastra/sdk-setup-alert.mdx new file mode 100644 index 0000000000000..b4c80d2fe94c0 --- /dev/null +++ b/includes/mastra/sdk-setup-alert.mdx @@ -0,0 +1,5 @@ + + +This guide covers the Sentry SDK-based setup, which replaces the earlier `@mastra/sentry` exporter. It requires JavaScript SDK version `11.0.0-rc.0` or later. If you previously used the `@mastra/sentry` exporter, remove it from your Mastra `exporters` — it calls `Sentry.init()` itself and conflicts with the built-in integration. + + diff --git a/includes/mastra/verify.mdx b/includes/mastra/verify.mdx new file mode 100644 index 0000000000000..190a1b6683dd5 --- /dev/null +++ b/includes/mastra/verify.mdx @@ -0,0 +1,10 @@ +## Verify + +Run one of your Mastra agents, then open [Agent Tracing](/product/agents/) in Sentry and select the run. The timeline shows the model generations, tool calls, token usage, and latency for that run, plus any errors your agent threw. + +If no data appears, confirm that: + +- The `dsn` belongs to the Sentry project you're viewing. +- `tracesSampleRate` is greater than `0`. +- `@mastra/observability` is installed, so the integration can attach to Mastra's telemetry. +- Your application completed at least one agent run after you added the setup. diff --git a/includes/mastra/what-gets-captured.mdx b/includes/mastra/what-gets-captured.mdx new file mode 100644 index 0000000000000..4e1440f1d54d9 --- /dev/null +++ b/includes/mastra/what-gets-captured.mdx @@ -0,0 +1,18 @@ + + +Sentry's Mastra integration maps Mastra's span types to Sentry operations for the Agents dashboards: + +| Mastra Span Type | Sentry Operation | +| -------------------- | --------------------- | +| `AGENT_RUN` | `gen_ai.invoke_agent` | +| `WORKFLOW_RUN` | `gen_ai.invoke_agent` | +| `MODEL_GENERATION` | `gen_ai.chat` | +| `TOOL_CALL` | `gen_ai.execute_tool` | +| `MCP_TOOL_CALL` | `gen_ai.execute_tool` | +| `PROVIDER_TOOL_CALL` | `gen_ai.execute_tool` | +| `CLIENT_TOOL_CALL` | `gen_ai.execute_tool` | +| `RAG_EMBEDDING` | `gen_ai.embeddings` | + +Spans are tagged with `sentry.origin: auto.ai.mastra`. + + From 1b9f5b25fa448a610cf125dd47e78fc9e4239e6b Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 18 Sep 2026 10:08:10 +0200 Subject: [PATCH 09/11] docs(javascript): drop javascript.mastra from agent-tracing pages 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) --- .../javascript/common/agent-tracing/anthropic.mdx | 11 +++++------ .../javascript/common/agent-tracing/flue.mdx | 7 +++---- .../common/agent-tracing/google-genai.mdx | 11 +++++------ .../javascript/common/agent-tracing/langchain.mdx | 11 +++++------ .../javascript/common/agent-tracing/langgraph.mdx | 11 +++++------ .../common/agent-tracing/manual-instrumentation.mdx | 1 - .../javascript/common/agent-tracing/openai.mdx | 13 ++++++------- .../javascript/common/agent-tracing/vercelai.mdx | 1 - docs/platforms/javascript/common/tracing/index.mdx | 4 ++-- 9 files changed, 31 insertions(+), 39 deletions(-) diff --git a/docs/platforms/javascript/common/agent-tracing/anthropic.mdx b/docs/platforms/javascript/common/agent-tracing/anthropic.mdx index 9194b1382df18..52f5435bf37be 100644 --- a/docs/platforms/javascript/common/agent-tracing/anthropic.mdx +++ b/docs/platforms/javascript/common/agent-tracing/anthropic.mdx @@ -5,7 +5,6 @@ sidebar_order: 22 supported: - javascript.node - javascript.eve - - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -34,13 +33,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.anthropicAIIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, you need to use **[Manual Instrumentation](#manual-instrumentation)** to explicitly wrap your AI client instance instead. @@ -54,7 +53,7 @@ supported: - + ## Manual Instrumentation @@ -112,7 +111,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `anthropicAIIntegration` integration for **automatic instrumentation**: @@ -131,7 +130,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def - + Using the `instrumentAnthropicAiClient` wrapper for **manual instrumentation**: diff --git a/docs/platforms/javascript/common/agent-tracing/flue.mdx b/docs/platforms/javascript/common/agent-tracing/flue.mdx index be32f124363a3..db903967a4e56 100644 --- a/docs/platforms/javascript/common/agent-tracing/flue.mdx +++ b/docs/platforms/javascript/common/agent-tracing/flue.mdx @@ -6,7 +6,6 @@ description: "Learn how to send Flue agent traces, logs, and errors to Sentry." supported: - javascript.node - javascript.eve - - javascript.mastra - javascript.cloudflare --- @@ -18,7 +17,7 @@ With a valid `SENTRY_DSN`, Flue can send three connected signals to Sentry: - **Logs**: With `enableLogs: true` in the generated Sentry SDK configuration, every `log.info`, `log.warn`, and `log.error` call from your tools and hooks appears as Sentry Logs. When tracing is enabled, Sentry correlates these logs with the trace. - **Issues**: The generated bridge captures terminal failures, such as a failed prompt, skill, task, or shell operation, as Sentry error issues. Recovered tool errors remain diagnostic context on the trace when tracing is enabled and don't create issues. - + @@ -55,7 +54,7 @@ The generated module reads its configuration from environment variables. Only `S | `SENTRY_AI_RECORD_INPUTS` | `false` | Set to `true` to include prompts, system instructions, and tool definitions and arguments in spans. | | `SENTRY_AI_RECORD_OUTPUTS` | `false` | Set to `true` to include model output, tool results, and exception messages and stacks in spans. | - + ```bash {filename:.env} SENTRY_DSN="___PUBLIC_DSN___" @@ -93,7 +92,7 @@ Review the data your agent handles before you enable these options in production ## How It Works - + On Node.js, the generated `sentry.ts` calls `Sentry.init` at module scope. Sentry becomes the global OpenTelemetry tracer provider, so the spans from `@flue/opentelemetry` flow to Sentry without extra wiring. The following abridged example shows the core of the generated file. It omits helper definitions and the terminal-failure capture implementation, so use the file generated by the blueprint rather than copying this example: diff --git a/docs/platforms/javascript/common/agent-tracing/google-genai.mdx b/docs/platforms/javascript/common/agent-tracing/google-genai.mdx index 0d77a4f90aeda..1f4b5f8bb4d3a 100644 --- a/docs/platforms/javascript/common/agent-tracing/google-genai.mdx +++ b/docs/platforms/javascript/common/agent-tracing/google-genai.mdx @@ -5,7 +5,6 @@ sidebar_order: 23 supported: - javascript.node - javascript.eve - - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -34,13 +33,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.googleGenAIIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, you need to use **[Manual Instrumentation](#manual-instrumentation)** to explicitly wrap your AI client instance instead. @@ -54,7 +53,7 @@ supported: - + ## Manual Instrumentation @@ -108,7 +107,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `googleGenAIIntegration` integration for **automatic instrumentation**: @@ -127,7 +126,7 @@ Sentry.init({ - + Using the `instrumentGoogleGenAIClient` wrapper for **manual instrumentation**: diff --git a/docs/platforms/javascript/common/agent-tracing/langchain.mdx b/docs/platforms/javascript/common/agent-tracing/langchain.mdx index e2a6d5b7552e9..c6f230c55139e 100644 --- a/docs/platforms/javascript/common/agent-tracing/langchain.mdx +++ b/docs/platforms/javascript/common/agent-tracing/langchain.mdx @@ -5,7 +5,6 @@ sidebar_order: 24 supported: - javascript.node - javascript.eve - - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -34,13 +33,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.langChainIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, you need to use **[Manual Instrumentation](#manual-instrumentation)** to explicitly wrap your AI client instance instead. @@ -54,7 +53,7 @@ supported: - + ## Manual Instrumentation @@ -112,7 +111,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `langChainIntegration` integration for **automatic instrumentation**: @@ -131,7 +130,7 @@ Sentry.init({ - + Using the `createLangChainCallbackHandler` wrapper for **manual instrumentation**: diff --git a/docs/platforms/javascript/common/agent-tracing/langgraph.mdx b/docs/platforms/javascript/common/agent-tracing/langgraph.mdx index 32bf29abff637..d624bf14c23f4 100644 --- a/docs/platforms/javascript/common/agent-tracing/langgraph.mdx +++ b/docs/platforms/javascript/common/agent-tracing/langgraph.mdx @@ -5,7 +5,6 @@ sidebar_order: 25 supported: - javascript.node - javascript.eve - - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -34,13 +33,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.langGraphIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, you need to use **[Manual Instrumentation](#manual-instrumentation)** to explicitly wrap your AI client instance instead. @@ -54,7 +53,7 @@ supported: - + ## Manual Instrumentation @@ -134,7 +133,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `langGraphIntegration` integration for **automatic instrumentation**: @@ -153,7 +152,7 @@ Sentry.init({ - + Using the `instrumentLangGraph` wrapper for **manual instrumentation**: diff --git a/docs/platforms/javascript/common/agent-tracing/manual-instrumentation.mdx b/docs/platforms/javascript/common/agent-tracing/manual-instrumentation.mdx index 7cea6bb825db7..98657524519c3 100644 --- a/docs/platforms/javascript/common/agent-tracing/manual-instrumentation.mdx +++ b/docs/platforms/javascript/common/agent-tracing/manual-instrumentation.mdx @@ -6,7 +6,6 @@ description: "Learn how to manually instrument your agents to capture spans, tok supported: - javascript.node - javascript.eve - - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.bun diff --git a/docs/platforms/javascript/common/agent-tracing/openai.mdx b/docs/platforms/javascript/common/agent-tracing/openai.mdx index b0fee5ba72ea6..4f7dcea270c05 100644 --- a/docs/platforms/javascript/common/agent-tracing/openai.mdx +++ b/docs/platforms/javascript/common/agent-tracing/openai.mdx @@ -5,7 +5,6 @@ sidebar_order: 21 supported: - javascript.node - javascript.eve - - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.connect @@ -34,13 +33,13 @@ supported: - + ## Automatic Instrumentation _Import name: `Sentry.openAIIntegration`_ - + If you are using a different runtime (like Bun, Cloudflare Workers or a Browser) or experiencing missing spans, **[wrap the client](#instrument-the-client)** with `instrumentOpenAiClient` instead. @@ -54,7 +53,7 @@ supported: - + ## Instrument the Client @@ -157,7 +156,7 @@ Defaults to `true` if `dataCollection.genAI.outputs` is `true` (which is the def **Usage** - + Using the `openAIIntegration` integration for **automatic instrumentation**: @@ -176,7 +175,7 @@ Sentry.init({ - + Using the `instrumentOpenAiClient` wrapper: @@ -205,7 +204,7 @@ Instrumented calls record model, token usage, latency, and (when enabled) inputs The OpenAI SDK does **not** run your tools — your application does, after the model returns `tool_calls`. Because of that, `instrumentOpenAiClient` / `openAIIntegration` do **not** create `gen_ai.execute_tool` spans for local tool handlers. - + To get the full agent tree (`gen_ai.invoke_agent` → `gen_ai.chat` + `gen_ai.execute_tool`), wrap your tool loop with manual instrumentation. diff --git a/docs/platforms/javascript/common/agent-tracing/vercelai.mdx b/docs/platforms/javascript/common/agent-tracing/vercelai.mdx index e9162937a68e0..e9fcdfda98cfc 100644 --- a/docs/platforms/javascript/common/agent-tracing/vercelai.mdx +++ b/docs/platforms/javascript/common/agent-tracing/vercelai.mdx @@ -5,7 +5,6 @@ sidebar_order: 20 supported: - javascript.node - javascript.eve - - javascript.mastra - javascript.aws-lambda - javascript.azure-functions - javascript.bun diff --git a/docs/platforms/javascript/common/tracing/index.mdx b/docs/platforms/javascript/common/tracing/index.mdx index 79d730c922d43..91064cd58bc00 100644 --- a/docs/platforms/javascript/common/tracing/index.mdx +++ b/docs/platforms/javascript/common/tracing/index.mdx @@ -95,7 +95,7 @@ You can also manually start spans to instrument specific parts of your code. Thi - Sending Span Metrics: Learn how to capture metrics on your spans - + ## Replay Linking @@ -133,7 +133,7 @@ Instead, neither `tracesSampleRate` nor `tracesSampler` should be defined in you ## Related Features -- Session Replay — Traces appear in the Replay timeline, showing performance data alongside the user's actions. +- Session Replay — Traces appear in the Replay timeline, showing performance data alongside the user's actions. - Logs — Logs emitted during a trace are automatically linked, giving you diagnostic context for each operation. ## Tracing Next Steps From e334d351643d6a9b0e6c68bbb2497e3fc882da97 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 18 Sep 2026 10:22:13 +0200 Subject: [PATCH 10/11] docs(javascript): fix eslint no-shadow in Mastra sidebar aliases 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) --- src/components/sidebar/platformSidebar.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/sidebar/platformSidebar.tsx b/src/components/sidebar/platformSidebar.tsx index 12c329bbb5ac0..27c660d7c1437 100644 --- a/src/components/sidebar/platformSidebar.tsx +++ b/src/components/sidebar/platformSidebar.tsx @@ -145,17 +145,17 @@ export function PlatformSidebar({ const standaloneGuideAgentTracingAliases = platformName !== 'javascript' || !agentTracingNode ? [] - : STANDALONE_AGENT_TRACING_GUIDES.filter(({guide}) => guide !== guideName).map( - ({guide, slug, title, sidebar_order}) => ({ - context: { - platform: {platformName}, - title, - sidebar_order, - href: `/platforms/javascript/guides/${guide}/`, - }, - path: `/${pathRoot}/agent-tracing/${slug}/`, - }) - ); + : STANDALONE_AGENT_TRACING_GUIDES.filter( + guideData => guideData.guide !== guideName + ).map(guideData => ({ + context: { + platform: {platformName}, + title: guideData.title, + sidebar_order: guideData.sidebar_order, + href: `/platforms/javascript/guides/${guideData.guide}/`, + }, + path: `/${pathRoot}/agent-tracing/${guideData.slug}/`, + })); const tree = toTree( [ From bda0708b5821fed7ae2e7d5a170f5865f8fc4e72 Mon Sep 17 00:00:00 2001 From: Francesco Gringl-Novy Date: Mon, 21 Sep 2026 08:59:01 +0200 Subject: [PATCH 11/11] Update includes/mastra/link-conversations.mdx Co-authored-by: Alex Krawiec --- includes/mastra/link-conversations.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/mastra/link-conversations.mdx b/includes/mastra/link-conversations.mdx index 9161ecbf0a182..a2d7ec2f68e10 100644 --- a/includes/mastra/link-conversations.mdx +++ b/includes/mastra/link-conversations.mdx @@ -1,6 +1,6 @@ ### Link Conversations -Sentry groups a multi-turn chat into a single [Conversation](/product/agents/conversations/) automatically — there's no Sentry-specific setup. Mastra maps its memory thread id to `gen_ai.conversation.id`, so agent runs that share a thread id group into one conversation. +Sentry groups a multi-turn chat into a single [Conversation](/product/agents/conversations/) automatically — there's no Sentry-specific setup. Mastra maps its memory thread id to `gen_ai.conversation.id`, so agent runs that share a thread id are grouped into one conversation. Threads come from Mastra's own memory feature. If your app already passes a thread when it calls an agent — as multi-turn chat apps do — Sentry picks it up as the conversation id with no extra work: