From a86f565fa014bedf1b795ba7e620cbad86f1f7a1 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Mon, 21 Sep 2026 16:35:35 +0200 Subject: [PATCH 1/6] docs(javascript): Document Mistral AI integration Co-Authored-By: GPT-6 --- .../javascript/common/agent-tracing/index.mdx | 6 + .../common/agent-tracing/mistral.mdx | 232 ++++++++++++++++++ .../agent-tracing/manual-instrumentation.mdx | 6 + .../integrations/javascript.astro.mdx | 1 + .../integrations/javascript.aws-lambda.mdx | 1 + .../integrations/javascript.bun.mdx | 1 + .../integrations/javascript.cloudflare.mdx | 2 + .../integrations/javascript.connect.mdx | 1 + .../integrations/javascript.deno.mdx | 1 + .../integrations/javascript.fastify.mdx | 1 + .../integrations/javascript.gcp-functions.mdx | 1 + .../integrations/javascript.hapi.mdx | 1 + .../integrations/javascript.nestjs.mdx | 1 + .../integrations/javascript.nextjs.mdx | 1 + .../integrations/javascript.node.mdx | 1 + .../integrations/javascript.nuxt.mdx | 1 + .../integrations/javascript.remix.mdx | 1 + .../integrations/javascript.solidstart.mdx | 1 + .../integrations/javascript.sveltekit.mdx | 1 + src/components/platformIcon.tsx | 7 + 20 files changed, 268 insertions(+) create mode 100644 docs/platforms/javascript/common/agent-tracing/mistral.mdx diff --git a/docs/platforms/javascript/common/agent-tracing/index.mdx b/docs/platforms/javascript/common/agent-tracing/index.mdx index 2b3dc566ecb3b3..50f95269d48c15 100644 --- a/docs/platforms/javascript/common/agent-tracing/index.mdx +++ b/docs/platforms/javascript/common/agent-tracing/index.mdx @@ -129,6 +129,12 @@ Pick your AI stack. Some libraries auto-instrument; others need a short setup icon: "google-genai", notSupported: ["javascript.deno"], }, + { + to: "/agent-tracing/mistral/", + title: "Mistral AI", + icon: "mistral", + supported: ["javascript.node", "javascript.eve", "javascript.mastra", "javascript.aws-lambda", "javascript.azure-functions", "javascript.connect", "javascript.express", "javascript.fastify", "javascript.firebase", "javascript.gcp-functions", "javascript.hapi", "javascript.hono", "javascript.koa", "javascript.nestjs", "javascript.nextjs", "javascript.nuxt", "javascript.solidstart", "javascript.sveltekit", "javascript.react-router", "javascript.remix", "javascript.astro", "javascript.tanstackstart-react", "javascript.bun", "javascript.elysia", "javascript.cloudflare", "javascript.effect", "javascript.deno"], + }, { to: "/agent-tracing/langchain/", title: "LangChain", diff --git a/docs/platforms/javascript/common/agent-tracing/mistral.mdx b/docs/platforms/javascript/common/agent-tracing/mistral.mdx new file mode 100644 index 00000000000000..f92c10d76eacf9 --- /dev/null +++ b/docs/platforms/javascript/common/agent-tracing/mistral.mdx @@ -0,0 +1,232 @@ +--- +title: Mistral AI +description: "Adds instrumentation for the Mistral AI SDK." +sidebar_order: 29 +supported: + - javascript.node + - javascript.eve + - javascript.mastra + - javascript.aws-lambda + - javascript.azure-functions + - javascript.connect + - javascript.express + - javascript.fastify + - javascript.firebase + - javascript.gcp-functions + - javascript.hapi + - javascript.hono + - javascript.koa + - javascript.nestjs + - javascript.nextjs + - javascript.nuxt + - javascript.solidstart + - javascript.sveltekit + - javascript.react-router + - javascript.remix + - javascript.astro + - javascript.tanstackstart-react + - javascript.bun + - javascript.elysia + - javascript.cloudflare + - javascript.effect + - javascript.deno +--- + +The Mistral AI integration captures model calls, token usage, and latency from the [`@mistralai/mistralai`](https://www.npmjs.com/package/@mistralai/mistralai) SDK. Requires Sentry SDK version `11.0.0-rc.0` or later and tracing enabled. + + + + + Mistral AI instrumentation is available in the server SDK only. Use these APIs + in server-side code. + + + + + + +## Automatic Instrumentation + +_Import name: `Sentry.mistralAIIntegration`_ + +The integration is enabled by default when tracing is enabled. Initialize Sentry before importing the Mistral SDK, following your platform's setup instructions. + + + +On Node.js, follow the setup above. For build-time automatic instrumentation, follow the [Bun setup](/platforms/javascript/guides/bun/agent-tracing/mistral/#automatic-instrumentation) or [Cloudflare setup](/platforms/javascript/guides/cloudflare/agent-tracing/mistral/#automatic-instrumentation) for your runtime. The Deno entry point supports the automatic integration, but does not export the manual wrapper; follow the [Deno setup](/platforms/javascript/guides/deno/agent-tracing/mistral/). + + + + + +Preload Sentry's import hook when starting your Deno application so the Mistral SDK can be instrumented: + +```bash +deno run --allow-net --allow-env --allow-read --allow-sys --allow-write --preload=npm:@sentry/deno/import app.ts +``` + + + +To customize what data is captured, configure the integration in your existing Sentry initialization: + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tracesSampleRate: 1.0, + integrations: [ + Sentry.mistralAIIntegration({ + recordInputs: false, + recordOutputs: false, + }), + ], +}); +``` + + + + + +## Automatic Instrumentation + +Mistral calls can be instrumented automatically when your build uses Sentry's instrumentation plugin. Set up the Sentry SDK and enable tracing before making requests. + + + +For applications running on Bun, add `sentryBunPlugin()` to your build and run the resulting bundle: + +```typescript {filename:build.ts} +import { sentryBunPlugin } from "@sentry/bun/plugin"; + +await Bun.build({ + entrypoints: ["./src/index.ts"], + outdir: "./dist", + target: "bun", + plugins: [sentryBunPlugin()], +}); +``` + + + +For Elysia running with the Node.js adapter, follow the [Node.js automatic instrumentation setup](/platforms/javascript/guides/node/agent-tracing/mistral/#automatic-instrumentation). + + + +The Mistral SDK must be included in the bundle so the plugin can instrument it. The plugin only runs during a build; for unbundled applications started with `bun run`, use [Manual Instrumentation](#manual-instrumentation). + +Configure `Sentry.mistralAIIntegration({ recordInputs: false, recordOutputs: false })` in your existing `Sentry.init` call to customize content recording, or use `dataCollection.genAI`. + + + + + +Add `sentryCloudflareVitePlugin()` alongside Cloudflare's Vite plugin: + +```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()], +}); +``` + +With SDK `11.0.0-rc.0` or later, `buildTimeInstrumentation` is enabled by default. The plugin instruments the bundled Mistral SDK and registers its Sentry integration in both `vite dev` and `vite build`. Keep the `nodejs_compat` flag enabled in your Wrangler configuration. + +For a Worker entry declared in Wrangler's `main`, create `instrument.server.ts` next to the entry file. The plugin uses its default export as the Sentry options: + +```typescript {filename:src/instrument.server.ts} +export default (env: Env) => ({ + dsn: "___PUBLIC_DSN___", + tracesSampleRate: 1.0, + dataCollection: { + genAI: { inputs: false, outputs: false }, + }, +}); +``` + +If your Worker is already wrapped with `Sentry.withSentry`, configure these options there instead. + +Control automatic input and output recording through `dataCollection.genAI` in your Sentry options. You don't need to add `mistralAIIntegration()` yourself; it is not exported from `@sentry/cloudflare`. + +Without the plugin, or with `buildTimeInstrumentation: false`, use [Manual Instrumentation](#manual-instrumentation). + + + + + + + +## Manual Instrumentation + +_Import name: `Sentry.instrumentMistralAiClient`_ + +If your application does not use automatic instrumentation, wrap your Mistral client after setting up Sentry. Use the returned client for all Mistral calls. + + + +Import Sentry from the entry point for your runtime: `@sentry/hono/node`, `@sentry/hono/bun`, or `@sentry/hono/cloudflare`. + + + +```javascript +import { Mistral } from "@mistralai/mistralai"; + +const mistral = new Mistral({ apiKey: "your-mistral-api-key" }); +const client = Sentry.instrumentMistralAiClient(mistral, { + recordInputs: false, + recordOutputs: false, +}); + +const response = await client.chat.complete({ + model: "mistral-small-latest", + messages: [{ role: "user", content: "Hello!" }], +}); +``` + +Use one instrumentation approach for each client. If automatic instrumentation is already active, you don't need to wrap the client. + + + +## Configuration + +The following options control content recorded on Mistral spans. They apply to both the integration and the client wrapper. + +### `recordInputs` + +_Type: `boolean` (optional)_ + +Records inputs such as prompts, messages, tool definitions, and embedding input. Defaults to the client's `dataCollection.genAI.inputs` setting, which defaults to `true`. An explicit value overrides that setting. + +### `recordOutputs` + +_Type: `boolean` (optional)_ + +Records outputs such as generated text and tool calls. Defaults to the client's `dataCollection.genAI.outputs` setting, which defaults to `true`. An explicit value overrides that setting. + +Set either option to `false` to exclude that content while retaining timing and token usage. See `dataCollection` for SDK-wide privacy controls. + +## Supported Operations + +Tracing support is added to the following Mistral SDK calls: + +- `chat.complete()` - Generate a chat completion. +- `chat.stream()` - Stream a chat completion. +- `chat.parse()` - Generate a structured response. +- `chat.parseStream()` - Stream a structured response. +- `embeddings.create()` - Generate embeddings. +- `agents.complete()` - Generate an agent completion. +- `agents.stream()` - Stream an agent completion. + +Streaming calls are recorded as a single span as you consume the stream. Tool calls returned by the model are recorded when `recordOutputs` is enabled; this integration does not instrument execution of your tool functions. + +## Verify + +Make a Mistral request, then open [Agent Tracing](/product/agents/) in Sentry. Check for a `gen_ai.chat`, `gen_ai.embeddings`, or `gen_ai.invoke_agent` span, depending on the operation, with model and token usage where returned by Mistral. + +If no spans appear, check that tracing is enabled and Sentry is initialized before the request. For manual instrumentation, make the request through the wrapped client. For streaming requests, consume the stream. + +## Supported Versions + +- Sentry JavaScript SDK: `>=11.0.0-rc.0` +- `@mistralai/mistralai`: `>=2.0.0 <3` diff --git a/includes/agent-tracing/manual-instrumentation.mdx b/includes/agent-tracing/manual-instrumentation.mdx index acd900f4da21e8..3a9387abc2689a 100644 --- a/includes/agent-tracing/manual-instrumentation.mdx +++ b/includes/agent-tracing/manual-instrumentation.mdx @@ -15,6 +15,12 @@ For supported AI libraries, Sentry provides manual instrumentation helpers that {to: "/agent-tracing/openai/", title: "OpenAI", icon: "openai"}, {to: "/agent-tracing/anthropic/", title: "Anthropic", icon: "anthropic"}, {to: "/agent-tracing/google-genai/", title: "Google Gen AI SDK", icon: "google-genai"}, + { + to: "/agent-tracing/mistral/", + title: "Mistral AI", + icon: "mistral", + supported: ["javascript.node", "javascript.eve", "javascript.mastra", "javascript.aws-lambda", "javascript.azure-functions", "javascript.connect", "javascript.express", "javascript.fastify", "javascript.firebase", "javascript.gcp-functions", "javascript.hapi", "javascript.hono", "javascript.koa", "javascript.nestjs", "javascript.nextjs", "javascript.nuxt", "javascript.solidstart", "javascript.sveltekit", "javascript.react-router", "javascript.remix", "javascript.astro", "javascript.tanstackstart-react", "javascript.bun", "javascript.elysia", "javascript.cloudflare", "javascript.effect"], + }, {to: "/agent-tracing/langchain/", title: "LangChain", icon: "langchain"}, {to: "/agent-tracing/langgraph/", title: "LangGraph", icon: "langgraph"}, ]} diff --git a/platform-includes/configuration/integrations/javascript.astro.mdx b/platform-includes/configuration/integrations/javascript.astro.mdx index 5d44264f8c76de..eeeb916aa5915c 100644 --- a/platform-includes/configuration/integrations/javascript.astro.mdx +++ b/platform-includes/configuration/integrations/javascript.astro.mdx @@ -84,6 +84,7 @@ Depending on whether an integration enhances the functionality of a particular r | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`firebaseIntegration`](./firebase) | ✓ | | ✓ | | | [`zodErrorsIntegration`](./zodErrors) | | | | ✓ | diff --git a/platform-includes/configuration/integrations/javascript.aws-lambda.mdx b/platform-includes/configuration/integrations/javascript.aws-lambda.mdx index d9faf15d2a6ca7..06cfc7fd4da9ec 100644 --- a/platform-includes/configuration/integrations/javascript.aws-lambda.mdx +++ b/platform-includes/configuration/integrations/javascript.aws-lambda.mdx @@ -21,6 +21,7 @@ | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`amqplibIntegration`](./amqplib) | | | ✓ | | | [`anrIntegration`](./anr) | | ✓ | | | diff --git a/platform-includes/configuration/integrations/javascript.bun.mdx b/platform-includes/configuration/integrations/javascript.bun.mdx index 9a05e628140631..04a32fd8e67bf0 100644 --- a/platform-includes/configuration/integrations/javascript.bun.mdx +++ b/platform-includes/configuration/integrations/javascript.bun.mdx @@ -33,6 +33,7 @@ | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`firebaseIntegration`](./firebase) | ✓ | | ✓ | | | [`bunRuntimeMetricsIntegration`](./bunruntimemetrics) | | | | ✓ | diff --git a/platform-includes/configuration/integrations/javascript.cloudflare.mdx b/platform-includes/configuration/integrations/javascript.cloudflare.mdx index deddfb8faa9f77..a2aa88d0f32f18 100644 --- a/platform-includes/configuration/integrations/javascript.cloudflare.mdx +++ b/platform-includes/configuration/integrations/javascript.cloudflare.mdx @@ -16,4 +16,6 @@ | [`prismaIntegration`](./prisma) | | | ✓ | | | | [`honoIntegration`](./hono) | ✓ | ✓ | | | | +[Mistral AI](../../agent-tracing/mistral) is automatically instrumented when built with the Sentry Cloudflare Vite plugin. Without the plugin, use `instrumentMistralAiClient`. + The [`prismaIntegration`](./prisma) is only available through the [`@sentry/cloudflare/nodejs_compat`](../../features/nodejs-compat) entrypoint. diff --git a/platform-includes/configuration/integrations/javascript.connect.mdx b/platform-includes/configuration/integrations/javascript.connect.mdx index b2ce33a4e70107..5520405dcf466a 100644 --- a/platform-includes/configuration/integrations/javascript.connect.mdx +++ b/platform-includes/configuration/integrations/javascript.connect.mdx @@ -34,6 +34,7 @@ | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`anrIntegration`](./anr) | | ✓ | | | | [`captureConsoleIntegration`](./captureconsole) | | | | ✓ | diff --git a/platform-includes/configuration/integrations/javascript.deno.mdx b/platform-includes/configuration/integrations/javascript.deno.mdx index 4aab5d17afbf3c..15d740cc58618f 100644 --- a/platform-includes/configuration/integrations/javascript.deno.mdx +++ b/platform-includes/configuration/integrations/javascript.deno.mdx @@ -19,3 +19,4 @@ | [`instrumentPostgresJsSql`](./postgresjs) | | | ✓ | | | | [`trpcMiddleware`](./trpc) | | ✓ | ✓ | | ✓ | | [`zodErrorsIntegration`](./zodErrors) | | | | ✓ | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | diff --git a/platform-includes/configuration/integrations/javascript.fastify.mdx b/platform-includes/configuration/integrations/javascript.fastify.mdx index 807d5223902159..e0041345fb21d8 100644 --- a/platform-includes/configuration/integrations/javascript.fastify.mdx +++ b/platform-includes/configuration/integrations/javascript.fastify.mdx @@ -33,6 +33,7 @@ | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`anrIntegration`](./anr) | | ✓ | | | | [`captureConsoleIntegration`](./captureconsole) | | | | ✓ | diff --git a/platform-includes/configuration/integrations/javascript.gcp-functions.mdx b/platform-includes/configuration/integrations/javascript.gcp-functions.mdx index 61e464d853018a..070857e74011d0 100644 --- a/platform-includes/configuration/integrations/javascript.gcp-functions.mdx +++ b/platform-includes/configuration/integrations/javascript.gcp-functions.mdx @@ -21,6 +21,7 @@ | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`firebaseIntegration`](./firebase) | ✓ | | ✓ | | | [`amqplibIntegration`](./amqplib) | | | ✓ | | diff --git a/platform-includes/configuration/integrations/javascript.hapi.mdx b/platform-includes/configuration/integrations/javascript.hapi.mdx index 7ed14e4ceef24d..cb17d87bcb534b 100644 --- a/platform-includes/configuration/integrations/javascript.hapi.mdx +++ b/platform-includes/configuration/integrations/javascript.hapi.mdx @@ -34,6 +34,7 @@ | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`anrIntegration`](./anr) | | ✓ | | | | [`captureConsoleIntegration`](./captureconsole) | | | | ✓ | diff --git a/platform-includes/configuration/integrations/javascript.nestjs.mdx b/platform-includes/configuration/integrations/javascript.nestjs.mdx index 00b3a8bf1614c5..9773ad13749acf 100644 --- a/platform-includes/configuration/integrations/javascript.nestjs.mdx +++ b/platform-includes/configuration/integrations/javascript.nestjs.mdx @@ -47,6 +47,7 @@ | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`zodErrorsIntegration`](./zodErrors) | | | | ✓ | | [`pinoIntegration`](./pino) | | ✓ | | | diff --git a/platform-includes/configuration/integrations/javascript.nextjs.mdx b/platform-includes/configuration/integrations/javascript.nextjs.mdx index 58b03e0ad63ff6..d69bd65debc472 100644 --- a/platform-includes/configuration/integrations/javascript.nextjs.mdx +++ b/platform-includes/configuration/integrations/javascript.nextjs.mdx @@ -91,6 +91,7 @@ Depending on whether an integration enhances the functionality of a particular r | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`zodErrorsIntegration`](./zodErrors) | | | | ✓ | | [`pinoIntegration`](./pino) | | ✓ | | | diff --git a/platform-includes/configuration/integrations/javascript.node.mdx b/platform-includes/configuration/integrations/javascript.node.mdx index 5973f59e60b122..3997be972532ae 100644 --- a/platform-includes/configuration/integrations/javascript.node.mdx +++ b/platform-includes/configuration/integrations/javascript.node.mdx @@ -46,6 +46,7 @@ | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`firebaseIntegration`](./firebase) | ✓ | | ✓ | | | [`zodErrorsIntegration`](./zodErrors) | | | | ✓ | diff --git a/platform-includes/configuration/integrations/javascript.nuxt.mdx b/platform-includes/configuration/integrations/javascript.nuxt.mdx index 299722eb631869..8e29eda227f480 100644 --- a/platform-includes/configuration/integrations/javascript.nuxt.mdx +++ b/platform-includes/configuration/integrations/javascript.nuxt.mdx @@ -84,6 +84,7 @@ Depending on whether an integration enhances the functionality of a particular r | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`zodErrorsIntegration`](./zodErrors) | | | | ✓ | | [`pinoIntegration`](./pino) | | ✓ | | | diff --git a/platform-includes/configuration/integrations/javascript.remix.mdx b/platform-includes/configuration/integrations/javascript.remix.mdx index b7e2d2dc2a8ab6..75ffa501e3122b 100644 --- a/platform-includes/configuration/integrations/javascript.remix.mdx +++ b/platform-includes/configuration/integrations/javascript.remix.mdx @@ -84,6 +84,7 @@ Depending on whether an integration enhances the functionality of a particular r | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`zodErrorsIntegration`](./zodErrors) | | | | ✓ | | [`pinoIntegration`](./pino) | | ✓ | | | diff --git a/platform-includes/configuration/integrations/javascript.solidstart.mdx b/platform-includes/configuration/integrations/javascript.solidstart.mdx index a33bc442497a43..ab07f2f8d15199 100644 --- a/platform-includes/configuration/integrations/javascript.solidstart.mdx +++ b/platform-includes/configuration/integrations/javascript.solidstart.mdx @@ -84,6 +84,7 @@ Depending on whether an integration enhances the functionality of a particular r | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`zodErrorsIntegration`](./zodErrors) | | | | ✓ | | [`pinoIntegration`](./pino) | | ✓ | | | diff --git a/platform-includes/configuration/integrations/javascript.sveltekit.mdx b/platform-includes/configuration/integrations/javascript.sveltekit.mdx index 5f9b60c65be938..f4b4dd2d9216b6 100644 --- a/platform-includes/configuration/integrations/javascript.sveltekit.mdx +++ b/platform-includes/configuration/integrations/javascript.sveltekit.mdx @@ -84,6 +84,7 @@ Depending on whether an integration enhances the functionality of a particular r | [`openAIIntegration`](../../agent-tracing/openai) | ✓ | | ✓ | | | [`anthropicAIIntegration`](../../agent-tracing/anthropic) | ✓ | ✓ | ✓ | | | [`googleGenAIIntegration`](../../agent-tracing/google-genai) | ✓ | ✓ | ✓ | | +| [`mistralAIIntegration`](../../agent-tracing/mistral) | ✓ | | ✓ | | | [`langChainIntegration`](../../agent-tracing/langchain) | ✓ | ✓ | ✓ | | | [`zodErrorsIntegration`](./zodErrors) | | | | ✓ | | [`pinoIntegration`](./pino) | | ✓ | | | diff --git a/src/components/platformIcon.tsx b/src/components/platformIcon.tsx index 440248389f4fb8..5a96dd11397ad0 100644 --- a/src/components/platformIcon.tsx +++ b/src/components/platformIcon.tsx @@ -92,6 +92,7 @@ import LoguruSVG from 'platformicons/svg/loguru.svg'; import MastraSVG from 'platformicons/svg/mastra.svg'; import MauiSVG from 'platformicons/svg/maui.svg'; import McpSVG from 'platformicons/svg/mcp.svg'; +import MistralSVG from 'platformicons/svg/mistral.svg'; import MongodbSVG from 'platformicons/svg/mongodb.svg'; import NativecSVG from 'platformicons/svg/nativec.svg'; import NestjsSVG from 'platformicons/svg/nestjs.svg'; @@ -247,6 +248,7 @@ import LoguruSVGLarge from 'platformicons/svg_80x80/loguru.svg'; import MastraSVGLarge from 'platformicons/svg_80x80/mastra.svg'; import MauiSVGLarge from 'platformicons/svg_80x80/maui.svg'; import McpSVGLarge from 'platformicons/svg_80x80/mcp.svg'; +import MistralSVGLarge from 'platformicons/svg_80x80/mistral.svg'; import MongodbSVGLarge from 'platformicons/svg_80x80/mongodb.svg'; import NativecSVGLarge from 'platformicons/svg_80x80/nativec.svg'; import NestjsSVGLarge from 'platformicons/svg_80x80/nestjs.svg'; @@ -712,6 +714,10 @@ const formatToSVG = { sm: McpSVG, lg: McpSVGLarge, }, + mistral: { + sm: MistralSVG, + lg: MistralSVGLarge, + }, mongodb: { sm: MongodbSVG, lg: MongodbSVGLarge, @@ -1077,6 +1083,7 @@ export const PLATFORM_TO_ICON = { linux: 'linux', mastra: 'mastra', mcp: 'mcp', + mistral: 'mistral', native: 'nativec', 'native-qt': 'qt', 'native-wasm': 'wasm', From 54ca5dc595ff868e5918234cda00cf51a2ff5d2d Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Mon, 21 Sep 2026 17:00:16 +0200 Subject: [PATCH 2/6] docs(javascript): Reuse page support filtering for Mistral cards Co-Authored-By: GPT-6 --- docs/platforms/javascript/common/agent-tracing/index.mdx | 1 - includes/agent-tracing/manual-instrumentation.mdx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/platforms/javascript/common/agent-tracing/index.mdx b/docs/platforms/javascript/common/agent-tracing/index.mdx index 50f95269d48c15..ca86563de17498 100644 --- a/docs/platforms/javascript/common/agent-tracing/index.mdx +++ b/docs/platforms/javascript/common/agent-tracing/index.mdx @@ -133,7 +133,6 @@ Pick your AI stack. Some libraries auto-instrument; others need a short setup to: "/agent-tracing/mistral/", title: "Mistral AI", icon: "mistral", - supported: ["javascript.node", "javascript.eve", "javascript.mastra", "javascript.aws-lambda", "javascript.azure-functions", "javascript.connect", "javascript.express", "javascript.fastify", "javascript.firebase", "javascript.gcp-functions", "javascript.hapi", "javascript.hono", "javascript.koa", "javascript.nestjs", "javascript.nextjs", "javascript.nuxt", "javascript.solidstart", "javascript.sveltekit", "javascript.react-router", "javascript.remix", "javascript.astro", "javascript.tanstackstart-react", "javascript.bun", "javascript.elysia", "javascript.cloudflare", "javascript.effect", "javascript.deno"], }, { to: "/agent-tracing/langchain/", diff --git a/includes/agent-tracing/manual-instrumentation.mdx b/includes/agent-tracing/manual-instrumentation.mdx index 3a9387abc2689a..7d13ef24825c4d 100644 --- a/includes/agent-tracing/manual-instrumentation.mdx +++ b/includes/agent-tracing/manual-instrumentation.mdx @@ -19,7 +19,7 @@ For supported AI libraries, Sentry provides manual instrumentation helpers that to: "/agent-tracing/mistral/", title: "Mistral AI", icon: "mistral", - supported: ["javascript.node", "javascript.eve", "javascript.mastra", "javascript.aws-lambda", "javascript.azure-functions", "javascript.connect", "javascript.express", "javascript.fastify", "javascript.firebase", "javascript.gcp-functions", "javascript.hapi", "javascript.hono", "javascript.koa", "javascript.nestjs", "javascript.nextjs", "javascript.nuxt", "javascript.solidstart", "javascript.sveltekit", "javascript.react-router", "javascript.remix", "javascript.astro", "javascript.tanstackstart-react", "javascript.bun", "javascript.elysia", "javascript.cloudflare", "javascript.effect"], + notSupported: ["javascript.deno"], }, {to: "/agent-tracing/langchain/", title: "LangChain", icon: "langchain"}, {to: "/agent-tracing/langgraph/", title: "LangGraph", icon: "langgraph"}, From 0365efa585777e666af10bde7610d0602da79e87 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Mon, 21 Sep 2026 17:18:14 +0200 Subject: [PATCH 3/6] docs(javascript): Simplify Mistral instrumentation setup Co-Authored-By: GPT-6 --- .../common/agent-tracing/mistral.mdx | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/docs/platforms/javascript/common/agent-tracing/mistral.mdx b/docs/platforms/javascript/common/agent-tracing/mistral.mdx index f92c10d76eacf9..e5bd7759236b80 100644 --- a/docs/platforms/javascript/common/agent-tracing/mistral.mdx +++ b/docs/platforms/javascript/common/agent-tracing/mistral.mdx @@ -43,23 +43,27 @@ The Mistral AI integration captures model calls, token usage, and latency from t - + ## Automatic Instrumentation +Enable tracing in your Sentry configuration, then follow the setup for your runtime below. + + + _Import name: `Sentry.mistralAIIntegration`_ -The integration is enabled by default when tracing is enabled. Initialize Sentry before importing the Mistral SDK, following your platform's setup instructions. +On Node.js, the integration is enabled by default when tracing is enabled. Initialize Sentry before importing the Mistral SDK, following your platform's setup instructions. -On Node.js, follow the setup above. For build-time automatic instrumentation, follow the [Bun setup](/platforms/javascript/guides/bun/agent-tracing/mistral/#automatic-instrumentation) or [Cloudflare setup](/platforms/javascript/guides/cloudflare/agent-tracing/mistral/#automatic-instrumentation) for your runtime. The Deno entry point supports the automatic integration, but does not export the manual wrapper; follow the [Deno setup](/platforms/javascript/guides/deno/agent-tracing/mistral/). +For Hono, automatic instrumentation depends on your runtime. Follow the [Node.js](/platforms/javascript/guides/node/agent-tracing/mistral/#automatic-instrumentation), [Bun](/platforms/javascript/guides/bun/agent-tracing/mistral/#automatic-instrumentation), [Cloudflare](/platforms/javascript/guides/cloudflare/agent-tracing/mistral/#automatic-instrumentation), or [Deno](/platforms/javascript/guides/deno/agent-tracing/mistral/#automatic-instrumentation) setup. -Preload Sentry's import hook when starting your Deno application so the Mistral SDK can be instrumented: +On Deno, the integration is enabled by default with tracing. Preload Sentry's import hook so the Mistral SDK can be instrumented: ```bash deno run --allow-net --allow-env --allow-read --allow-sys --allow-write --preload=npm:@sentry/deno/import app.ts @@ -67,18 +71,15 @@ deno run --allow-net --allow-env --allow-read --allow-sys --allow-write --preloa -To customize what data is captured, configure the integration in your existing Sentry initialization: +To turn off recording of prompts and responses, set `dataCollection.genAI` in your existing Sentry initialization: ```javascript Sentry.init({ dsn: "___PUBLIC_DSN___", tracesSampleRate: 1.0, - integrations: [ - Sentry.mistralAIIntegration({ - recordInputs: false, - recordOutputs: false, - }), - ], + dataCollection: { + genAI: { inputs: false, outputs: false }, + }, }); ``` @@ -86,9 +87,7 @@ Sentry.init({ -## Automatic Instrumentation - -Mistral calls can be instrumented automatically when your build uses Sentry's instrumentation plugin. Set up the Sentry SDK and enable tracing before making requests. +Use Sentry's build plugin to instrument bundled Mistral calls automatically. @@ -113,7 +112,7 @@ For Elysia running with the Node.js adapter, follow the [Node.js automatic instr The Mistral SDK must be included in the bundle so the plugin can instrument it. The plugin only runs during a build; for unbundled applications started with `bun run`, use [Manual Instrumentation](#manual-instrumentation). -Configure `Sentry.mistralAIIntegration({ recordInputs: false, recordOutputs: false })` in your existing `Sentry.init` call to customize content recording, or use `dataCollection.genAI`. +Use `dataCollection.genAI` in your Sentry options to control recording of prompts and responses. @@ -147,15 +146,15 @@ export default (env: Env) => ({ If your Worker is already wrapped with `Sentry.withSentry`, configure these options there instead. -Control automatic input and output recording through `dataCollection.genAI` in your Sentry options. You don't need to add `mistralAIIntegration()` yourself; it is not exported from `@sentry/cloudflare`. - Without the plugin, or with `buildTimeInstrumentation: false`, use [Manual Instrumentation](#manual-instrumentation). - + + + ## Manual Instrumentation @@ -169,6 +168,14 @@ Import Sentry from the entry point for your runtime: `@sentry/hono/node`, `@sent + + +```javascript +import * as Sentry from "___SDK_PACKAGE___"; +``` + + + ```javascript import { Mistral } from "@mistralai/mistralai"; @@ -190,7 +197,7 @@ Use one instrumentation approach for each client. If automatic instrumentation i ## Configuration -The following options control content recorded on Mistral spans. They apply to both the integration and the client wrapper. +The following options control content recorded on Mistral spans. Set them on the integration or client wrapper to override the SDK-wide `dataCollection.genAI` settings. ### `recordInputs` @@ -220,11 +227,7 @@ Tracing support is added to the following Mistral SDK calls: Streaming calls are recorded as a single span as you consume the stream. Tool calls returned by the model are recorded when `recordOutputs` is enabled; this integration does not instrument execution of your tool functions. -## Verify - -Make a Mistral request, then open [Agent Tracing](/product/agents/) in Sentry. Check for a `gen_ai.chat`, `gen_ai.embeddings`, or `gen_ai.invoke_agent` span, depending on the operation, with model and token usage where returned by Mistral. - -If no spans appear, check that tracing is enabled and Sentry is initialized before the request. For manual instrumentation, make the request through the wrapped client. For streaming requests, consume the stream. +To verify your setup, make a Mistral request and open [Agent Tracing](/product/agents/) in Sentry. Look for a `gen_ai.chat`, `gen_ai.embeddings`, or `gen_ai.invoke_agent` span with model and token usage where returned by Mistral. Consume streaming responses so their spans finish. ## Supported Versions From c91bd23bfe0bea4328a9ed8dca871e3efb8a8190 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Mon, 21 Sep 2026 17:41:04 +0200 Subject: [PATCH 4/6] docs: Align Mistral visibility with framework exports Co-Authored-By: GPT-6 --- docs/platforms/javascript/common/agent-tracing/mistral.mdx | 6 +++++- includes/agent-tracing/manual-instrumentation.mdx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/common/agent-tracing/mistral.mdx b/docs/platforms/javascript/common/agent-tracing/mistral.mdx index e5bd7759236b80..5b92881e9be9fa 100644 --- a/docs/platforms/javascript/common/agent-tracing/mistral.mdx +++ b/docs/platforms/javascript/common/agent-tracing/mistral.mdx @@ -51,8 +51,12 @@ Enable tracing in your Sentry configuration, then follow the setup for your runt + + _Import name: `Sentry.mistralAIIntegration`_ + + On Node.js, the integration is enabled by default when tracing is enabled. Initialize Sentry before importing the Mistral SDK, following your platform's setup instructions. @@ -154,7 +158,7 @@ Without the plugin, or with `buildTimeInstrumentation: false`, use [Manual Instr - + ## Manual Instrumentation diff --git a/includes/agent-tracing/manual-instrumentation.mdx b/includes/agent-tracing/manual-instrumentation.mdx index 7d13ef24825c4d..8159fa020efa7b 100644 --- a/includes/agent-tracing/manual-instrumentation.mdx +++ b/includes/agent-tracing/manual-instrumentation.mdx @@ -19,7 +19,7 @@ For supported AI libraries, Sentry provides manual instrumentation helpers that to: "/agent-tracing/mistral/", title: "Mistral AI", icon: "mistral", - notSupported: ["javascript.deno"], + notSupported: ["javascript.deno", "javascript.solidstart"], }, {to: "/agent-tracing/langchain/", title: "LangChain", icon: "langchain"}, {to: "/agent-tracing/langgraph/", title: "LangGraph", icon: "langgraph"}, From 914b7f3e422d7f9adf453dc74734a8f8ca3fb775 Mon Sep 17 00:00:00 2001 From: Andrei <168741329+andreiborza@users.noreply.github.com> Date: Tue, 22 Sep 2026 16:26:59 +0200 Subject: [PATCH 5/6] Update docs/platforms/javascript/common/agent-tracing/mistral.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jan Peer Stöcklmair --- docs/platforms/javascript/common/agent-tracing/mistral.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/platforms/javascript/common/agent-tracing/mistral.mdx b/docs/platforms/javascript/common/agent-tracing/mistral.mdx index 5b92881e9be9fa..8529456db28dbb 100644 --- a/docs/platforms/javascript/common/agent-tracing/mistral.mdx +++ b/docs/platforms/javascript/common/agent-tracing/mistral.mdx @@ -139,13 +139,15 @@ With SDK `11.0.0-rc.0` or later, `buildTimeInstrumentation` is enabled by defaul For a Worker entry declared in Wrangler's `main`, create `instrument.server.ts` next to the entry file. The plugin uses its default export as the Sentry options: ```typescript {filename:src/instrument.server.ts} -export default (env: Env) => ({ +import { defineCloudflareOptions } from '@sentry/cloudflare'; + +export default defineCloudflareOptions((env) => ({ dsn: "___PUBLIC_DSN___", tracesSampleRate: 1.0, dataCollection: { genAI: { inputs: false, outputs: false }, }, -}); +})); ``` If your Worker is already wrapped with `Sentry.withSentry`, configure these options there instead. From 2cc62f253e55dd204a83cf3bef7813f57de7250c Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Tue, 22 Sep 2026 16:47:19 +0200 Subject: [PATCH 6/6] Clarify Bun build step for Elysia --- .../configuration/integrations/mistral.mdx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/platforms/javascript/common/configuration/integrations/mistral.mdx b/docs/platforms/javascript/common/configuration/integrations/mistral.mdx index d0aba65d086db4..8e3a2dfacf12cc 100644 --- a/docs/platforms/javascript/common/configuration/integrations/mistral.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/mistral.mdx @@ -41,8 +41,20 @@ deno run --allow-net --allow-env --allow-read --allow-sys --allow-write --preloa + + +With the Node.js adapter, no build step is needed. The integration is enabled by default when tracing is enabled. + +On Bun, add `sentryBunPlugin()` to your build so the plugin can instrument the bundled Mistral SDK: + + + + + On Bun, add `sentryBunPlugin()` to your build so the plugin can instrument the bundled Mistral SDK: + + ```typescript {filename:build.ts} import { sentryBunPlugin } from "@sentry/bun/plugin"; @@ -56,12 +68,6 @@ await Bun.build({ The Mistral SDK must be part of the bundle. The plugin only runs during a build, so for unbundled applications started with `bun run`, use [Manual Instrumentation](#manual-instrumentation). - - -For Elysia with the Node.js adapter, no build step is needed. The integration is enabled by default when tracing is enabled. - - -