diff --git a/docs/platforms/android/troubleshooting/index.mdx b/docs/platforms/android/troubleshooting/index.mdx index f3a6786fae9809..b9fa8464e5d991 100644 --- a/docs/platforms/android/troubleshooting/index.mdx +++ b/docs/platforms/android/troubleshooting/index.mdx @@ -199,7 +199,7 @@ If you set up the Sentry SDK and it's not sending any data to Sentry: - Check that you have configured a DSN and that you are passing it to the `dsn` option in `SentryAndroid.init()` or `AndroidManifest`. - When a crash happens or the app closes, the system allows only a short time to handle it before terminating the process. The SDK might not have enough time to send the event, spans, profile, or replay data. In these cases, simply relaunching the app should allow the SDK to send the remaining data. -- An ad-blocker (e.g. [DuckDuckGo's App Tracking Protection](https://duckduckgo.com/duckduckgo-help-pages/p-app-tracking-protection/what-is-app-tracking-protection)) or network restrictions might be preventing the SDK from reaching Sentry's servers. As a workaround, you can use [tunneling](/platforms/javascript/troubleshooting/#using-the-tunnel-option) to proxy Sentry events through your own server. Then you can add the [proxy option](/platforms/android/configuration/options/#proxy) to your SDK configuration. +- An ad-blocker (e.g. [DuckDuckGo's App Tracking Protection](https://duckduckgo.com/duckduckgo-help-pages/p-app-tracking-protection/what-is-app-tracking-protection)) or network restrictions might be preventing the SDK from reaching Sentry's servers. As a workaround, you can use [tunneling](/platforms/javascript/configuration/tunneling/) to proxy Sentry events through your own server. Then you can add the [proxy option](/platforms/android/configuration/options/#proxy) to your SDK configuration. - Set `debug: true` in the `SentryAndroid.init()` or the manifest options and observe your Logcat output when you start your application. The SDK may tell you why it is not sending any data. - Check the [Stats](https://sentry.io/orgredirect/organizations/:orgslug/stats/) and [Subscription](https://sentry.io/orgredirect/organizations/:orgslug/settings/billing/overview/) pages in Sentry. You may be out of quota. diff --git a/docs/platforms/dotnet/guides/aspnetcore/index.mdx b/docs/platforms/dotnet/guides/aspnetcore/index.mdx index d8301dda91873d..37cc563421f902 100644 --- a/docs/platforms/dotnet/guides/aspnetcore/index.mdx +++ b/docs/platforms/dotnet/guides/aspnetcore/index.mdx @@ -261,7 +261,7 @@ Opt-in to capture values from [System.Diagnostic.Activity](https://github.com/do ### Tunnel -If events are being logged to Sentry from the client-side, then you should use a [tunnel](/platforms/javascript/troubleshooting/#using-the-tunnel-option). +If events are being logged to Sentry from the client-side, then you should use a [tunnel](/platforms/javascript/configuration/tunneling/). A tunnel is an HTTP endpoint that acts as a proxy between Sentry and your application. Because you control this server, there is no risk of any requests sent to it being blocked. diff --git a/docs/platforms/javascript/common/configuration/integrations/servetunnel.mdx b/docs/platforms/javascript/common/configuration/integrations/servetunnel.mdx new file mode 100644 index 00000000000000..cad275479ee705 --- /dev/null +++ b/docs/platforms/javascript/common/configuration/integrations/servetunnel.mdx @@ -0,0 +1,81 @@ +--- +title: ServeTunnel +description: "Serves a tunnel on your server so Sentry browser SDK events reach Sentry through your own origin, past ad blockers." +supportedCategories: + - server +--- + + + + + + + + + + + + + +_Import name: `Sentry.serveTunnelIntegration`_ + +This integration serves the tunnel that the browser SDK uses when you set `tunnel: true`. The tunnel forwards the browser's events to Sentry, so ad blockers don't drop them. To set it up, see Tunneling. + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], +}); +``` + +## Options + +Most apps don't need any of these options. + +### `allowedDsns` + +_Type: `string[]`_ + +DSNs to forward besides the server's own. Use this when the browser uses a different DSN than the server. The server's own DSN is always allowed. + +```javascript +Sentry.serveTunnelIntegration({ + allowedDsns: ["___PUBLIC_DSN___"], +}); +``` + +### `path` + +_Type: `string`_ + +A fixed tunnel path instead of the one derived from the DSN. The SDK serves it as written, without the base path. Set the same path in the browser, as described in Using a Fixed Path. + +### `basePath` + +_Type: `string`_ + +The path prefix your app is served under, for example `/docs`. The SDK reads it from your framework config, so you only need this option when it can't. Set the same value in the browser `tunnel` option. + +### `intercept` + +_Type: `boolean`_ +_Default: `true`_ + +Whether the SDK answers tunnel requests before they reach your app. Set it to `false` to answer them from your own code with `handleTunnelRequestIfMatched`, for example behind your own middleware. Tunnel requests still don't show up in your traces: + +```javascript +import express from "express"; +import * as Sentry from "@sentry/node"; + +const app = express(); + +app.use( + (req, res, next) => Sentry.handleTunnelRequestIfMatched(req, res) ?? next() +); +``` + + + +On Vercel, the route that `withSentryConfig` adds at build time still answers tunnel requests. + + diff --git a/docs/platforms/javascript/common/configuration/options.mdx b/docs/platforms/javascript/common/configuration/options.mdx index a5ae09f8897e8d..04d50a1dccbe33 100644 --- a/docs/platforms/javascript/common/configuration/options.mdx +++ b/docs/platforms/javascript/common/configuration/options.mdx @@ -83,14 +83,51 @@ Environments are case-sensitive. The environment name can't contain newlines, sp + + -Sets the URL that will be used to transport captured events. This can be used to work around ad-blockers or to have more granular control over events sent to Sentry. Adding your DSN is still required when using this option so necessary attributes can be set on the generated Sentry data. This option **requires the implementation** of a custom server endpoint. Learn more and find examples in [Dealing with Ad-Blockers](/platforms/javascript/troubleshooting/#dealing-with-ad-blockers). +Sets the URL that will be used to transport captured events. This can be used to work around ad-blockers or to have more granular control over events sent to Sentry. Adding your DSN is still required when using this option so necessary attributes can be set on the generated Sentry data. This option **requires the implementation** of a custom server endpoint. Learn more and find examples in Tunneling. + +The endpoint must forward only the request body to Sentry and accept only your own DSNs. Learn more in Setting Up the Tunnel Manually. + + + + + + + + + +Where the browser SDK sends captured events instead of the Sentry ingest URL. Use it to work around ad blockers or to control which events reach Sentry. The DSN is still required, so the SDK can initialize correctly and forward the Sentry ingest URL to the tunnel. + +The `tunnel` option can be set to the following values: + +- A string, a URL or a path, sends events to that endpoint. You serve the endpoint yourself, as described in Setting Up the Tunnel Manually. +- `true` sends events to the managed tunnel, a path on your own origin derived from the DSN. Your server needs to serve it, as described in Setting Up the Tunnel. +- An object works like `true`, with these options: + - `path`: a fixed tunnel path, used as written without the base path. + - `basePath`: the path prefix your app is served under, for example `/docs`. Most framework SDKs set it for you. + - `trailingSlash`: appends a trailing slash to the tunnel path, for servers that redirect paths without one. + + + +`true` and the object are available since version `11.12.0`. + + + + + +`true` and the object are available since version `11.13.0`. + + -The endpoint must forward only the request body to Sentry and accept only your own DSNs. Learn more in [Using the `tunnel` Option](/platforms/javascript/troubleshooting/#using-the-tunnel-option). +On the server, `tunnel` only takes a URL. It's where the server SDK sends its own events, and it's independent from `serveTunnelIntegration`. + + @@ -108,7 +145,7 @@ Set to `false` to opt out, for example, when using a custom `tunnel` or when run Controls which categories of data the SDK collects automatically. All fields are optional. - By default the SDK collects rich debugging context (including user identity, request/response bodies, and generative AI content) and scrubs values whose keys match the built-in sensitive denylist (`auth`, `token`, `password`, and similar). +By default the SDK collects rich debugging context (including user identity, request/response bodies, and generative AI content) and scrubs values whose keys match the built-in sensitive denylist (`auth`, `token`, `password`, and similar). @@ -299,21 +336,35 @@ The callback gets a second argument (called a "hint") which contains the origina - The JavaScript SDK uses a transport to send events to Sentry. - Transports will drop an event if it fails to send due to a lack of connection. + The JavaScript SDK uses a transport to send events to Sentry. Transports will + drop an event if it fails to send due to a lack of connection. In the browser, a `fetch`-based transport is used by default. - - - On the server, a `https`-based transport is used by default. - + + + On the server, a `https`-based transport is used by default. + - + A `fetch`-based transport is used by default. @@ -551,7 +602,8 @@ The `samplingContext` object passed to the function has the following properties - `name`: The name of the span as it was started. - `attributes`: The initial attributes of the span. - - `location`: The current page or worker URL, if available. Provided by the BrowserTracing integration. + - `location`: The current page or worker URL, if available. Provided by the + BrowserTracing integration. - `normalizedRequest`: Request information of the currently active HTTP @@ -605,7 +657,7 @@ The SDK skips storage operation spans for Durable Object keys whose names start Controls which bindings on `env` receive tracing data over [RPC calls](https://developers.cloudflare.com/workers/runtime-apis/bindings/service-bindings/rpc/) to Durable Objects and other Workers. RPC has no headers, so the SDK appends the trace context as a trailing argument that an instrumented receiver strips again before your method runs. -String entries must match a binding name exactly, so `"DB"` matches `"DB"` but not `"MY_DB"`. Use a regular expression for pattern matching. +String entries must match a binding name exactly, so `"DB"` matches `"DB"` but not `"MY_DB"`. Use a regular expression for pattern matching. This option controls outgoing RPC trace propagation, which is disabled by default. Add bindings to enable it for those receivers. Sentry-instrumented receivers automatically continue incoming traces without configuring this option. @@ -882,7 +934,8 @@ Controls whether the SDK installs runtime hooks that instrument supported depend - On SDK versions below `10.71.0`, logs are opt-in. Set `enableLogs: true` in your `Sentry.init` to send them. + On SDK versions below `10.71.0`, logs are opt-in. Set `enableLogs: true` in + your `Sentry.init` to send them. @@ -894,8 +947,8 @@ This function is called with a log object, and can return a modified log object, ## Metrics Options - **Note:** For Electron, metric options apply to the process where these options - are set. + **Note:** For Electron, metric options apply to the process where these + options are set. diff --git a/docs/platforms/javascript/common/configuration/tunneling.mdx b/docs/platforms/javascript/common/configuration/tunneling.mdx new file mode 100644 index 00000000000000..1c74fd36b06a51 --- /dev/null +++ b/docs/platforms/javascript/common/configuration/tunneling.mdx @@ -0,0 +1,312 @@ +--- +title: Tunneling +sidebar_order: 35 +description: "Send browser SDK events to Sentry through your own server, so ad blockers don't drop them." +supportedCategories: + - browser + - server +--- + +Ad blockers often block requests to Sentry, so your events never arrive. A tunnel is an endpoint on your own origin that forwards events to Sentry, and ad blockers let requests to your own origin through. + +![Without a tunnel, ad blockers block requests to Sentry. With a tunnel, the browser sends them to your own origin, which forwards them to Sentry.](/img/tunnel-flow.svg) + +## Setting Up the Tunnel + + + + + + + + + + + + + +The browser sends its events to a path on your own origin derived from the DSN, for example `/qpo967`, and your server forwards them to Sentry. + +If your server doesn't run a Sentry JavaScript SDK, or you want the tunnel as a route in your app, [set up the tunnel manually](#setting-up-the-tunnel-manually) instead. + + + The tunnel only works while the server SDK is enabled. Without a DSN, or with + `enabled: false`, the browser's events are lost. + + + + +### Turn On the Tunnel in the Browser + +Set `tunnel: true` in your browser `Sentry.init`: + + + + + +If you use the `tunnelRoute` option, remove it from `withSentryConfig`. + + + + + +If you use the `tunnelRoute` option, remove it from `sentryTanstackStart`. + + + +### Add the Integration to Your Server + +Add `serveTunnelIntegration` to your server `Sentry.init`: + + + + + +Use the server that serves your app. The tunnel is on the same origin as your page. If a separate dev server like Vite serves your page locally, use a [fixed path](#using-a-fixed-path) and proxy it to your server. + + + + + +No additional setup is needed. The server SDK answers tunnel requests before they reach your app, so your routes and middleware don't need any changes. + + + + + +On Vercel, `withSentryConfig` adds the route for the tunnel at build time. + + + + + +The SDK answers tunnel requests when you load it with `NODE_OPTIONS`, as described in the [setup guide](/platforms/javascript/guides/aws-lambda/install/npm/), or wrap your handler with `Sentry.wrapHandler`. If you only call `Sentry.init` inside your handler module, tunnel requests reach your handler instead. + + + + + +Call `Sentry.init` before you create your server, for example by preloading your instrument file with `bun --preload`. A server created before `init` doesn't answer tunnel requests. + + + + + +Call `Sentry.init` before you create your server, by importing your instrument file before anything else. A server created before `init` doesn't answer tunnel requests. + + + + + +If your Worker serves static assets with a single-page app fallback, Cloudflare answers the tunnel request before your Worker runs. Run your Worker first: + +```jsonc {filename:wrangler.jsonc} +{ + "assets": { + "not_found_handling": "single-page-application", + "run_worker_first": true, + }, +} +``` + + + + + +The SDK can't answer tunnel requests on Azure Functions, because each function only gets the requests for its own route. Set `intercept: false`, and answer them with `handleTunnelRequestIfMatched` in a function with a catch-all route: + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration({ intercept: false })], +}); +``` + + + +To check the tunnel, trigger an event and look in your browser's Network tab for a `POST` to a path on your own origin that returns `200`. + + + +### Using a Different DSN in the Browser + +The server answers one path per DSN it allows. If your browser uses a different DSN than your server, add it to `allowedDsns`: + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [ + Sentry.serveTunnelIntegration({ + allowedDsns: [""], + }), + ], +}); +``` + +### Using a Fixed Path + + + +To serve the tunnel at a path you choose, set it on both sides: + +```javascript {tabTitle:Browser} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: "/monitoring", +}); +``` + +```javascript {tabTitle:Server} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration({ path: "/monitoring" })], +}); +``` + +### What the Tunnel Forwards + +- Only events for your server's DSN and your `allowedDsns`, so the tunnel can't be used as an open proxy. +- The visitor's real IP address, without cookies or auth headers. + + + +See `serveTunnelIntegration` for all options. + + + +## Setting Up the Tunnel Manually + +The browser setup works the same as for the automatic tunnel, except that you point the browser SDK to the tunnel path you want to use, for example `/tunnel`: + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: "/tunnel", +}); +``` + +How you serve that path depends on your server. If it runs a Sentry JavaScript SDK, you can use the tunnel helpers it comes with. Otherwise, write the endpoint yourself. + +### With a Sentry JavaScript SDK on Your Server + +Keep `serveTunnelIntegration` on your server. Set `intercept: false` so your route answers the requests instead of the SDK, and set `path` to your route so tunnel requests stay out of your traces: + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [ + Sentry.serveTunnelIntegration({ intercept: false, path: "/tunnel" }), + ], +}); +``` + +Answer the requests at your endpoint with `handleTunnelRequest`, which forwards them to Sentry: + + + +To forward a different browser DSN, add it to `allowedDsns` on the integration, as described in [Using a Different DSN in the Browser](#using-a-different-dsn-in-the-browser). `handleTunnelRequest` uses the same list. + +### On Other Servers + +Your endpoint must: + +- Forward the request body to Sentry, without cookies or auth headers. +- Accept only envelopes for your own DSNs, so it can't be used as an open proxy. +- Send the envelope only to the host of that DSN. + + + +```csharp {tabTitle:ASP.NET Core} +// This functionality is now built-in to the Sentry.AspNetCore package. +// See https://docs.sentry.io/platforms/dotnet/guides/aspnetcore/#tunnel +// docs for more information. + +// This example shows how you could implement it yourself: + +using System; +using System.Collections.Generic; +using System.IO; +using System.Net.Http; +using System.Text.Json; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; + +// Change host appropriately if you run your own Sentry instance. +const string host = "sentry.io"; +// Set knownProjectIds to a list with your Sentry project IDs which you +// want to accept through this proxy. +var knownProjectIds = new HashSet() { }; + +var client = new HttpClient(); +WebHost.CreateDefaultBuilder(args).Configure(a => + a.Run(async context => + { + context.Request.EnableBuffering(); + using var reader = new StreamReader(context.Request.Body); + var header = await reader.ReadLineAsync(); + var headerJson = JsonSerializer.Deserialize>(header); + if (headerJson.TryGetValue("dsn", out var dsnString) + && Uri.TryCreate(dsnString.ToString(), UriKind.Absolute, out var dsn)) + { + var projectId = dsn.AbsolutePath.Trim('/'); + if (knownProjectIds.Contains(projectId) && string.Equals(dsn.Host, host, StringComparison.OrdinalIgnoreCase)) { + context.Request.Body.Position = 0; + await client.PostAsync($"https://{dsn.Host}/api/{projectId}/envelope/", + new StreamContent(context.Request.Body)); + } + } + })).Build().Run(); +``` + +```ruby {tabTitle:Rails} +require 'net/http' + +class HomeController < ApplicationController + + SENTRY_HOST = "oXXXXXX.ingest.sentry.io" + SENTRY_PROJECT_IDS = ["123456"] + + def tunnel + envelope = request.body.read + piece = envelope.split("\n").first + header = JSON.parse(piece) + dsn = URI.parse(header['dsn']) + project_id = dsn.path.tr('/', '') + + raise "Invalid sentry hostname: #{dsn.hostname}" if dsn.hostname != SENTRY_HOST + raise "Invalid sentry project id: #{project_id}" unless SENTRY_PROJECT_IDS.include?(project_id) + + upstream_sentry_url = "https://#{SENTRY_HOST}/api/#{project_id}/envelope/" + Net::HTTP.post(URI(upstream_sentry_url), envelope) + + head(:ok) + rescue => e + # handle exception in your preferred style, + # e.g. by logging or forwarding to server Sentry project + Rails.logger.error('error tunneling to sentry') + end + +end +``` + + + +#### Credentials on Tunnel Requests + +The browser sends cookies and HTTP authentication to an endpoint on the same origin as your app. If your endpoint forwards request headers, it sends them on to Sentry. + +Forward only the request body, or tell the browser to send no credentials: + +```javascript +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: "/tunnel", + transportOptions: { + fetchOptions: { credentials: "omit" }, + }, +}); +``` + +If a layer in front of your tunnel requires credentials, like Vercel Deployment Protection or Cloudflare Access, keep sending them and forward only the request body. diff --git a/docs/platforms/javascript/common/troubleshooting/img/tunnel.png b/docs/platforms/javascript/common/troubleshooting/img/tunnel.png deleted file mode 100644 index e0417e91203bdc..00000000000000 Binary files a/docs/platforms/javascript/common/troubleshooting/img/tunnel.png and /dev/null differ diff --git a/docs/platforms/javascript/common/troubleshooting/index.mdx b/docs/platforms/javascript/common/troubleshooting/index.mdx index e97f66b03a2b28..069439f628f5a9 100644 --- a/docs/platforms/javascript/common/troubleshooting/index.mdx +++ b/docs/platforms/javascript/common/troubleshooting/index.mdx @@ -41,6 +41,7 @@ If you set up the Sentry SDK and it's not sending any data to Sentry: If you update your Sentry SDK to a new major version, you might encounter breaking changes that need some adaption on your end. + Check out our migration guide to learn everything you need @@ -126,7 +127,7 @@ Since Chrome 142, a page needs the user's permission before it can send requests | public | private network or localhost | Permission prompt | | private network | localhost | Permission prompt | -This affects a publicly hosted app reporting to a self-hosted Sentry that is only reachable on an internal address, and Spotlight enabled on a non-localhost page. To avoid the prompt, expose Sentry on a public hostname, or use the [`tunnel` option](#using-the-tunnel-option) to send events through your app's own origin. +This affects a publicly hosted app reporting to a self-hosted Sentry that is only reachable on an internal address, and Spotlight enabled on a non-localhost page. To avoid the prompt, expose Sentry on a public hostname, or use a tunnel to send events through your app's own origin. @@ -213,175 +214,10 @@ Chrome then ignores the SDK stack frames when debugging. -When you are using our CDN, ad-blocking or script-blocking extensions may prevent our SDK from being fetched and initialized properly. Because of this, any call to the SDKs API will fail and may cause your application to behave unexpectedly. - -Additionally, even when the SDK is downloaded and initialized correctly, Sentry endpoints that need to receive captured data may be blocked as well. This prevents any error reports, sessions health, or performance data from being delivered, making it effectively unavailable in [sentry.io](https://sentry.io). - -Furthermore, some browsers, like [Brave](https://brave.com/), have built-in ad-blockers that may block requests sent to our endpoint. Even if users deactivate your domain from blocking, Brave might continue to block [requests made from service workers](https://github.com/getsentry/sentry/issues/47912#issuecomment-1573714875). - -You can work around our CDN bundles being blocked by [using our NPM packages](#using-the-npm-package) and bundling our SDK with your app. However, the endpoint blockage can only be resolved by using a tunnel as explained below. - - - - - - - -The Sentry Next.js SDK has a separate option to make setting up tunnels very -straight-forward, allowing you to skip the setup below. See -`tunnelRoute` to learn how to set up tunneling on Next.js. - -If you do not want to configure `tunnelRoute`, you can follow the guide below. - - - -A tunnel is an HTTP endpoint that acts as a proxy between Sentry and your application. Because you control this server, there is no risk of any requests sent to it being blocked. When the endpoint lives under the same origin (although it does not have to in order for the tunnel to work), the browser will not treat any requests to the endpoint as a third-party request. As a result, these requests will have different security measures applied which, by default, don't trigger ad-blockers. A quick summary of the flow can be found below. - -![Tunnel Flow](./img/tunnel.png) - -Starting with version `6.7.0` of the JavaScript SDK, you can use the `tunnel` option to tell the SDK to deliver events to the configured URL, instead of using the DSN. This allows the SDK to remove `sentry_key` from the query parameters, which is one of the main reasons ad-blockers prevent sending events in the first place. This option also stops the SDK from sending preflight requests, which was one of the requirements that necessitated sending the `sentry_key` in the query parameters. - -To enable the `tunnel` option, provide either a relative or an absolute URL in your `Sentry.init` call. When you use a relative URL, it's relative to the current origin, and this is the form that we recommend. Using a relative URL will not trigger a preflight CORS request, so no events will be blocked, because the ad-blocker will not treat these events as third-party requests. When using tunneling with server-side SDKs like `@sentry/node` or `@sentry/bun` you must provide an absolute URL. - -```javascript -Sentry.init({ - dsn: "___PUBLIC_DSN___", - tunnel: "/tunnel", -}); -``` - -Once configured, all events will be sent to the `/tunnel` endpoint. This solution, however, requires an additional configuration on the server, as the events now need to be parsed and redirected to Sentry. - -Your tunnel endpoint must: - -- Forward only the request body to Sentry, without the request headers. -- Accept only envelopes whose DSN is on a list of allowed DSNs. Otherwise, anyone can use your endpoint to send requests to other servers. -- Send the envelope only to the host of that DSN. - -On a JavaScript server with Fetch API `Request` and `Response` objects, `handleTunnelRequest` from `@sentry/core` (SDK version `10.40.0` and later) does this for you. Starting with versions `10.77.1` (v10) and `11.9.0` (v11), it also rejects requests larger than 20 MiB. - -```javascript -import { handleTunnelRequest } from "@sentry/core"; - -export async function POST(request) { - return handleTunnelRequest({ - request, - allowedDsns: ["___PUBLIC_DSN___"], - }); -} -``` - -If you implement the endpoint yourself, here's an example for your server component: - -```csharp - -// This functionality is now built-in to the Sentry.AspNetCore package. -// See https://docs.sentry.io/platforms/dotnet/guides/aspnetcore/#tunnel -// docs for more information. - -// This example shows how you could implement it yourself: - -using System; -using System.Collections.Generic; -using System.IO; -using System.Net.Http; -using System.Text.Json; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; - -// Change host appropriately if you run your own Sentry instance. -const string host = "sentry.io"; -// Set knownProjectIds to a list with your Sentry project IDs which you -// want to accept through this proxy. -var knownProjectIds = new HashSet() { }; - -var client = new HttpClient(); -WebHost.CreateDefaultBuilder(args).Configure(a => - a.Run(async context => - { - context.Request.EnableBuffering(); - using var reader = new StreamReader(context.Request.Body); - var header = await reader.ReadLineAsync(); - var headerJson = JsonSerializer.Deserialize>(header); - if (headerJson.TryGetValue("dsn", out var dsnString) - && Uri.TryCreate(dsnString.ToString(), UriKind.Absolute, out var dsn)) - { - var projectId = dsn.AbsolutePath.Trim('/'); - if (knownProjectIds.Contains(projectId) && string.Equals(dsn.Host, host, StringComparison.OrdinalIgnoreCase)) { - context.Request.Body.Position = 0; - await client.PostAsync($"https://{dsn.Host}/api/{projectId}/envelope/", - new StreamContent(context.Request.Body)); - } - } - })).Build().Run(); -``` - -```ruby -require 'net/http' - -class HomeController < ApplicationController - - SENTRY_HOST = "oXXXXXX.ingest.sentry.io" - SENTRY_PROJECT_IDS = ["123456"] - - def tunnel - envelope = request.body.read - piece = envelope.split("\n").first - header = JSON.parse(piece) - dsn = URI.parse(header['dsn']) - project_id = dsn.path.tr('/', '') - - raise "Invalid sentry hostname: #{dsn.hostname}" if dsn.hostname != SENTRY_HOST - raise "Invalid sentry project id: #{project_id}" unless SENTRY_PROJECT_IDS.include?(project_id) - - upstream_sentry_url = "https://#{SENTRY_HOST}/api/#{project_id}/envelope/" - Net::HTTP.post(URI(upstream_sentry_url), envelope) - - head(:ok) - rescue => e - # handle exception in your preferred style, - # e.g. by logging or forwarding to server Sentry project - Rails.logger.error('error tunneling to sentry') - end - -end -``` - -```javascript -const SENTRY_HOST = "oXXXXXX.ingest.sentry.io"; -const SENTRY_PROJECT_IDS = ["123456"]; - -export const postAction = async ({ request }) => { - try { - const envelopeBytes = await request.arrayBuffer(); - const envelope = new TextDecoder().decode(envelopeBytes); - const piece = envelope.split("\n")[0]; - const header = JSON.parse(piece); - const dsn = new URL(header["dsn"]); - const project_id = dsn.pathname?.replace("/", ""); - - if (dsn.hostname !== SENTRY_HOST) { - throw new Error(`Invalid sentry hostname: ${dsn.hostname}`); - } - - if (!project_id || !SENTRY_PROJECT_IDS.includes(project_id)) { - throw new Error(`Invalid sentry project id: ${project_id}`); - } - - const upstream_sentry_url = `https://${SENTRY_HOST}/api/${project_id}/envelope/`; - await fetch(upstream_sentry_url, { method: "POST", body: envelopeBytes }); - - return json({}, { status: 200 }); - } catch (e) { - console.error("error tunneling to sentry", e); - return json({ error: "error tunneling to sentry" }, { status: 500 }); - } -}; -``` +Ad-blocking or script-blocking extensions may block Sentry in two ways: -If your use-case is related to the SDK package itself being blocked, any of the following solutions will help you resolve this issue. +- They block requests to Sentry's ingest endpoints, so captured data never reaches [sentry.io](https://sentry.io). Send events through your own server to avoid this, as described in Tunneling. +- When you load the SDK from our CDN, they may prevent it from being fetched and initialized. Any call to the SDK's API then fails and may cause your application to behave unexpectedly. Any of the following solutions resolves this. ### Using the NPM Package @@ -441,32 +277,6 @@ If you would like to copy and paste the snippet directly, here it is minified: - - -The browser SDK doesn't set the [`credentials`](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials) option of `fetch`. With the default value `same-origin`, the browser sends credentials (cookies and HTTP authentication) to a tunnel on the same origin as your app. A tunnel that forwards request headers sends these credentials to Sentry. - - - -The Next.js `tunnelRoute` option handles this for you. See `tunnelRoute`. - - - -Forward only the request body, or tell the browser to send no credentials: - -```javascript -Sentry.init({ - dsn: "___PUBLIC_DSN___", - tunnel: "/tunnel", - transportOptions: { - fetchOptions: { credentials: "omit" }, - }, -}); -``` - -If a layer in front of your tunnel requires credentials (for example, Vercel Deployment Protection, Cloudflare Access, or HTTP Basic authentication), it rejects requests without credentials. Keep the default in this case, and make sure that your tunnel doesn't forward the request headers. - - - diff --git a/docs/platforms/javascript/common/troubleshooting/tunnel.excalidraw b/docs/platforms/javascript/common/troubleshooting/tunnel.excalidraw deleted file mode 100644 index 84df813aa487a4..00000000000000 --- a/docs/platforms/javascript/common/troubleshooting/tunnel.excalidraw +++ /dev/null @@ -1,733 +0,0 @@ -{ - "type": "excalidraw", - "version": 2, - "source": "https://excalidraw.com", - "elements": [ - { - "id": "UIvrjskrM0uL719JlZUWm", - "type": "rectangle", - "x": 505.077629626917, - "y": 392.80633888840697, - "width": 154.77325439453125, - "height": 85.8480224609375, - "angle": 6.280157066148822, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", - "seed": 1984418288, - "version": 179, - "versionNonce": 530488080, - "isDeleted": false, - "boundElementIds": [ - "9ATYkhoMY-edTev1CjJTX" - ] - }, - { - "id": "S-Xs12Nj6bUseGSwNHekP", - "type": "text", - "x": 517.1248168945312, - "y": 422.3180236816406, - "width": 129, - "height": 24, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", - "seed": 324539376, - "version": 275, - "versionNonce": 595090928, - "isDeleted": false, - "boundElementIds": null, - "text": "example.com", - "fontSize": 20, - "fontFamily": 3, - "textAlign": "left", - "verticalAlign": "top", - "baseline": 19 - }, - { - "id": "4NwKJ9gZFY4jiFlJBfXmY", - "type": "text", - "x": 887.371236929465, - "y": 423.1364711701868, - "width": 152, - "height": 24, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", - "seed": 375742224, - "version": 95, - "versionNonce": 892909840, - "isDeleted": false, - "boundElementIds": null, - "text": "sentry.io/api", - "fontSize": 20, - "fontFamily": 3, - "textAlign": "center", - "verticalAlign": "top", - "baseline": 19 - }, - { - "type": "rectangle", - "version": 318, - "versionNonce": 2114565392, - "isDeleted": false, - "id": "HMNMfKDlSMjCAJqsXthSj", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 6.280157066148822, - "x": 873.0930571133977, - "y": 392.42500818485576, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 180.55635963213484, - "height": 85.84802246093749, - "seed": 1455501072, - "groupIds": [], - "strokeSharpness": "sharp", - "boundElementIds": [ - "9ATYkhoMY-edTev1CjJTX" - ] - }, - { - "id": "9ATYkhoMY-edTev1CjJTX", - "type": "arrow", - "x": 667.64111328125, - "y": 435.7931365966797, - "width": 201.0567626953125, - "height": 0.39117431640625, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 511047152, - "version": 87, - "versionNonce": 1825548272, - "isDeleted": false, - "boundElementIds": null, - "points": [ - [ - 0, - 0 - ], - [ - 201.0567626953125, - 0.39117431640625 - ] - ], - "lastCommittedPoint": null, - "startBinding": { - "elementId": "UIvrjskrM0uL719JlZUWm", - "focus": -0.0023767380451787654, - "gap": 7.789648581535175 - }, - "endBinding": { - "elementId": "HMNMfKDlSMjCAJqsXthSj", - "focus": -0.023505333797829507, - "gap": 4.3972765083891545 - }, - "startArrowhead": null, - "endArrowhead": "arrow" - }, - { - "id": "ppLe-8CIIl5uAO6JmfAZB", - "type": "text", - "x": 727.1694946289062, - "y": 383.616455078125, - "width": 82, - "height": 24, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", - "seed": 107902448, - "version": 144, - "versionNonce": 1196625680, - "isDeleted": false, - "boundElementIds": null, - "text": "request", - "fontSize": 20, - "fontFamily": 3, - "textAlign": "center", - "verticalAlign": "top", - "baseline": 19 - }, - { - "id": "OlpHCe3tCQlk2OxnN9QjU", - "type": "line", - "x": 788.7083435058594, - "y": 416.19171142578125, - "width": 41.07769775390625, - "height": 39.594024658203125, - "angle": 0, - "strokeColor": "#c92a2a", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 4, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 734146544, - "version": 93, - "versionNonce": 1446948112, - "isDeleted": false, - "boundElementIds": null, - "points": [ - [ - 0, - 0 - ], - [ - -41.07769775390625, - 39.594024658203125 - ] - ], - "lastCommittedPoint": null, - "startBinding": null, - "endBinding": null, - "startArrowhead": null, - "endArrowhead": null - }, - { - "type": "line", - "version": 150, - "versionNonce": 874146800, - "isDeleted": false, - "id": "Ai8ZEWKwTVbQVD5_chzj_", - "fillStyle": "hachure", - "strokeWidth": 4, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 1.5707963267948957, - "x": 788.7083435058594, - "y": 416.19171142578125, - "strokeColor": "#c92a2a", - "backgroundColor": "transparent", - "width": 41.07769775390625, - "height": 39.594024658203125, - "seed": 1172177392, - "groupIds": [], - "strokeSharpness": "round", - "boundElementIds": [], - "startBinding": null, - "endBinding": null, - "lastCommittedPoint": null, - "startArrowhead": null, - "endArrowhead": null, - "points": [ - [ - 0, - 0 - ], - [ - -41.07769775390625, - 39.594024658203125 - ] - ] - }, - { - "id": "3ac8LM46gxbPKY0c4N86q", - "type": "text", - "x": 735.1694946289062, - "y": 463.7354736328125, - "width": 66, - "height": 19, - "angle": 0, - "strokeColor": "#c92a2a", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 4, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", - "seed": 2011934992, - "version": 82, - "versionNonce": 33983248, - "isDeleted": false, - "boundElementIds": null, - "text": "blocked", - "fontSize": 16, - "fontFamily": 3, - "textAlign": "center", - "verticalAlign": "top", - "baseline": 15 - }, - { - "type": "rectangle", - "version": 867, - "versionNonce": 273024272, - "isDeleted": false, - "id": "_TgLxb-0SKW1r8br7irXg", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 6.280157066148822, - "x": 458.5527590422146, - "y": 750.3831516325477, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 154.77325439453125, - "height": 85.8480224609375, - "seed": 753737200, - "groupIds": [], - "strokeSharpness": "sharp", - "boundElementIds": [ - "yNSv_EBWla0C9EDMLzinM", - "qas_wjLVNzpAothTDWd5f", - "iF-rp9T_ZPeLgcRtEXS52" - ] - }, - { - "type": "text", - "version": 950, - "versionNonce": 1517819152, - "isDeleted": false, - "id": "Z5T_6DpmqVPSV4BzEdZu9", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 0, - "x": 470.59994630982885, - "y": 779.8948364257812, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 129, - "height": 24, - "seed": 980416784, - "groupIds": [], - "strokeSharpness": "sharp", - "boundElementIds": [], - "fontSize": 20, - "fontFamily": 3, - "text": "example.com", - "baseline": 19, - "textAlign": "left", - "verticalAlign": "top" - }, - { - "type": "text", - "version": 774, - "versionNonce": 948667376, - "isDeleted": false, - "id": "-3Gc3U08jy2n9xOL73DLi", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 0, - "x": 925.9906534541376, - "y": 780.7132839143273, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 152, - "height": 24, - "seed": 1601429488, - "groupIds": [], - "strokeSharpness": "sharp", - "boundElementIds": [], - "fontSize": 20, - "fontFamily": 3, - "text": "sentry.io/api", - "baseline": 19, - "textAlign": "center", - "verticalAlign": "top" - }, - { - "type": "rectangle", - "version": 1006, - "versionNonce": 556883728, - "isDeleted": false, - "id": "vghwtemRqVSCbhnZ8jAKP", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 6.280157066148822, - "x": 911.7124736380703, - "y": 750.0018209289964, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 180.55635963213484, - "height": 85.84802246093749, - "seed": 1781421840, - "groupIds": [], - "strokeSharpness": "sharp", - "boundElementIds": [ - "iF-rp9T_ZPeLgcRtEXS52" - ] - }, - { - "type": "text", - "version": 933, - "versionNonce": 1747063056, - "isDeleted": false, - "id": "rKX_ibTYHsqCN429GEbE9", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 0, - "x": 489.83078127076635, - "y": 689.6941375732422, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 82, - "height": 24, - "seed": 242283792, - "groupIds": [], - "strokeSharpness": "sharp", - "boundElementIds": [], - "fontSize": 20, - "fontFamily": 3, - "text": "request", - "baseline": 19, - "textAlign": "center", - "verticalAlign": "top" - }, - { - "type": "text", - "version": 1094, - "versionNonce": 797919216, - "isDeleted": false, - "id": "NLELvra1khyh9IOA53M-z", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 0, - "x": 664.1566772460936, - "y": 657.0520391572059, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 211, - "height": 24, - "seed": 1886625776, - "groupIds": [], - "strokeSharpness": "sharp", - "boundElementIds": [ - "iF-rp9T_ZPeLgcRtEXS52" - ], - "fontSize": 20, - "fontFamily": 3, - "text": "example.com/sentry", - "baseline": 19, - "textAlign": "center", - "verticalAlign": "top" - }, - { - "type": "rectangle", - "version": 1329, - "versionNonce": 389284112, - "isDeleted": false, - "id": "ZkB9q4ghdBr5h0m3OtW4h", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 6.280157066148822, - "x": 653.0265046028907, - "y": 636.571215917013, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 235.0543735822523, - "height": 85.84802246093749, - "seed": 973772560, - "groupIds": [], - "strokeSharpness": "sharp", - "boundElementIds": [ - "yNSv_EBWla0C9EDMLzinM", - "qas_wjLVNzpAothTDWd5f", - "iF-rp9T_ZPeLgcRtEXS52" - ] - }, - { - "id": "qas_wjLVNzpAothTDWd5f", - "type": "arrow", - "x": 548.2006225420531, - "y": 744.9220143186448, - "width": 96.70195645312288, - "height": 65.21242976891347, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 875285776, - "version": 938, - "versionNonce": 47485936, - "isDeleted": false, - "boundElementIds": null, - "points": [ - [ - 0, - 0 - ], - [ - 96.70195645312288, - -65.21242976891347 - ] - ], - "lastCommittedPoint": null, - "startBinding": { - "elementId": "_TgLxb-0SKW1r8br7irXg", - "focus": -0.42244125570118246, - "gap": 5.423785540158747 - }, - "endBinding": { - "elementId": "ZkB9q4ghdBr5h0m3OtW4h", - "focus": 0.6932931764174952, - "gap": 8.123998607380145 - }, - "startArrowhead": null, - "endArrowhead": "arrow" - }, - { - "id": "vX42lA5AgtkYmAbLZnYg2", - "type": "text", - "x": 669.4091796875, - "y": 606.7742309570312, - "width": 206, - "height": 19, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", - "seed": 998636304, - "version": 368, - "versionNonce": 1836641040, - "isDeleted": false, - "boundElementIds": null, - "text": "extract DSN + redirect", - "fontSize": 16, - "fontFamily": 3, - "textAlign": "center", - "verticalAlign": "top", - "baseline": 15 - }, - { - "type": "arrow", - "version": 1211, - "versionNonce": 651450352, - "isDeleted": false, - "id": "iF-rp9T_ZPeLgcRtEXS52", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 3.141592653589793, - "x": 980.168920077952, - "y": 743.9293072170412, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 85.38772423763055, - "height": 62.59385538431718, - "seed": 1398105360, - "groupIds": [], - "strokeSharpness": "round", - "boundElementIds": [], - "startBinding": { - "elementId": "ZkB9q4ghdBr5h0m3OtW4h", - "focus": -0.6898622059482384, - "gap": 6.694175421985619 - }, - "endBinding": { - "elementId": "vghwtemRqVSCbhnZ8jAKP", - "focus": 0.30197541848094406, - "gap": 6.138370424463574 - }, - "lastCommittedPoint": null, - "startArrowhead": null, - "endArrowhead": "arrow", - "points": [ - [ - 0, - 0 - ], - [ - -85.38772423763055, - -62.59385538431718 - ] - ] - }, - { - "type": "text", - "version": 1099, - "versionNonce": 1934166288, - "isDeleted": false, - "id": "0Zc2dBE4PhFguJ0Bb4663", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "angle": 0, - "x": 952.0823364257811, - "y": 689.6941375732422, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "width": 82, - "height": 24, - "seed": 1238035952, - "groupIds": [], - "strokeSharpness": "sharp", - "boundElementIds": [], - "fontSize": 20, - "fontFamily": 3, - "text": "request", - "baseline": 19, - "textAlign": "center", - "verticalAlign": "top" - }, - { - "id": "Gh32rmsbIEpRj5BEuOh1l", - "type": "text", - "x": 708.6566772460936, - "y": 685.6309204101562, - "width": 122, - "height": 19, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", - "seed": 159283984, - "version": 288, - "versionNonce": 141807600, - "isDeleted": false, - "boundElementIds": null, - "text": "(same origin)", - "fontSize": 16, - "fontFamily": 3, - "textAlign": "center", - "verticalAlign": "top", - "baseline": 15 - }, - { - "id": "MCIOOSM1cVODYmRa5KAT7", - "type": "text", - "x": 425.0358581542969, - "y": 551.8571166992188, - "width": 197, - "height": 34, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", - "seed": 1239179760, - "version": 108, - "versionNonce": 1164273424, - "isDeleted": false, - "boundElementIds": null, - "text": "With Tunnel:", - "fontSize": 28, - "fontFamily": 3, - "textAlign": "center", - "verticalAlign": "top", - "baseline": 27 - }, - { - "id": "gOzpk61c1W57ljxYY8_If", - "type": "text", - "x": 425.0358581542969, - "y": 317.0382995605469, - "width": 246, - "height": 34, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 0, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", - "seed": 334092560, - "version": 65, - "versionNonce": 385172240, - "isDeleted": false, - "boundElementIds": null, - "text": "Without Tunnel:", - "fontSize": 28, - "fontFamily": 3, - "textAlign": "center", - "verticalAlign": "top", - "baseline": 27 - } - ], - "appState": { - "gridSize": null, - "viewBackgroundColor": "#ffffff" - } -} diff --git a/docs/platforms/javascript/guides/astro/index.mdx b/docs/platforms/javascript/guides/astro/index.mdx index 8e03a67597c9bb..377dd37dd3990b 100644 --- a/docs/platforms/javascript/guides/astro/index.mdx +++ b/docs/platforms/javascript/guides/astro/index.mdx @@ -205,7 +205,7 @@ At this point, you should have integrated Sentry into your Astro application. He - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup - Set up Agent Tracing to monitor your AI systems -- Set up tunneling to avoid ad blockers blocking Sentry events +- Set up tunneling to avoid ad blockers blocking Sentry events diff --git a/docs/platforms/javascript/guides/cordova/configuration/options.mdx b/docs/platforms/javascript/guides/cordova/configuration/options.mdx index 6906a9235b5026..49fcff6cc83235 100644 --- a/docs/platforms/javascript/guides/cordova/configuration/options.mdx +++ b/docs/platforms/javascript/guides/cordova/configuration/options.mdx @@ -49,9 +49,9 @@ Environments are case-sensitive. The environment name can't contain newlines, sp -Sets the URL that will be used to transport captured events. This can be used to work around ad-blockers or to have more granular control over events sent to Sentry. Adding your DSN is still required when using this option so necessary attributes can be set on the generated Sentry data. This option **requires the implementation** of a custom server endpoint. Learn more and find examples in [Dealing with Ad-Blockers](/platforms/javascript/troubleshooting/#dealing-with-ad-blockers). +Sets the URL that will be used to transport captured events. This can be used to work around ad-blockers or to have more granular control over events sent to Sentry. Adding your DSN is still required when using this option so necessary attributes can be set on the generated Sentry data. This option **requires the implementation** of a custom server endpoint. Learn more and find examples in [Tunneling](/platforms/javascript/configuration/tunneling/). -The endpoint must forward only the request body to Sentry and accept only your own DSNs. Learn more in [Using the `tunnel` Option](/platforms/javascript/troubleshooting/#using-the-tunnel-option). +The endpoint must forward only the request body to Sentry and accept only your own DSNs. Learn more in [Setting Up the Tunnel Manually](/platforms/javascript/configuration/tunneling/#setting-up-the-tunnel-manually). diff --git a/docs/platforms/javascript/guides/ember/index.mdx b/docs/platforms/javascript/guides/ember/index.mdx index 4a12916733b9e7..8b944aebf8d2fb 100644 --- a/docs/platforms/javascript/guides/ember/index.mdx +++ b/docs/platforms/javascript/guides/ember/index.mdx @@ -154,7 +154,7 @@ Now, head over to your project on [Sentry.io](https://sentry.io) to view the col At this point, you should have integrated Sentry into your Ember application. Here's what to explore next: - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup -- Set up tunneling to avoid ad blockers from blocking Sentry events +- Set up tunneling to avoid ad blockers from blocking Sentry events diff --git a/docs/platforms/javascript/guides/gatsby/index.mdx b/docs/platforms/javascript/guides/gatsby/index.mdx index ec585fdbbe0d23..c6d51f50c2fa3b 100644 --- a/docs/platforms/javascript/guides/gatsby/index.mdx +++ b/docs/platforms/javascript/guides/gatsby/index.mdx @@ -165,7 +165,7 @@ At this point, you should have integrated Sentry into your Gatsby application. H - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup - Set up Agent Tracing to monitor your AI systems -- Set up tunneling to avoid ad blockers from blocking Sentry events +- Set up tunneling to avoid ad blockers from blocking Sentry events diff --git a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx index 65cc4f66e263a2..50ed9a54a845bc 100644 --- a/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/configuration/build/index.mdx @@ -204,85 +204,11 @@ Note: Enabling this option can lead to longer build times. - -This feature requires **Next.js version 11+**. Rewrite mode doesn't work with self-hosted Sentry instances. + +This option is deprecated and will be removed in v12. Set `tunnel: true` in the browser and add `serveTunnelIntegration` on the server instead, as described in Tunneling. -Tunnel Sentry requests through this route on your Next.js server to prevent ad-blockers from blocking Sentry events from being sent. - -This option can be set to: - -- `true` for auto-generated routes, which are unpredictable and change with each deployment. -- A custom static string path like `/error-monitoring`. - - - -Your middleware (`proxy.ts` or `middleware.ts`) also runs for tunnel requests. On v10, the SDK skips your middleware only in rewrite mode with Webpack. Exclude the tunnel route in its `matcher`. This needs a fixed string, because `true` creates a new path for each build: - -```typescript {filename:proxy.ts} -export const config = { - matcher: ["/((?!error-monitoring|_next/static|_next/image|favicon.ico).*)"], -}; -``` - - - -Learn more about tunneling in the troubleshooting section. - -The tunnel route works in one of two modes: - -- **Rewrite mode** (default): A Next.js rewrite proxies each request to Sentry with all its request headers. Works only with Sentry SaaS DSNs. -- **Handler mode**: A route handler in your app forwards only the request body to Sentry. Works with any DSN. - -Starting with versions `10.77.1` (v10) and `11.9.0` (v11), the browser sends tunnel requests in rewrite mode [with `credentials: "omit"`](https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials). -If a layer in front of your app requires credentials (for example, Vercel Deployment Protection or HTTP Basic authentication), it rejects these requests. Use handler mode in this case. -You can also set `credentials: "same-origin"`, but rewrite mode then forwards the credentials to Sentry: - -```javascript {filename:instrumentation-client.ts} -Sentry.init({ - dsn: "___PUBLIC_DSN___", - transportOptions: { - fetchOptions: { credentials: "same-origin" }, - }, -}); -``` - -**Handler mode** - - - -Keep `tunnelRoute` and add this file. If your app uses a `src` directory, add it at `src/app/sentry-tunnel/route.ts`: - -```typescript {filename:app/sentry-tunnel/route.ts} -export { POST } from "@sentry/nextjs/tunnel"; -``` - -This works with any `tunnelRoute` value, including `true`. When the SDK finds the file, the build prints this line: - -```bash -[@sentry/nextjs] The tunnel route sends events through app/sentry-tunnel/route.ts. Only the event payload goes to Sentry. -``` - -If the line is missing, the SDK uses rewrite mode. - -The handler accepts only the DSN of your server-side SDK. It rejects other DSNs with a `403` and requests larger than 20 MiB with a `413`. If your browser SDK uses a different DSN, list the allowed DSNs: - -```typescript {filename:app/sentry-tunnel/route.ts} -import { createSentryTunnelRoute } from "@sentry/nextjs/tunnel"; - -export const { POST } = createSentryTunnelRoute({ - allowedDsns: ["___PUBLIC_DSN___"], -}); -``` - - - -- Handler mode works only with the App Router. -- The SDK doesn't find the file in a route group, such as `app/(group)/sentry-tunnel/`. -- With `"moduleResolution": "node"` in `tsconfig.json`, the type check fails with `Cannot find module '@sentry/nextjs/tunnel'`. Set `moduleResolution` to `bundler`, `node16`, or `nodenext`. -- Each event request runs the route handler. On serverless hosts, this is one function invocation for each request. - - +Tunnels Sentry requests through a route on your Next.js server, so ad blockers don't drop them. Set it to `true` for an auto-generated route, or to a path like `/error-monitoring`. diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx index ddbc212f18deac..a741cb79ab385f 100644 --- a/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx +++ b/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx @@ -254,32 +254,13 @@ Prevent ad blockers from blocking Sentry events by routing them through your Nex This increases server load. Consider the trade-off for your application. -To forward only the request body to Sentry, also add `app/sentry-tunnel/route.ts` (SDK version `10.77.1` and later on v10, `11.9.0` and later on v11). -Use this file if Vercel Deployment Protection or another login protects your app. Learn more in `tunnelRoute`. +Set `tunnel: true` in your browser `Sentry.init`, and add `serveTunnelIntegration` to your server `Sentry.init`: - + -If you're using Next.js proxy/middleware that intercepts requests, exclude the tunnel route. The file is called `proxy.ts` in Next.js 16+ and `middleware.ts` in Next.js 15: + -```typescript {filename:proxy.ts} -export const config = { - matcher: ["/((?!sentry-tunnel|_next/static|_next/image|favicon.ico).*)"], -}; -``` - - - -```typescript {filename:next.config.ts} -export default withSentryConfig(nextConfig, { - // Use a fixed route (recommended) - tunnelRoute: "/sentry-tunnel", -}); -``` - -```typescript {filename:app/sentry-tunnel/route.ts} -// Forward only the request body to Sentry -export { POST } from "@sentry/nextjs/tunnel"; -``` +Learn more in Tunneling. ### Control the Data You Send to Sentry (Optional) diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx index 8e51afc5e733f1..2827d4e663d03c 100644 --- a/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx +++ b/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx @@ -218,31 +218,15 @@ export default withSentryConfig(nextConfig, { Tunneling works identically for both Webpack and Turbopack. Sentry automatically filters tunnel requests from middleware spans to prevent noise in your monitoring data. -### Configure Tunnel Route +### Configure the Tunnel -Enable tunneling to bypass ad-blockers. Use a fixed route so you can exclude it from middleware if needed. +Set `tunnel: true` in your browser `Sentry.init`, and add `serveTunnelIntegration` to your server `Sentry.init`: -To forward only the request body to Sentry, add a tunnel route handler (SDK version `10.77.1` and later on v10, `11.9.0` and later on v11). -Use the handler if Vercel Deployment Protection or another login protects your app. Learn more about the [`tunnelRoute` option](/platforms/javascript/guides/nextjs/configuration/build/#tunnelRoute). + - + -You can use `tunnelRoute: true` to auto-generate a random route. However, random routes cannot be excluded from middleware matchers since the route changes on each build. This may cause issues if you have middleware that intercepts all requests. - -```typescript -tunnelRoute: true, // Auto-generated random route -``` - - - -```typescript {filename:next.config.ts} -import { withSentryConfig } from "@sentry/nextjs/config"; - -export default withSentryConfig(nextConfig, { - // Use a fixed route (recommended) - tunnelRoute: "/sentry-tunnel", -}); -``` +Learn more in [Tunneling](/platforms/javascript/guides/nextjs/configuration/tunneling/). ## Migrating from Webpack to Turbopack @@ -258,13 +242,11 @@ export default withSentryConfig(nextConfig, { webpack: { excludeServerRoutes: ["/api/health"], }, - tunnelRoute: "/sentry-tunnel", }); // After (Turbopack) export default withSentryConfig(nextConfig, { // webpack.excludeServerRoutes is not supported with Turbopack - tunnelRoute: "/sentry-tunnel", }); ``` diff --git a/docs/platforms/javascript/guides/react-router/index.mdx b/docs/platforms/javascript/guides/react-router/index.mdx index 27fcb45648a807..14c926394cb087 100644 --- a/docs/platforms/javascript/guides/react-router/index.mdx +++ b/docs/platforms/javascript/guides/react-router/index.mdx @@ -82,7 +82,7 @@ Now, head over to your project on [Sentry.io](https://sentry.io) to view the col At this point, you should have integrated Sentry into your React Router Framework application. Here's what to explore next: - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup -- Set up tunneling to avoid ad blockers blocking Sentry events +- Set up tunneling to avoid ad blockers blocking Sentry events - Read the manual setup guide for advanced configuration diff --git a/docs/platforms/javascript/guides/react-router/manual-setup.mdx b/docs/platforms/javascript/guides/react-router/manual-setup.mdx index aec0eda1e80641..9dc43365e7f9dd 100644 --- a/docs/platforms/javascript/guides/react-router/manual-setup.mdx +++ b/docs/platforms/javascript/guides/react-router/manual-setup.mdx @@ -458,7 +458,7 @@ Now, head over to your project on [Sentry.io](https://sentry.io) to view the col At this point, you should have integrated Sentry into your React Router Framework application. Here's what to explore next: - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup -- Set up tunneling to avoid ad blockers blocking Sentry events +- Set up tunneling to avoid ad blockers blocking Sentry events - Set up Agent Tracing to monitor your AI systems diff --git a/docs/platforms/javascript/guides/react/index.mdx b/docs/platforms/javascript/guides/react/index.mdx index f44073a9ba55a5..4b2bc7300c0a92 100644 --- a/docs/platforms/javascript/guides/react/index.mdx +++ b/docs/platforms/javascript/guides/react/index.mdx @@ -276,7 +276,7 @@ Now, head over to your project on [Sentry.io](https://sentry.io) to view the col At this point, you should have integrated Sentry into your React application. Here's what to explore next: - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup -- Set up tunneling to avoid ad blockers from blocking Sentry events +- Set up tunneling to avoid ad blockers from blocking Sentry events - Explore React-specific features diff --git a/docs/platforms/javascript/guides/solid/index.mdx b/docs/platforms/javascript/guides/solid/index.mdx index 4cfd9c1810a377..3f68538c33adc1 100644 --- a/docs/platforms/javascript/guides/solid/index.mdx +++ b/docs/platforms/javascript/guides/solid/index.mdx @@ -152,7 +152,7 @@ Now, head over to your project on [Sentry.io](https://sentry.io/) to view the co At this point, you should have integrated Sentry into your Solid application. Here's what to explore next: - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup -- Set up tunneling to avoid ad blockers from blocking Sentry events +- Set up tunneling to avoid ad blockers from blocking Sentry events - Explore Solid-specific features diff --git a/docs/platforms/javascript/guides/solidstart/index.mdx b/docs/platforms/javascript/guides/solidstart/index.mdx index f7c7a9f1baade9..bb69e18cc532df 100644 --- a/docs/platforms/javascript/guides/solidstart/index.mdx +++ b/docs/platforms/javascript/guides/solidstart/index.mdx @@ -369,7 +369,7 @@ At this point, you should have integrated Sentry into your SolidStart applicatio - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup - Set up Agent Tracing to monitor your AI systems -- Set up tunneling to avoid ad blockers blocking Sentry events +- Set up tunneling to avoid ad blockers blocking Sentry events diff --git a/docs/platforms/javascript/guides/svelte/index.mdx b/docs/platforms/javascript/guides/svelte/index.mdx index 1931db34362199..3a50e8b42a42e0 100644 --- a/docs/platforms/javascript/guides/svelte/index.mdx +++ b/docs/platforms/javascript/guides/svelte/index.mdx @@ -192,7 +192,7 @@ Now, head over to your project on [Sentry.io](https://sentry.io/) to view the co At this point, you should have integrated Sentry into your Svelte application. Here's what to explore next: - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup -- Set up tunneling to avoid ad blockers from blocking Sentry events +- Set up tunneling to avoid ad blockers from blocking Sentry events - Explore Svelte-specific features diff --git a/docs/platforms/javascript/guides/tanstackstart-react/features/createSentryTunnelRoute.mdx b/docs/platforms/javascript/guides/tanstackstart-react/features/createSentryTunnelRoute.mdx index d3244d9717c84b..6b4709fc0937f8 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/features/createSentryTunnelRoute.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/features/createSentryTunnelRoute.mdx @@ -6,14 +6,13 @@ description: "Learn how to manually define a Sentry tunnel route in your TanStac - If you can use the `sentryTanstackStart` Vite plugin, prefer its - [`tunnelRoute`](/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart/#tunnel-route) - option. It registers the route for you and automatically wires up the client - `tunnel` option. Use `createSentryTunnelRoute` only when you need full control over - the route file, the DSN allowlist, or can't use the Vite plugin. + For most apps, set up the tunnel as described in{" "} + Tunneling, which + needs no route file. Use `createSentryTunnelRoute` only when you want the + tunnel as a route in your app. -The `createSentryTunnelRoute` helper returns a TanStack Start server-route configuration with a `POST` handler that forwards Sentry envelopes to Sentry's ingest servers. Use it inside a file route to expose a same-origin tunnel endpoint. It forwards only the request body to Sentry. +The `createSentryTunnelRoute` helper returns a TanStack Start server-route configuration with a `POST` handler that forwards Sentry envelopes to Sentry's ingest servers. Use it inside a file route to expose a same-origin tunnel endpoint. ## Usage @@ -46,7 +45,7 @@ Sentry.init({ A list of DSN strings that the route is allowed to forward to. The route validates each incoming envelope against this list and rejects any DSN that isn't allowed. -If `allowedDsns` is omitted or empty, the route falls back to the DSN of the active server-side Sentry SDK at runtime. If neither is available, requests to the route return a 500 response. +The DSN of the active server-side Sentry SDK is always allowed too. If `allowedDsns` is omitted or empty, the route uses only that DSN. If neither is available, requests to the route return a 500 response. ```typescript {filename:src/routes/monitor.ts} Sentry.createSentryTunnelRoute({ diff --git a/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx b/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx index 5663884faf889f..3d7519f76951f9 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart.mdx @@ -97,56 +97,11 @@ sentryTanstackStart({ -The `tunnelRoute` option registers a same-origin TanStack Start server route that forwards Sentry envelopes to Sentry's ingest servers. It also automatically sets the client `tunnel` option in `Sentry.init()` so browser events go through that route. This helps avoid ad blockers and corporate firewalls that block requests to `*.sentry.io`. It forwards only the request body to Sentry. - -`tunnelRoute` accepts three shapes: - -#### `tunnelRoute: true` (recommended) - -Generates an opaque, unguessable route path for each dev session and production build. Because the path changes between builds, ad blockers can't reliably target it. - -```typescript {filename:vite.config.ts} -sentryTanstackStart({ - tunnelRoute: true, -}), -``` - -#### Static path - -Pass a string to use a fixed route path. This is easier to reason about, but a known path is easier for ad blockers to add to a list. - -```typescript {filename:vite.config.ts} -sentryTanstackStart({ - tunnelRoute: "/monitor", -}), -``` - -#### Object form - -Use the object form to control the DSN allowlist or set a static path explicitly: - -```typescript {filename:vite.config.ts} -sentryTanstackStart({ - tunnelRoute: { - allowedDsns: ["___PUBLIC_DSN___"], - path: "/monitor", - }, -}), -``` - -- **`allowedDsns`** — only envelopes targeting one of these DSNs are forwarded. If omitted or empty, the route falls back to the DSN of the active server-side Sentry SDK at runtime. -- **`path`** — the public route path. If omitted, an opaque path is generated (same behavior as `tunnelRoute: true`). - - - If you also pass `tunnel` to `Sentry.init()`, the runtime option wins and the - managed tunnel route is bypassed. The SDK logs a warning when this happens. + + This option is deprecated and will be removed in v12. Set `tunnel: true` in + the browser and add `serveTunnelIntegration` on the server instead, as + described in{" "} + Tunneling. - - When using `tunnelRoute: true` (or the object form without `path`), the - generated path changes for each dev session and each production build. Don't - hard-code it elsewhere in your app or infrastructure. - +The `tunnelRoute` option serves a tunnel on your own origin that forwards browser events to Sentry, so ad blockers don't drop them. It also sets the browser `tunnel` option for you. diff --git a/docs/platforms/javascript/guides/tanstackstart-react/manual-setup/index.mdx b/docs/platforms/javascript/guides/tanstackstart-react/manual-setup/index.mdx index a9c893db8c2492..5ca2e5dc204cdc 100644 --- a/docs/platforms/javascript/guides/tanstackstart-react/manual-setup/index.mdx +++ b/docs/platforms/javascript/guides/tanstackstart-react/manual-setup/index.mdx @@ -366,28 +366,15 @@ If you need more control over the upload process, see our [source maps guide](/p ### Avoid Ad Blockers With Tunneling (Optional) -Ad blockers and corporate firewalls often block requests to `*.sentry.io`, which can cause events to be dropped before they reach Sentry. To work around this, you can tunnel events through a same-origin route in your TanStack Start app. +Ad blockers and corporate firewalls often block requests to `*.sentry.io`, which can cause events to be dropped before they reach Sentry. To work around this, send them through a tunnel on your own origin. -The `sentryTanstackStart` Vite plugin can register a tunnel route for you and automatically wire up the client `tunnel` option. +Set `tunnel: true` in your browser `Sentry.init`, and add `serveTunnelIntegration` to your server `Sentry.init`: -Setting `tunnelRoute: true` generates an opaque route for each dev session and production build, making it harder for ad blockers to target. See the [`sentryTanstackStart`](/platforms/javascript/guides/tanstackstart-react/features/sentryTanstackStart/#tunnel-route) feature page for static paths and the full set of options. + -If you can't use the Vite plugin, or need full control over the route file and DSN allowlist, use [`createSentryTunnelRoute`](/platforms/javascript/guides/tanstackstart-react/features/createSentryTunnelRoute/) to define the route yourself. + -```typescript {filename:vite.config.ts} {9} -import { defineConfig } from "vite"; -import { tanstackStart } from "@tanstack/react-start/plugin/vite"; -import { sentryTanstackStart } from "@sentry/tanstackstart-react/vite"; - -export default defineConfig({ - plugins: [ - tanstackStart(), - sentryTanstackStart({ - tunnelRoute: true, - }), - ], -}); -``` +Learn more in Tunneling. ### Control the Data You Send to Sentry (Optional) diff --git a/docs/platforms/javascript/guides/vue/index.mdx b/docs/platforms/javascript/guides/vue/index.mdx index fe85f766b38162..7d1102360a9e6f 100644 --- a/docs/platforms/javascript/guides/vue/index.mdx +++ b/docs/platforms/javascript/guides/vue/index.mdx @@ -232,7 +232,7 @@ Now, head over to your project on [Sentry.io](https://sentry.io/) to view the co At this point, you should have integrated Sentry into your Vue application. Here's what to explore next: - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup -- Set up tunneling to avoid ad blockers from blocking Sentry events +- Set up tunneling to avoid ad blockers from blocking Sentry events - Explore Vue-specific features diff --git a/docs/product/explore/dropped-data.mdx b/docs/product/explore/dropped-data.mdx index 93623f10b9f5e6..88a2a5cc36adc0 100644 --- a/docs/product/explore/dropped-data.mdx +++ b/docs/product/explore/dropped-data.mdx @@ -158,7 +158,7 @@ The request failed without a response. Ad blockers and browser extensions are a - **Browser:** A CORS misconfiguration, the user being offline, or the page unloading before the request completes. - **Server:** No outbound network access from the host or container, an egress firewall, a DNS failure, TLS errors from an intercepting proxy, or proxy settings the SDK is not using. - **Actions:** - - For ad blockers, route events through your own domain with the [`tunnel` option](/platforms/javascript/troubleshooting/#using-the-tunnel-option). + - For ad blockers, route events through your own domain with the [`tunnel` option](/platforms/javascript/configuration/tunneling/). - For browsers, confirm in devtools that requests to your ingest domain are not blocked, and check your CORS configuration. - For servers, verify outbound connectivity to your ingest domain from the host or container. diff --git a/platform-includes/configuration/integrations/javascript.astro.mdx b/platform-includes/configuration/integrations/javascript.astro.mdx index 66fba29ecf1f82..7466a54771c5d7 100644 --- a/platform-includes/configuration/integrations/javascript.astro.mdx +++ b/platform-includes/configuration/integrations/javascript.astro.mdx @@ -8,8 +8,8 @@ Depending on whether an integration enhances the functionality of a particular r ### Common Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`dedupeIntegration`](./dedupe/) | ✓ | ✓ | | | | [`eventFiltersIntegration`](./eventfilters/) | ✓ | ✓ | | | | [`functionToStringIntegration`](./functiontostring/) | ✓ | | | | @@ -20,37 +20,37 @@ Depending on whether an integration enhances the functionality of a particular r ### Browser Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** | -| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: | -| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | -| [`browserApiErrorsIntegration`](./browserapierrors/) | ✓ | ✓ | | | | -| [`browserSessionIntegration`](./browsersession/) | ✓ | | | | ✓ | -| [`browserTracingIntegration`](./browsertracing/) | ✓ | | ✓ | | ✓ | -| [`fetchStreamPerformanceIntegration`](./fetchstreamperformance/) | | | ✓ | | | -| [`interactionsIntegration`](./interactions/) | | | ✓ | | | -| [`userTimingIntegration`](./usertiming/) | | | ✓ | | | -| [`webVitalsIntegration`](./webvitals/) | With BrowserTracing | | ✓ | | | -| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | -| [`httpContextIntegration`](./httpcontext/) | ✓ | | | | ✓ | -| [`browserProfilingIntegration`](./browserprofiling/) | | | ✓ | | | -| [`contextLinesIntegration`](./contextlines/) | | ✓ | | | | -| [`featureFlagsIntegration`](./featureflags/) | | | | | ✓ | -| [`graphqlClientIntegration`](./graphqlclient/) | | | | | ✓ | -| [`httpClientIntegration`](./httpclient/) | | ✓ | | | | -| [`launchDarklyIntegration`](./launchdarkly/) | | | | | ✓ | -| [`moduleMetadataIntegration`](./modulemetadata/) | | | | | ✓ | -| [`openFeatureIntegration`](./openfeature/) | | | | | ✓ | -| [`replayCanvasIntegration`](./replaycanvas/) | | | | ✓ | | -| [`replayIntegration`](./replay/) | | | | ✓ | ✓ | -| [`reportingObserverIntegration`](./reportingobserver/) | | ✓ | | | | -| [`statsigIntegration`](./statsig/) | | | | | ✓ | -| [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | -| [`unleashIntegration`](./unleash/) | | | | | ✓ | +| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** | +| ---------------------------------------------------------------- | :-----------------: | :--------: | :---------: | :--------: | :--------------------: | +| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | +| [`browserApiErrorsIntegration`](./browserapierrors/) | ✓ | ✓ | | | | +| [`browserSessionIntegration`](./browsersession/) | ✓ | | | | ✓ | +| [`browserTracingIntegration`](./browsertracing/) | ✓ | | ✓ | | ✓ | +| [`fetchStreamPerformanceIntegration`](./fetchstreamperformance/) | | | ✓ | | | +| [`interactionsIntegration`](./interactions/) | | | ✓ | | | +| [`userTimingIntegration`](./usertiming/) | | | ✓ | | | +| [`webVitalsIntegration`](./webvitals/) | With BrowserTracing | | ✓ | | | +| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | +| [`httpContextIntegration`](./httpcontext/) | ✓ | | | | ✓ | +| [`browserProfilingIntegration`](./browserprofiling/) | | | ✓ | | | +| [`contextLinesIntegration`](./contextlines/) | | ✓ | | | | +| [`featureFlagsIntegration`](./featureflags/) | | | | | ✓ | +| [`graphqlClientIntegration`](./graphqlclient/) | | | | | ✓ | +| [`httpClientIntegration`](./httpclient/) | | ✓ | | | | +| [`launchDarklyIntegration`](./launchdarkly/) | | | | | ✓ | +| [`moduleMetadataIntegration`](./modulemetadata/) | | | | | ✓ | +| [`openFeatureIntegration`](./openfeature/) | | | | | ✓ | +| [`replayCanvasIntegration`](./replaycanvas/) | | | | ✓ | | +| [`replayIntegration`](./replay/) | | | | ✓ | ✓ | +| [`reportingObserverIntegration`](./reportingobserver/) | | ✓ | | | | +| [`statsigIntegration`](./statsig/) | | | | | ✓ | +| [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | +| [`unleashIntegration`](./unleash/) | | | | | ✓ | ### Node.js Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`amqplibIntegration`](./amqplib/) | ✓ | | ✓ | | | [`awsLambdaWebIntegration`](./awslambdaweb/) | ✓ | | | ✓ | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | @@ -98,3 +98,4 @@ Depending on whether an integration enhances the functionality of a particular r | [`firebaseIntegration`](./firebase/) | ✓ | | ✓ | | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/integrations/javascript.aws-lambda.mdx b/platform-includes/configuration/integrations/javascript.aws-lambda.mdx index ac3543690d0d99..016c450488ece7 100644 --- a/platform-includes/configuration/integrations/javascript.aws-lambda.mdx +++ b/platform-includes/configuration/integrations/javascript.aws-lambda.mdx @@ -1,7 +1,7 @@ ### Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`awsIntegration`](./aws/) | ✓ | | ✓ | | | [`awsLambdaIntegration`](./awslambda/) | ✓ | | ✓ | | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | @@ -55,3 +55,4 @@ | [`trpcMiddleware`](./trpc/) | | ✓ | ✓ | ✓ | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/integrations/javascript.bun.mdx b/platform-includes/configuration/integrations/javascript.bun.mdx index 8dc423f3b61c6c..f0fc5778ce959b 100644 --- a/platform-includes/configuration/integrations/javascript.bun.mdx +++ b/platform-includes/configuration/integrations/javascript.bun.mdx @@ -1,7 +1,7 @@ ### Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`amqplibIntegration`](./amqplib/) | ✓ | | ✓ | | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | | [`contextLinesIntegration`](./contextlines/) | ✓ | ✓ | | | @@ -47,14 +47,15 @@ | [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | [`trpcMiddleware`](./trpc/) | | ✓ | ✓ | ✓ | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | ### Bun Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | -| [`bunServerIntegration`](./bunserver/) | ✓ | ✓ | ✓ | | -| [`bunRuntimeMetricsIntegration`](./bunruntimemetrics/) | | | | ✓ | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ------------------------------------------------------ | :--------------: | :--------: | :---------: | :--------------------: | +| [`bunServerIntegration`](./bunserver/) | ✓ | ✓ | ✓ | | +| [`bunRuntimeMetricsIntegration`](./bunruntimemetrics/) | | | | ✓ | diff --git a/platform-includes/configuration/integrations/javascript.cloudflare.mdx b/platform-includes/configuration/integrations/javascript.cloudflare.mdx index 99a2952b3905bc..03a90fa3226b7d 100644 --- a/platform-includes/configuration/integrations/javascript.cloudflare.mdx +++ b/platform-includes/configuration/integrations/javascript.cloudflare.mdx @@ -1,7 +1,7 @@ ### Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Cron** | **Additional Context** | -| --------------------------------------------------- | :--------------: | :--------: | :---------: | :------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Cron** | **Additional Context** | +| ---------------------------------------------------- | :--------------: | :--------: | :---------: | :------: | :--------------------: | | [`dedupeIntegration`](./dedupe/) | ✓ | ✓ | | | | | [`eventFiltersIntegration`](./eventfilters/) | ✓ | ✓ | | | | | [`fetchIntegration`](./fetchIntegration/) | ✓ | ✓ | ✓ | | | @@ -14,6 +14,7 @@ | [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | | [`instrumentPostgresJsSql`](./postgresjs/) | | | ✓ | | | | [`prismaIntegration`](./prisma/) | | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | | [Mistral AI](./mistral/) is automatically instrumented when built with the Sentry Cloudflare Vite plugin. Without the plugin, use `instrumentMistralAiClient`. diff --git a/platform-includes/configuration/integrations/javascript.deno.mdx b/platform-includes/configuration/integrations/javascript.deno.mdx index 187f4353e9937e..e7b056b608096e 100644 --- a/platform-includes/configuration/integrations/javascript.deno.mdx +++ b/platform-includes/configuration/integrations/javascript.deno.mdx @@ -1,24 +1,25 @@ ### Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Cron** | **Additional Context** | -| --------------------------------------------------- | :--------------: | :--------: | :---------: | :------: | :--------------------: | -| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | -| [`consoleIntegration`](./console/) | ✓ | | | | ✓ | -| [`contextLinesIntegration`](./contextlines/) | ✓ | ✓ | | | | -| [`dedupeIntegration`](./dedupe/) | ✓ | ✓ | | | | -| [`denoContextIntegration`](./denocontext/) | ✓ | | | | ✓ | -| [`eventFiltersIntegration`](./eventfilters/) | ✓ | ✓ | | | | -| [`functionToStringIntegration`](./functiontostring/) | ✓ | | | | | -| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | -| [`linkedErrorsIntegration`](./linkederrors/) | ✓ | ✓ | | | | -| [`captureConsoleIntegration`](./captureconsole/) | | | | | ✓ | -| [`denoCronIntegration`](./denocron/) | | | | ✓ | | -| [`denoRuntimeMetricsIntegration`](./denoruntimemetrics/) | | | | | ✓ | -| [`extraErrorDataIntegration`](./extraerrordata/) | | | | | ✓ | -| [`rewriteFramesIntegration`](./rewriteframes/) | | ✓ | | | | -| [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | -| [`instrumentPostgresJsSql`](./postgresjs/) | | | ✓ | | | -| [`trpcMiddleware`](./trpc/) | | ✓ | ✓ | | ✓ | -| [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | -| [`mistralAIIntegration`](./mistral/) | ✓ | | ✓ | | | -| [`typesafeIntegration`](./typesafe/) | ✓ | | ✓ | | | +| | **Auto Enabled** | **Errors** | **Tracing** | **Cron** | **Additional Context** | +| -------------------------------------------------------- | :--------------: | :--------: | :---------: | :------: | :--------------------: | +| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | +| [`consoleIntegration`](./console/) | ✓ | | | | ✓ | +| [`contextLinesIntegration`](./contextlines/) | ✓ | ✓ | | | | +| [`dedupeIntegration`](./dedupe/) | ✓ | ✓ | | | | +| [`denoContextIntegration`](./denocontext/) | ✓ | | | | ✓ | +| [`eventFiltersIntegration`](./eventfilters/) | ✓ | ✓ | | | | +| [`functionToStringIntegration`](./functiontostring/) | ✓ | | | | | +| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | +| [`linkedErrorsIntegration`](./linkederrors/) | ✓ | ✓ | | | | +| [`captureConsoleIntegration`](./captureconsole/) | | | | | ✓ | +| [`denoCronIntegration`](./denocron/) | | | | ✓ | | +| [`denoRuntimeMetricsIntegration`](./denoruntimemetrics/) | | | | | ✓ | +| [`extraErrorDataIntegration`](./extraerrordata/) | | | | | ✓ | +| [`rewriteFramesIntegration`](./rewriteframes/) | | ✓ | | | | +| [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | +| [`instrumentPostgresJsSql`](./postgresjs/) | | | ✓ | | | +| [`trpcMiddleware`](./trpc/) | | ✓ | ✓ | | ✓ | +| [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | +| [`mistralAIIntegration`](./mistral/) | ✓ | | ✓ | | | +| [`typesafeIntegration`](./typesafe/) | ✓ | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | | diff --git a/platform-includes/configuration/integrations/javascript.fastify.mdx b/platform-includes/configuration/integrations/javascript.fastify.mdx index 8392ee505ad662..954b7d37a6a4eb 100644 --- a/platform-includes/configuration/integrations/javascript.fastify.mdx +++ b/platform-includes/configuration/integrations/javascript.fastify.mdx @@ -1,7 +1,7 @@ ### Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`amqplibIntegration`](./amqplib/) | ✓ | | ✓ | | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | | [`dedupeIntegration`](./dedupe/) | ✓ | ✓ | | | @@ -55,3 +55,4 @@ | [`trpcMiddleware`](./trpc/) | | ✓ | ✓ | ✓ | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/integrations/javascript.gcp-functions.mdx b/platform-includes/configuration/integrations/javascript.gcp-functions.mdx index 461d95cdd4ff56..f58776e8a9ba92 100644 --- a/platform-includes/configuration/integrations/javascript.gcp-functions.mdx +++ b/platform-includes/configuration/integrations/javascript.gcp-functions.mdx @@ -1,7 +1,7 @@ ### Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | | [`contextLinesIntegration`](./contextlines/) | ✓ | ✓ | | | | [`dedupeIntegration`](./dedupe/) | ✓ | ✓ | | | @@ -56,3 +56,4 @@ | [`trpcMiddleware`](./trpc/) | | ✓ | ✓ | ✓ | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/integrations/javascript.hapi.mdx b/platform-includes/configuration/integrations/javascript.hapi.mdx index c8712e2712a528..7390c815a8120b 100644 --- a/platform-includes/configuration/integrations/javascript.hapi.mdx +++ b/platform-includes/configuration/integrations/javascript.hapi.mdx @@ -1,7 +1,7 @@ ### Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`amqplibIntegration`](./amqplib/) | ✓ | | ✓ | | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | | [`contextLinesIntegration`](./contextlines/) | ✓ | ✓ | | | @@ -56,3 +56,4 @@ | [`trpcMiddleware`](./trpc/) | | ✓ | ✓ | ✓ | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/integrations/javascript.nestjs.mdx b/platform-includes/configuration/integrations/javascript.nestjs.mdx index 28e3d6cf083dd8..97fa6f1a46988d 100644 --- a/platform-includes/configuration/integrations/javascript.nestjs.mdx +++ b/platform-includes/configuration/integrations/javascript.nestjs.mdx @@ -1,7 +1,7 @@ ### Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`amqplibIntegration`](./amqplib/) | ✓ | | ✓ | | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | | [`contextLinesIntegration`](./contextlines/) | ✓ | ✓ | | | @@ -56,3 +56,4 @@ | [`typesafeIntegration`](./typesafe/) | ✓ | | ✓ | | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/integrations/javascript.node.mdx b/platform-includes/configuration/integrations/javascript.node.mdx index ac9a469467c0d1..3362ecd736fd49 100644 --- a/platform-includes/configuration/integrations/javascript.node.mdx +++ b/platform-includes/configuration/integrations/javascript.node.mdx @@ -1,7 +1,7 @@ ### Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`amqplibIntegration`](./amqplib/) | ✓ | | ✓ | | | [`anrIntegration`](./anr/) | | ✓ | | | | [`awsLambdaWebIntegration`](./awslambdaweb/) | ✓ | | | ✓ | @@ -56,3 +56,4 @@ | [`firebaseIntegration`](./firebase/) | ✓ | | ✓ | | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/integrations/javascript.nuxt.mdx b/platform-includes/configuration/integrations/javascript.nuxt.mdx index 047fbcf8775fda..db4ec7cad18f79 100644 --- a/platform-includes/configuration/integrations/javascript.nuxt.mdx +++ b/platform-includes/configuration/integrations/javascript.nuxt.mdx @@ -8,8 +8,8 @@ Depending on whether an integration enhances the functionality of a particular r ### Common Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`dedupeIntegration`](./dedupe/) | ✓ | ✓ | | | | [`eventFiltersIntegration`](./eventfilters/) | ✓ | ✓ | | | | [`functionToStringIntegration`](./functiontostring/) | ✓ | | | | @@ -20,37 +20,37 @@ Depending on whether an integration enhances the functionality of a particular r ### Browser Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** | -| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: | -| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | -| [`browserApiErrorsIntegration`](./browserapierrors/) | ✓ | ✓ | | | | -| [`browserSessionIntegration`](./browsersession/) | ✓ | | | | ✓ | -| [`browserTracingIntegration`](./browsertracing/) | ✓ | | ✓ | | ✓ | -| [`fetchStreamPerformanceIntegration`](./fetchstreamperformance/) | | | ✓ | | | -| [`interactionsIntegration`](./interactions/) | | | ✓ | | | -| [`userTimingIntegration`](./usertiming/) | | | ✓ | | | -| [`webVitalsIntegration`](./webvitals/) | With BrowserTracing | | ✓ | | | -| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | -| [`httpContextIntegration`](./httpcontext/) | ✓ | | | | ✓ | -| [`browserProfilingIntegration`](./browserprofiling/) | | | ✓ | | | -| [`contextLinesIntegration`](./contextlines/) | | ✓ | | | | -| [`featureFlagsIntegration`](./featureflags/) | | | | | ✓ | -| [`graphqlClientIntegration`](./graphqlclient/) | | | | | ✓ | -| [`httpClientIntegration`](./httpclient/) | | ✓ | | | | -| [`launchDarklyIntegration`](./launchdarkly/) | | | | | ✓ | -| [`moduleMetadataIntegration`](./modulemetadata/) | | | | | ✓ | -| [`openFeatureIntegration`](./openfeature/) | | | | | ✓ | -| [`replayCanvasIntegration`](./replaycanvas/) | | | | ✓ | | -| [`replayIntegration`](./replay/) | | | | ✓ | ✓ | -| [`reportingObserverIntegration`](./reportingobserver/) | | ✓ | | | | -| [`statsigIntegration`](./statsig/) | | | | | ✓ | -| [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | -| [`unleashIntegration`](./unleash/) | | | | | ✓ | +| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** | +| ---------------------------------------------------------------- | :-----------------: | :--------: | :---------: | :--------: | :--------------------: | +| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | +| [`browserApiErrorsIntegration`](./browserapierrors/) | ✓ | ✓ | | | | +| [`browserSessionIntegration`](./browsersession/) | ✓ | | | | ✓ | +| [`browserTracingIntegration`](./browsertracing/) | ✓ | | ✓ | | ✓ | +| [`fetchStreamPerformanceIntegration`](./fetchstreamperformance/) | | | ✓ | | | +| [`interactionsIntegration`](./interactions/) | | | ✓ | | | +| [`userTimingIntegration`](./usertiming/) | | | ✓ | | | +| [`webVitalsIntegration`](./webvitals/) | With BrowserTracing | | ✓ | | | +| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | +| [`httpContextIntegration`](./httpcontext/) | ✓ | | | | ✓ | +| [`browserProfilingIntegration`](./browserprofiling/) | | | ✓ | | | +| [`contextLinesIntegration`](./contextlines/) | | ✓ | | | | +| [`featureFlagsIntegration`](./featureflags/) | | | | | ✓ | +| [`graphqlClientIntegration`](./graphqlclient/) | | | | | ✓ | +| [`httpClientIntegration`](./httpclient/) | | ✓ | | | | +| [`launchDarklyIntegration`](./launchdarkly/) | | | | | ✓ | +| [`moduleMetadataIntegration`](./modulemetadata/) | | | | | ✓ | +| [`openFeatureIntegration`](./openfeature/) | | | | | ✓ | +| [`replayCanvasIntegration`](./replaycanvas/) | | | | ✓ | | +| [`replayIntegration`](./replay/) | | | | ✓ | ✓ | +| [`reportingObserverIntegration`](./reportingobserver/) | | ✓ | | | | +| [`statsigIntegration`](./statsig/) | | | | | ✓ | +| [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | +| [`unleashIntegration`](./unleash/) | | | | | ✓ | ### Node.js Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`amqplibIntegration`](./amqplib/) | ✓ | | ✓ | | | [`awsLambdaWebIntegration`](./awslambdaweb/) | ✓ | | | ✓ | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | @@ -97,3 +97,4 @@ Depending on whether an integration enhances the functionality of a particular r | [`typesafeIntegration`](./typesafe/) | ✓ | | ✓ | | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/integrations/javascript.remix.mdx b/platform-includes/configuration/integrations/javascript.remix.mdx index 651fe9ea347ffa..b90d1bd450b58d 100644 --- a/platform-includes/configuration/integrations/javascript.remix.mdx +++ b/platform-includes/configuration/integrations/javascript.remix.mdx @@ -8,8 +8,8 @@ Depending on whether an integration enhances the functionality of a particular r ### Common Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`dedupeIntegration`](./dedupe/) | ✓ | ✓ | | | | [`eventFiltersIntegration`](./eventfilters/) | ✓ | ✓ | | | | [`functionToStringIntegration`](./functiontostring/) | ✓ | | | | @@ -20,37 +20,37 @@ Depending on whether an integration enhances the functionality of a particular r ### Browser Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** | -| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: | -| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | -| [`browserApiErrorsIntegration`](./browserapierrors/) | ✓ | ✓ | | | | -| [`browserSessionIntegration`](./browsersession/) | ✓ | | | | ✓ | -| [`browserTracingIntegration`](./browsertracing/) | ✓ | | ✓ | | ✓ | -| [`fetchStreamPerformanceIntegration`](./fetchstreamperformance/) | | | ✓ | | | -| [`interactionsIntegration`](./interactions/) | | | ✓ | | | -| [`userTimingIntegration`](./usertiming/) | | | ✓ | | | -| [`webVitalsIntegration`](./webvitals/) | With BrowserTracing | | ✓ | | | -| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | -| [`httpContextIntegration`](./httpcontext/) | ✓ | | | | ✓ | -| [`browserProfilingIntegration`](./browserprofiling/) | | | ✓ | | | -| [`contextLinesIntegration`](./contextlines/) | | ✓ | | | | -| [`featureFlagsIntegration`](./featureflags/) | | | | | ✓ | -| [`graphqlClientIntegration`](./graphqlclient/) | | | | | ✓ | -| [`httpClientIntegration`](./httpclient/) | | ✓ | | | | -| [`launchDarklyIntegration`](./launchdarkly/) | | | | | ✓ | -| [`moduleMetadataIntegration`](./modulemetadata/) | | | | | ✓ | -| [`openFeatureIntegration`](./openfeature/) | | | | | ✓ | -| [`replayCanvasIntegration`](./replaycanvas/) | | | | ✓ | | -| [`replayIntegration`](./replay/) | | | | ✓ | ✓ | -| [`reportingObserverIntegration`](./reportingobserver/) | | ✓ | | | | -| [`statsigIntegration`](./statsig/) | | | | | ✓ | -| [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | -| [`unleashIntegration`](./unleash/) | | | | | ✓ | +| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** | +| ---------------------------------------------------------------- | :-----------------: | :--------: | :---------: | :--------: | :--------------------: | +| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | +| [`browserApiErrorsIntegration`](./browserapierrors/) | ✓ | ✓ | | | | +| [`browserSessionIntegration`](./browsersession/) | ✓ | | | | ✓ | +| [`browserTracingIntegration`](./browsertracing/) | ✓ | | ✓ | | ✓ | +| [`fetchStreamPerformanceIntegration`](./fetchstreamperformance/) | | | ✓ | | | +| [`interactionsIntegration`](./interactions/) | | | ✓ | | | +| [`userTimingIntegration`](./usertiming/) | | | ✓ | | | +| [`webVitalsIntegration`](./webvitals/) | With BrowserTracing | | ✓ | | | +| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | +| [`httpContextIntegration`](./httpcontext/) | ✓ | | | | ✓ | +| [`browserProfilingIntegration`](./browserprofiling/) | | | ✓ | | | +| [`contextLinesIntegration`](./contextlines/) | | ✓ | | | | +| [`featureFlagsIntegration`](./featureflags/) | | | | | ✓ | +| [`graphqlClientIntegration`](./graphqlclient/) | | | | | ✓ | +| [`httpClientIntegration`](./httpclient/) | | ✓ | | | | +| [`launchDarklyIntegration`](./launchdarkly/) | | | | | ✓ | +| [`moduleMetadataIntegration`](./modulemetadata/) | | | | | ✓ | +| [`openFeatureIntegration`](./openfeature/) | | | | | ✓ | +| [`replayCanvasIntegration`](./replaycanvas/) | | | | ✓ | | +| [`replayIntegration`](./replay/) | | | | ✓ | ✓ | +| [`reportingObserverIntegration`](./reportingobserver/) | | ✓ | | | | +| [`statsigIntegration`](./statsig/) | | | | | ✓ | +| [`supabaseIntegration`](./supabase/) | | ✓ | ✓ | | | +| [`unleashIntegration`](./unleash/) | | | | | ✓ | ### Node.js Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`amqplibIntegration`](./amqplib/) | ✓ | | ✓ | | | [`awsLambdaWebIntegration`](./awslambdaweb/) | ✓ | | | ✓ | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | @@ -97,3 +97,4 @@ Depending on whether an integration enhances the functionality of a particular r | [`typesafeIntegration`](./typesafe/) | ✓ | | ✓ | | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/integrations/javascript.sveltekit.mdx b/platform-includes/configuration/integrations/javascript.sveltekit.mdx index 9bdc2edaba282b..d9ab94bd4c61ee 100644 --- a/platform-includes/configuration/integrations/javascript.sveltekit.mdx +++ b/platform-includes/configuration/integrations/javascript.sveltekit.mdx @@ -8,8 +8,8 @@ Depending on whether an integration enhances the functionality of a particular r ### Common Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`dedupeIntegration`](./dedupe/) | ✓ | ✓ | | | | [`eventFiltersIntegration`](./eventfilters/) | ✓ | ✓ | | | | [`functionToStringIntegration`](./functiontostring/) | ✓ | | | | @@ -20,36 +20,36 @@ Depending on whether an integration enhances the functionality of a particular r ### Browser Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** | -| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: | -| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | -| [`browserApiErrorsIntegration`](./browserapierrors/) | ✓ | ✓ | | | | -| [`browserSessionIntegration`](./browsersession/) | ✓ | | | | ✓ | -| [`browserTracingIntegration`](./browsertracing/) | ✓ | | ✓ | | ✓ | -| [`fetchStreamPerformanceIntegration`](./fetchstreamperformance/) | | | ✓ | | | -| [`interactionsIntegration`](./interactions/) | | | ✓ | | | -| [`userTimingIntegration`](./usertiming/) | | | ✓ | | | -| [`webVitalsIntegration`](./webvitals/) | With BrowserTracing | | ✓ | | | -| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | -| [`httpContextIntegration`](./httpcontext/) | ✓ | | | | ✓ | -| [`browserProfilingIntegration`](./browserprofiling/) | | | ✓ | | | -| [`contextLinesIntegration`](./contextlines/) | | ✓ | | | | -| [`featureFlagsIntegration`](./featureflags/) | | | | | ✓ | -| [`graphqlClientIntegration`](./graphqlclient/) | | | | | ✓ | -| [`httpClientIntegration`](./httpclient/) | | ✓ | | | | -| [`launchDarklyIntegration`](./launchdarkly/) | | | | | ✓ | -| [`moduleMetadataIntegration`](./modulemetadata/) | | | | | ✓ | -| [`openFeatureIntegration`](./openfeature/) | | | | | ✓ | -| [`replayCanvasIntegration`](./replaycanvas/) | | | | ✓ | | -| [`replayIntegration`](./replay/) | | | | ✓ | ✓ | -| [`reportingObserverIntegration`](./reportingobserver/) | | ✓ | | | | -| [`statsigIntegration`](./statsig/) | | | | | ✓ | -| [`unleashIntegration`](./unleash/) | | | | | ✓ | +| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** | +| ---------------------------------------------------------------- | :-----------------: | :--------: | :---------: | :--------: | :--------------------: | +| [`breadcrumbsIntegration`](./breadcrumbs/) | ✓ | | | | ✓ | +| [`browserApiErrorsIntegration`](./browserapierrors/) | ✓ | ✓ | | | | +| [`browserSessionIntegration`](./browsersession/) | ✓ | | | | ✓ | +| [`browserTracingIntegration`](./browsertracing/) | ✓ | | ✓ | | ✓ | +| [`fetchStreamPerformanceIntegration`](./fetchstreamperformance/) | | | ✓ | | | +| [`interactionsIntegration`](./interactions/) | | | ✓ | | | +| [`userTimingIntegration`](./usertiming/) | | | ✓ | | | +| [`webVitalsIntegration`](./webvitals/) | With BrowserTracing | | ✓ | | | +| [`globalHandlersIntegration`](./globalhandlers/) | ✓ | ✓ | | | | +| [`httpContextIntegration`](./httpcontext/) | ✓ | | | | ✓ | +| [`browserProfilingIntegration`](./browserprofiling/) | | | ✓ | | | +| [`contextLinesIntegration`](./contextlines/) | | ✓ | | | | +| [`featureFlagsIntegration`](./featureflags/) | | | | | ✓ | +| [`graphqlClientIntegration`](./graphqlclient/) | | | | | ✓ | +| [`httpClientIntegration`](./httpclient/) | | ✓ | | | | +| [`launchDarklyIntegration`](./launchdarkly/) | | | | | ✓ | +| [`moduleMetadataIntegration`](./modulemetadata/) | | | | | ✓ | +| [`openFeatureIntegration`](./openfeature/) | | | | | ✓ | +| [`replayCanvasIntegration`](./replaycanvas/) | | | | ✓ | | +| [`replayIntegration`](./replay/) | | | | ✓ | ✓ | +| [`reportingObserverIntegration`](./reportingobserver/) | | ✓ | | | | +| [`statsigIntegration`](./statsig/) | | | | | ✓ | +| [`unleashIntegration`](./unleash/) | | | | | ✓ | ### Node.js Integrations -| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | -| --------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | +| | **Auto Enabled** | **Errors** | **Tracing** | **Additional Context** | +| ---------------------------------------------------------- | :--------------: | :--------: | :---------: | :--------------------: | | [`amqplibIntegration`](./amqplib/) | ✓ | | ✓ | | | [`awsLambdaWebIntegration`](./awslambdaweb/) | ✓ | | | ✓ | | [`consoleIntegration`](./console/) | ✓ | | | ✓ | @@ -97,3 +97,4 @@ Depending on whether an integration enhances the functionality of a particular r | [`typesafeIntegration`](./typesafe/) | ✓ | | ✓ | | | [`zodErrorsIntegration`](./zodErrors/) | | | | ✓ | | [`pinoIntegration`](./pino/) | | ✓ | | | +| [`serveTunnelIntegration`](./servetunnel/) | | | | | diff --git a/platform-includes/configuration/tunnel-browser-init/javascript.astro.mdx b/platform-includes/configuration/tunnel-browser-init/javascript.astro.mdx new file mode 100644 index 00000000000000..e5fd7022a3aa33 --- /dev/null +++ b/platform-includes/configuration/tunnel-browser-init/javascript.astro.mdx @@ -0,0 +1,6 @@ +```javascript {filename:sentry.client.config.ts} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: true, +}); +``` diff --git a/platform-includes/configuration/tunnel-browser-init/javascript.mdx b/platform-includes/configuration/tunnel-browser-init/javascript.mdx new file mode 100644 index 00000000000000..62fccc01ecb07c --- /dev/null +++ b/platform-includes/configuration/tunnel-browser-init/javascript.mdx @@ -0,0 +1,6 @@ +```javascript {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: true, +}); +``` diff --git a/platform-includes/configuration/tunnel-browser-init/javascript.nextjs.mdx b/platform-includes/configuration/tunnel-browser-init/javascript.nextjs.mdx new file mode 100644 index 00000000000000..de0506a736ec2d --- /dev/null +++ b/platform-includes/configuration/tunnel-browser-init/javascript.nextjs.mdx @@ -0,0 +1,6 @@ +```javascript {filename:instrumentation-client.ts} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: true, +}); +``` diff --git a/platform-includes/configuration/tunnel-browser-init/javascript.nuxt.mdx b/platform-includes/configuration/tunnel-browser-init/javascript.nuxt.mdx new file mode 100644 index 00000000000000..e5fd7022a3aa33 --- /dev/null +++ b/platform-includes/configuration/tunnel-browser-init/javascript.nuxt.mdx @@ -0,0 +1,6 @@ +```javascript {filename:sentry.client.config.ts} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: true, +}); +``` diff --git a/platform-includes/configuration/tunnel-browser-init/javascript.solidstart.mdx b/platform-includes/configuration/tunnel-browser-init/javascript.solidstart.mdx new file mode 100644 index 00000000000000..7f4092f7336c8a --- /dev/null +++ b/platform-includes/configuration/tunnel-browser-init/javascript.solidstart.mdx @@ -0,0 +1,6 @@ +```jsx {filename:src/entry-client.tsx} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: true, +}); +``` diff --git a/platform-includes/configuration/tunnel-browser-init/javascript.sveltekit.mdx b/platform-includes/configuration/tunnel-browser-init/javascript.sveltekit.mdx new file mode 100644 index 00000000000000..703c2c561088e8 --- /dev/null +++ b/platform-includes/configuration/tunnel-browser-init/javascript.sveltekit.mdx @@ -0,0 +1,6 @@ +```javascript {filename:src/hooks.client.(js|ts)} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: true, +}); +``` diff --git a/platform-includes/configuration/tunnel-browser-init/javascript.tanstackstart-react.mdx b/platform-includes/configuration/tunnel-browser-init/javascript.tanstackstart-react.mdx new file mode 100644 index 00000000000000..0232778842243f --- /dev/null +++ b/platform-includes/configuration/tunnel-browser-init/javascript.tanstackstart-react.mdx @@ -0,0 +1,6 @@ +```tsx {filename:src/instrument.client.ts} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + tunnel: true, +}); +``` diff --git a/platform-includes/configuration/tunnel-manual-route/javascript.bun.mdx b/platform-includes/configuration/tunnel-manual-route/javascript.bun.mdx new file mode 100644 index 00000000000000..465f53681d0591 --- /dev/null +++ b/platform-includes/configuration/tunnel-manual-route/javascript.bun.mdx @@ -0,0 +1,7 @@ +```javascript +import * as Sentry from "@sentry/bun"; + +export function POST(request) { + return Sentry.handleTunnelRequest(request); +} +``` diff --git a/platform-includes/configuration/tunnel-manual-route/javascript.cloudflare.mdx b/platform-includes/configuration/tunnel-manual-route/javascript.cloudflare.mdx new file mode 100644 index 00000000000000..f4ef23cec7f03c --- /dev/null +++ b/platform-includes/configuration/tunnel-manual-route/javascript.cloudflare.mdx @@ -0,0 +1,7 @@ +```javascript +import * as Sentry from "@sentry/cloudflare"; + +export function POST(request) { + return Sentry.handleTunnelRequest(request); +} +``` diff --git a/platform-includes/configuration/tunnel-manual-route/javascript.deno.mdx b/platform-includes/configuration/tunnel-manual-route/javascript.deno.mdx new file mode 100644 index 00000000000000..bdabe4e28acb91 --- /dev/null +++ b/platform-includes/configuration/tunnel-manual-route/javascript.deno.mdx @@ -0,0 +1,7 @@ +```javascript +import * as Sentry from "@sentry/deno"; + +export function POST(request) { + return Sentry.handleTunnelRequest(request); +} +``` diff --git a/platform-includes/configuration/tunnel-manual-route/javascript.elysia.mdx b/platform-includes/configuration/tunnel-manual-route/javascript.elysia.mdx new file mode 100644 index 00000000000000..f3fa66ab8edcbe --- /dev/null +++ b/platform-includes/configuration/tunnel-manual-route/javascript.elysia.mdx @@ -0,0 +1,7 @@ +```javascript +import * as Sentry from "@sentry/elysia"; + +export function POST(request) { + return Sentry.handleTunnelRequest(request); +} +``` diff --git a/platform-includes/configuration/tunnel-manual-route/javascript.mdx b/platform-includes/configuration/tunnel-manual-route/javascript.mdx new file mode 100644 index 00000000000000..9ec59dfcd4caf2 --- /dev/null +++ b/platform-includes/configuration/tunnel-manual-route/javascript.mdx @@ -0,0 +1,43 @@ + + +```javascript {tabTitle:Express} +import express from "express"; +import * as Sentry from "___SDK_PACKAGE___"; + +const app = express(); + +app.post("/tunnel", (req, res) => Sentry.handleTunnelRequest(req, res)); +``` + +```javascript {tabTitle:Fetch API} +import * as Sentry from "___SDK_PACKAGE___"; + +export function POST(request) { + return Sentry.handleTunnelRequest(request); +} +``` + + + + + +```javascript {tabTitle:Express} +import express from "express"; +import * as Sentry from "@sentry/node"; + +const app = express(); + +app.post("/tunnel", (req, res) => Sentry.handleTunnelRequest(req, res)); +``` + +```javascript {tabTitle:Fetch API} +import * as Sentry from "@sentry/node"; + +export function POST(request) { + return Sentry.handleTunnelRequest(request); +} +``` + + + +Add the route before any middleware that reads the request body. diff --git a/platform-includes/configuration/tunnel-manual-route/javascript.nextjs.mdx b/platform-includes/configuration/tunnel-manual-route/javascript.nextjs.mdx new file mode 100644 index 00000000000000..e8fd86513fdf14 --- /dev/null +++ b/platform-includes/configuration/tunnel-manual-route/javascript.nextjs.mdx @@ -0,0 +1,7 @@ +```typescript {filename:app/tunnel/route.ts} +import * as Sentry from "@sentry/nextjs"; + +export function POST(request: Request) { + return Sentry.handleTunnelRequest(request); +} +``` diff --git a/platform-includes/configuration/tunnel-manual-route/javascript.sveltekit.mdx b/platform-includes/configuration/tunnel-manual-route/javascript.sveltekit.mdx new file mode 100644 index 00000000000000..06575d3b5c0755 --- /dev/null +++ b/platform-includes/configuration/tunnel-manual-route/javascript.sveltekit.mdx @@ -0,0 +1,7 @@ +```typescript {filename:src/routes/tunnel/+server.ts} +import * as Sentry from "@sentry/sveltekit"; +import type { RequestHandler } from "./$types"; + +export const POST: RequestHandler = ({ request }) => + Sentry.handleTunnelRequest(request); +``` diff --git a/platform-includes/configuration/tunnel-server-init/javascript.astro.mdx b/platform-includes/configuration/tunnel-server-init/javascript.astro.mdx new file mode 100644 index 00000000000000..5bd72e5f4fb075 --- /dev/null +++ b/platform-includes/configuration/tunnel-server-init/javascript.astro.mdx @@ -0,0 +1,6 @@ +```javascript {filename:sentry.server.config.ts} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], +}); +``` diff --git a/platform-includes/configuration/tunnel-server-init/javascript.mdx b/platform-includes/configuration/tunnel-server-init/javascript.mdx new file mode 100644 index 00000000000000..8e68d0296ed58e --- /dev/null +++ b/platform-includes/configuration/tunnel-server-init/javascript.mdx @@ -0,0 +1,6 @@ +```javascript {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], +}); +``` diff --git a/platform-includes/configuration/tunnel-server-init/javascript.nextjs.mdx b/platform-includes/configuration/tunnel-server-init/javascript.nextjs.mdx new file mode 100644 index 00000000000000..d5129db86745d4 --- /dev/null +++ b/platform-includes/configuration/tunnel-server-init/javascript.nextjs.mdx @@ -0,0 +1,15 @@ +```javascript {tabTitle:Server} {filename:sentry.server.config.ts} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], +}); +``` + +```javascript {tabTitle:Edge} {filename:sentry.edge.config.ts} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], +}); +``` + +Add the integration to both files. diff --git a/platform-includes/configuration/tunnel-server-init/javascript.nuxt.mdx b/platform-includes/configuration/tunnel-server-init/javascript.nuxt.mdx new file mode 100644 index 00000000000000..5bd72e5f4fb075 --- /dev/null +++ b/platform-includes/configuration/tunnel-server-init/javascript.nuxt.mdx @@ -0,0 +1,6 @@ +```javascript {filename:sentry.server.config.ts} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], +}); +``` diff --git a/platform-includes/configuration/tunnel-server-init/javascript.solidstart.mdx b/platform-includes/configuration/tunnel-server-init/javascript.solidstart.mdx new file mode 100644 index 00000000000000..7df51ae36aed23 --- /dev/null +++ b/platform-includes/configuration/tunnel-server-init/javascript.solidstart.mdx @@ -0,0 +1,20 @@ +```typescript {tabTitle:SolidStart 2} {filename:server/plugins/sentry.ts} {7} +import * as Sentry from "@sentry/solidstart"; +import { definePlugin } from "nitro"; + +export default definePlugin(() => { + Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], + }); +}); +``` + +```javascript {tabTitle:SolidStart 1} {filename:src/instrument.server.ts} {5} +import * as Sentry from "@sentry/solidstart"; + +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], +}); +``` diff --git a/platform-includes/configuration/tunnel-server-init/javascript.sveltekit.mdx b/platform-includes/configuration/tunnel-server-init/javascript.sveltekit.mdx new file mode 100644 index 00000000000000..4e26d56ba28be5 --- /dev/null +++ b/platform-includes/configuration/tunnel-server-init/javascript.sveltekit.mdx @@ -0,0 +1,6 @@ +```javascript {filename:src/instrumentation.server.(js|ts)} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], +}); +``` diff --git a/platform-includes/configuration/tunnel-server-init/javascript.tanstackstart-react.mdx b/platform-includes/configuration/tunnel-server-init/javascript.tanstackstart-react.mdx new file mode 100644 index 00000000000000..8179385fa588cc --- /dev/null +++ b/platform-includes/configuration/tunnel-server-init/javascript.tanstackstart-react.mdx @@ -0,0 +1,6 @@ +```javascript {filename:instrument.server.mjs} {3} +Sentry.init({ + dsn: "___PUBLIC_DSN___", + integrations: [Sentry.serveTunnelIntegration()], +}); +``` diff --git a/platform-includes/getting-started-cloudflare/javascript.nextjs.mdx b/platform-includes/getting-started-cloudflare/javascript.nextjs.mdx index ed8427c5febadc..cc837dc1b1e5c0 100644 --- a/platform-includes/getting-started-cloudflare/javascript.nextjs.mdx +++ b/platform-includes/getting-started-cloudflare/javascript.nextjs.mdx @@ -196,7 +196,7 @@ At this point, you should have integrated Sentry into your Next.js application o - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup - [Distributed Tracing](/platforms/javascript/guides/nextjs/tracing/distributed-tracing/) to trace requests across services -- Set up tunneling to avoid ad blockers blocking Sentry events, if you didn't enable it in the wizard +- Set up tunneling to avoid ad blockers blocking Sentry events, if you didn't enable it in the wizard diff --git a/platform-includes/getting-started-complete/javascript.mdx b/platform-includes/getting-started-complete/javascript.mdx index 2730660e61b65e..1b1b1c3960a737 100644 --- a/platform-includes/getting-started-complete/javascript.mdx +++ b/platform-includes/getting-started-complete/javascript.mdx @@ -205,7 +205,7 @@ At this point, you should have integrated Sentry into your JavaScript applicatio - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup - Extend Sentry to your backend using one of our [SDKs](/) -- Set up tunneling to avoid ad blockers from blocking Sentry events +- Set up tunneling to avoid ad blockers from blocking Sentry events diff --git a/platform-includes/getting-started-complete/javascript.nuxt.mdx b/platform-includes/getting-started-complete/javascript.nuxt.mdx index ca94d38d99c5cd..d026ff24a141b0 100644 --- a/platform-includes/getting-started-complete/javascript.nuxt.mdx +++ b/platform-includes/getting-started-complete/javascript.nuxt.mdx @@ -206,10 +206,7 @@ export default defineNuxtConfig({ ### Avoid Ad Blockers With Tunneling (Optional) - + ### Control the Data You Send to Sentry (Optional) diff --git a/platform-includes/getting-started-node/javascript.nextjs.mdx b/platform-includes/getting-started-node/javascript.nextjs.mdx index 1ce1e7b97b13fd..09ba61db96a2db 100644 --- a/platform-includes/getting-started-node/javascript.nextjs.mdx +++ b/platform-includes/getting-started-node/javascript.nextjs.mdx @@ -97,7 +97,7 @@ At this point, you should have integrated Sentry into your Next.js application. - Explore [practical guides](/get-started/guides/) on what to monitor, log, track, and investigate after setup - Set up Agent Tracing to monitor agents built with the Vercel AI SDK, LangChain, and more -- Set up tunneling to avoid ad blockers blocking Sentry events, if you didn't enable it in the wizard +- Set up tunneling to avoid ad blockers blocking Sentry events, if you didn't enable it in the wizard diff --git a/platform-includes/getting-started-tunneling/javascript.astro.mdx b/platform-includes/getting-started-tunneling/javascript.astro.mdx new file mode 100644 index 00000000000000..9ba227ed3b6f74 --- /dev/null +++ b/platform-includes/getting-started-tunneling/javascript.astro.mdx @@ -0,0 +1,9 @@ +To keep ad blockers from dropping Sentry events, send them through a tunnel on your own origin. The SDK serves the tunnel and forwards the events to Sentry. + +Set `tunnel: true` in your client `Sentry.init`, and add `serveTunnelIntegration` to your server `Sentry.init`: + + + + + +Learn more about the options in `serveTunnelIntegration`. To set up your own tunnel endpoint instead, see the Tunneling page. diff --git a/platform-includes/getting-started-tunneling/javascript.mdx b/platform-includes/getting-started-tunneling/javascript.mdx index 12c290d10e01f9..538a67c1442101 100644 --- a/platform-includes/getting-started-tunneling/javascript.mdx +++ b/platform-includes/getting-started-tunneling/javascript.mdx @@ -1,10 +1,10 @@ -You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnel` option in `Sentry.init` to add an API endpoint in your application that forwards Sentry events to Sentry servers. - -This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you'll need to do additional configuration on the server. The endpoint must forward only the request body to Sentry and accept only your own DSN. You can find a detailed explanation on how to do this on our Troubleshooting page. +To keep ad blockers from dropping Sentry events, send them through a tunnel on your own origin. Set `tunnel: true` in `Sentry.init`, and your server forwards the events to Sentry: ```javascript {3} Sentry.init({ dsn: "___PUBLIC_DSN___", - tunnel: "/tunnel", + tunnel: true, }); ``` + +Learn how to serve the tunnel on your server, or how to write your own tunnel endpoint, on the Tunneling page. diff --git a/platform-includes/getting-started-tunneling/javascript.nuxt.mdx b/platform-includes/getting-started-tunneling/javascript.nuxt.mdx new file mode 100644 index 00000000000000..9ba227ed3b6f74 --- /dev/null +++ b/platform-includes/getting-started-tunneling/javascript.nuxt.mdx @@ -0,0 +1,9 @@ +To keep ad blockers from dropping Sentry events, send them through a tunnel on your own origin. The SDK serves the tunnel and forwards the events to Sentry. + +Set `tunnel: true` in your client `Sentry.init`, and add `serveTunnelIntegration` to your server `Sentry.init`: + + + + + +Learn more about the options in `serveTunnelIntegration`. To set up your own tunnel endpoint instead, see the Tunneling page. diff --git a/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx b/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx index 3b1ef2770c630f..9ba227ed3b6f74 100644 --- a/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx +++ b/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx @@ -1,10 +1,9 @@ -You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnel` option inside your `hooks.client.(js|ts)` file's `Sentry.init` to add an API endpoint in your application that forwards Sentry events to Sentry servers. +To keep ad blockers from dropping Sentry events, send them through a tunnel on your own origin. The SDK serves the tunnel and forwards the events to Sentry. -This will send all events to the `tunnel` endpoint. However, the events need to be parsed and redirected to Sentry, so you'll need to do additional configuration on the server. The endpoint must forward only the request body to Sentry and accept only your own DSN. You can find a detailed explanation on how to do this on our [Troubleshooting page](/platforms/javascript/guides/sveltekit/troubleshooting/#using-the-tunnel-option). +Set `tunnel: true` in your client `Sentry.init`, and add `serveTunnelIntegration` to your server `Sentry.init`: -```javascript {filename:hooks.client.(js|ts)} {3} -Sentry.init({ - dsn: "___PUBLIC_DSN___", - tunnel: "/tunnel", -}); -``` + + + + +Learn more about the options in `serveTunnelIntegration`. To set up your own tunnel endpoint instead, see the Tunneling page. diff --git a/public/img/tunnel-flow.svg b/public/img/tunnel-flow.svg new file mode 100644 index 00000000000000..b8885014ad1736 --- /dev/null +++ b/public/img/tunnel-flow.svg @@ -0,0 +1 @@ +WITHOUT A TUNNELexample.comyour app in the browsersentry.ioSentry's ingestblocked by ad blockersWITH A TUNNELexample.comyour app in the browserexample.com/tunnelsame origin, forwards itsentry.ioSentry's ingest \ No newline at end of file