From 66b3e3e7626e0acb9bc62b07dbbd9589ea93d63f Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Tue, 3 Feb 2026 11:15:40 +0100 Subject: [PATCH 1/3] feat(tanstackstart-react): Middleware auto-instrumentation --- .../tanstackstart-react/features/sentryTanstackStart.mdx | 9 +++++++++ .../features/wrapMiddlewaresWithSentry.mdx | 6 ++++++ .../javascript/guides/tanstackstart-react/index.mdx | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx b/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx index 9a1c5c06d4207..0b2b7c0bf8666 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx @@ -50,3 +50,12 @@ export default defineConfig({ ## Configuration Options The plugin passes through all options to the underlying [`@sentry/vite-plugin`](/platforms/javascript/sourcemaps/uploading/vite/). See the [Sentry Vite Plugin documentation](/platforms/javascript/sourcemaps/uploading/vite/) for the full list of available options. + +Additionally, the plugin, by default, automatically instruments all TanStack Start middlewares for tracing. To disable this behavior: + +```typescript {filename:vite.config.ts} +sentryTanstackStart({ + // ... + autoInstrumentMiddleware: false, +}), +``` diff --git a/docs/platforms/javascript/guides/tanstackstart-react/features/wrapMiddlewaresWithSentry.mdx b/docs/platforms/javascript/guides/tanstackstart-react/features/wrapMiddlewaresWithSentry.mdx index 89747276b7f4d..5b00a233a5a6f 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/features/wrapMiddlewaresWithSentry.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/features/wrapMiddlewaresWithSentry.mdx @@ -5,6 +5,12 @@ description: "Learn how to add tracing to your TanStack Start middleware." + + If you're using the `sentryTanstackStart` Vite plugin, middlewares are + automatically instrumented. Use this wrapper for more granular control or when + auto-instrumentation doesn't work for specific cases. + + The `wrapMiddlewaresWithSentry` function allows you to add tracing to your TanStack Start [middleware](https://tanstack.com/start/latest/docs/framework/react/guide/middleware). This feature enables more granular performance monitoring and helps you gather detailed insights into the performance of individual middlewares within your application. ## Usage diff --git a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx index 30b7f2a6499ac..fd1f1d888eb40 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx @@ -194,7 +194,7 @@ export default defineConfig({ }); ``` -For all available options, see the [Vite Plugin documentation](/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart/). +By default, this plugin manages source map uploads and automatically instruments middlewares for tracing. For all available options, see the [Vite Plugin documentation](/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart/). #### Moving the Sentry server config file for production usage From 4fc5911f471911042eafcf4737dd0a4f0f6f01a6 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Tue, 3 Feb 2026 13:56:15 +0100 Subject: [PATCH 2/3] Update docs/platforms/javascript/guides/tanstackstart-react/index.mdx Co-authored-by: Sarah Mischinger --- docs/platforms/javascript/guides/tanstackstart-react/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx index fd1f1d888eb40..568ff96a89837 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/index.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/index.mdx @@ -194,7 +194,7 @@ export default defineConfig({ }); ``` -By default, this plugin manages source map uploads and automatically instruments middlewares for tracing. For all available options, see the [Vite Plugin documentation](/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart/). +By default, this plugin manages source map uploads. When tracing is enabled, it also automatically instruments middlewares for tracing. For all available options, see the [Vite Plugin documentation](/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart/). #### Moving the Sentry server config file for production usage From d7ac111dd075f6b094385fd5f7801718907043c4 Mon Sep 17 00:00:00 2001 From: Nicolas Hrubec Date: Thu, 5 Feb 2026 10:50:53 +0100 Subject: [PATCH 3/3] Update docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx Co-authored-by: Alex Krawiec --- .../guides/tanstackstart-react/features/sentryTanstackStart.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx b/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx index 0b2b7c0bf8666..eab8efdc4f88c 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx @@ -51,7 +51,7 @@ export default defineConfig({ The plugin passes through all options to the underlying [`@sentry/vite-plugin`](/platforms/javascript/sourcemaps/uploading/vite/). See the [Sentry Vite Plugin documentation](/platforms/javascript/sourcemaps/uploading/vite/) for the full list of available options. -Additionally, the plugin, by default, automatically instruments all TanStack Start middlewares for tracing. To disable this behavior: +Additionally, the plugin automatically instruments all TanStack Start middlewares for tracing by default. To disable this behavior: ```typescript {filename:vite.config.ts} sentryTanstackStart({