diff --git a/.claude/skills/technical-docs/SKILL.md b/.claude/skills/technical-docs/SKILL.md
index 4b75b004556fb..e1920ce49918d 100644
--- a/.claude/skills/technical-docs/SKILL.md
+++ b/.claude/skills/technical-docs/SKILL.md
@@ -113,16 +113,6 @@ Good best practice:
## Sentry Docs Specific Patterns
-### SplitLayout Usage
-
-Use `` for side-by-side text/code when:
-- The code directly illustrates the text
-- Both are needed to understand the concept
-
-Don't use when:
-- Showing a directory structure (use plain code block)
-- The text is just "here's an example" (just show the code)
-
### PlatformLink Usage
Link to related docs rather than repeating content:
diff --git a/docs/concepts/otlp/forwarding/pipelines/collector.mdx b/docs/concepts/otlp/forwarding/pipelines/collector.mdx
index e420c2d8f1526..c36205566f8fc 100644
--- a/docs/concepts/otlp/forwarding/pipelines/collector.mdx
+++ b/docs/concepts/otlp/forwarding/pipelines/collector.mdx
@@ -18,18 +18,11 @@ Before you begin, ensure you have:
## Step 1: Get Your Sentry OTLP Credentials
-
-
-
-
Find these in [Sentry Project Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/:projectId/keys/) under **Client Keys (DSN)** > **OpenTelemetry (OTLP)**.
- Use the **combined endpoint** if sending both logs and traces
- The Collector appends `/v1/logs` or `/v1/traces` automatically
-
-
-
```bash
# Logs endpoint
___OTLP_LOGS_URL___
@@ -44,25 +37,14 @@ ___OTLP_URL___
x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___
```
-
-
-
-
## Step 2: Configure the Collector
Update your OpenTelemetry Collector configuration to add the `otlphttp` exporter pointing to Sentry.
-
-
-
-
### Logs Only
Use `logs_endpoint` to forward only logs to Sentry.
-
-
-
```yaml {filename:otel-collector.yaml}
exporters:
otlphttp/sentry:
@@ -73,19 +55,10 @@ exporters:
encoding: proto
```
-
-
-
-
-
-
### Traces Only
Use `traces_endpoint` to forward only traces to Sentry.
-
-
-
```yaml {filename:otel-collector.yaml}
exporters:
otlphttp/sentry:
@@ -96,19 +69,10 @@ exporters:
encoding: proto
```
-
-
-
-
-
-
### Logs and Traces
Use the combined `endpoint` to forward both logs and traces. The Collector appends the appropriate path for each signal type.
-
-
-
```yaml {filename:otel-collector.yaml}
exporters:
otlphttp/sentry:
@@ -119,10 +83,6 @@ exporters:
encoding: proto
```
-
-
-
-
## Routing to Multiple Projects
@@ -131,10 +91,6 @@ For simpler multi-project routing, consider the [Sentry Exporter](/concepts/otlp
-
-
-
-
Sentry's OTLP endpoints are project-specific. To route telemetry from different services to different Sentry projects using `otlphttp`, use the [routing connector](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/connector/routingconnector).
This example routes logs to different Sentry projects based on the `service.name` attribute:
@@ -142,9 +98,6 @@ This example routes logs to different Sentry projects based on the `service.name
- Logs with `service.name: "service-b"` go to Project B
- All other logs go to Project A (the default)
-
-
-
```yaml {filename:otel-collector.yaml}
receivers:
otlp:
@@ -187,7 +140,3 @@ service:
receivers: [routing]
exporters: [otlphttp/project-b]
```
-
-
-
-
diff --git a/docs/concepts/otlp/forwarding/pipelines/fluentbit.mdx b/docs/concepts/otlp/forwarding/pipelines/fluentbit.mdx
index 514341e37d0b6..5c7400d09bf1b 100644
--- a/docs/concepts/otlp/forwarding/pipelines/fluentbit.mdx
+++ b/docs/concepts/otlp/forwarding/pipelines/fluentbit.mdx
@@ -16,15 +16,8 @@ Before you begin, ensure you have:
## Step 1: Get Your Sentry OTLP Credentials
-
-
-
-
Find these in [Sentry Project Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/:projectId/keys/) under **Client Keys (DSN)** > **OpenTelemetry (OTLP)**.
-
-
-
```bash
# Logs endpoint
___OTLP_LOGS_URL___
@@ -36,25 +29,14 @@ ___OTLP_TRACES_URL___
x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___
```
-
-
-
-
## Step 2: Configure Fluent Bit
Add the OpenTelemetry output plugin to your Fluent Bit configuration to forward data to Sentry.
-
-
-
-
### Logs Only
Use `logs_uri` to forward only logs to Sentry.
-
-
-
```yaml {filename:fluent-bit.yaml}
pipeline:
outputs:
@@ -81,19 +63,10 @@ pipeline:
Header x-sentry-auth sentry sentry_key=___PUBLIC_KEY___
```
-
-
-
-
-
-
### Traces Only
Use `traces_uri` to forward only traces to Sentry.
-
-
-
```yaml {filename:fluent-bit.yaml}
pipeline:
outputs:
@@ -120,19 +93,10 @@ pipeline:
Header x-sentry-auth sentry sentry_key=___PUBLIC_KEY___
```
-
-
-
-
-
-
### Logs and Traces
Include both `logs_uri` and `traces_uri` to forward logs and traces to Sentry.
-
-
-
```yaml {filename:fluent-bit.yaml}
pipeline:
outputs:
@@ -161,10 +125,6 @@ pipeline:
Header x-sentry-auth sentry sentry_key=___PUBLIC_KEY___
```
-
-
-
-
## Optional Configuration
Fluent Bit's OpenTelemetry output plugin supports additional options for fine-tuning your setup:
diff --git a/docs/concepts/otlp/forwarding/pipelines/sentry-exporter.mdx b/docs/concepts/otlp/forwarding/pipelines/sentry-exporter.mdx
index 700a99ef28297..1f2cef1258f70 100644
--- a/docs/concepts/otlp/forwarding/pipelines/sentry-exporter.mdx
+++ b/docs/concepts/otlp/forwarding/pipelines/sentry-exporter.mdx
@@ -74,15 +74,8 @@ In your Sentry account, go to **[General Settings](https://sentry.io/orgredirect
## Basic Configuration
-
-
-
-
By default, the exporter routes telemetry based on `service.name`. A service with `service.name: payments-api` sends to a Sentry project with slug `payments-api`.
-
-
-
```yaml {filename:otel-collector-config.yaml}
receivers:
otlp:
@@ -113,16 +106,8 @@ service:
exporters: [sentry]
```
-
-
-
-
## Routing Options
-
-
-
-
### Automatic Project Creation
When services spin up dynamically (Kubernetes deployments, serverless functions), you may not have pre-created Sentry projects. Enable `auto_create_projects` to provision them on-demand.
@@ -132,9 +117,6 @@ When services spin up dynamically (Kubernetes deployments, serverless functions)
may be dropped while provisioning completes.
-
-
-
```yaml
exporters:
sentry:
@@ -142,21 +124,12 @@ exporters:
auto_create_projects: true
```
-
-
-
-
-
-
### Custom Project Mapping
When your service names don't match your Sentry project slugs (legacy naming, organizational conventions), map them explicitly.
Services not in the mapping fall back to using `service.name` as the project slug.
-
-
-
```yaml
exporters:
sentry:
@@ -168,19 +141,10 @@ exporters:
api-gateway: ecommerce-gateway
```
-
-
-
-
-
-
### Routing by Different Attributes
Route by environment, team, or any other resource attribute instead of service name.
-
-
-
```yaml
exporters:
sentry:
@@ -192,10 +156,6 @@ exporters:
staging: staging-monitoring
```
-
-
-
-
## Rate Limiting
The exporter respects Sentry's rate limits automatically:
diff --git a/docs/concepts/otlp/forwarding/pipelines/vector.mdx b/docs/concepts/otlp/forwarding/pipelines/vector.mdx
index 729b3754c0929..467c6326ec324 100644
--- a/docs/concepts/otlp/forwarding/pipelines/vector.mdx
+++ b/docs/concepts/otlp/forwarding/pipelines/vector.mdx
@@ -16,15 +16,8 @@ Before you begin, ensure you have:
## Step 1: Get Your Sentry OTLP Credentials
-
-
-
-
Find these in [Sentry Project Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/:projectId/keys/) under **Client Keys (DSN)** > **OpenTelemetry (OTLP)**.
-
-
-
```bash
# Logs endpoint
___OTLP_LOGS_URL___
@@ -33,10 +26,6 @@ ___OTLP_LOGS_URL___
x-sentry-auth: sentry sentry_key=___PUBLIC_KEY___
```
-
-
-
-
## Step 2: Configure Vector
Choose your configuration based on your data source:
@@ -46,10 +35,6 @@ Choose your configuration based on your data source:
## Option A: Forwarding OTLP Data
-
-
-
-
If you're receiving data that's already in OTLP format (from an OpenTelemetry SDK or collector), you can forward it directly to Sentry using the `otlp` codec without any transformation.
@@ -58,9 +43,6 @@ The `otlp` codec requires Vector version [0.51.0](https://vector.dev/releases/0.
-
-
-
```yaml {filename:vector.yaml}
sources:
otel_source:
@@ -86,10 +68,6 @@ sinks:
codec: otlp
```
-
-
-
-
## Option B: Transforming Non-OTLP Data
If your logs come from non-OTLP sources (files, syslog, etc.), you need to use a [remap transform](https://vector.dev/docs/reference/configuration/transforms/remap/) with VRL (Vector Remap Language) to convert your data into the OTEL format before sending to Sentry.
@@ -127,10 +105,6 @@ The OpenTelemetry log format requires a specific structure with `resourceLogs`,
### Example: Forwarding File Logs
-
-
-
-
This example reads logs from a file and forwards them to Sentry.
The remap transform:
@@ -139,9 +113,6 @@ The remap transform:
- Maps file metadata to attributes
- Cleans up original fields
-
-
-
```yaml {filename:vector.yaml}
sources:
app_logs:
@@ -202,16 +173,8 @@ sinks:
codec: otlp
```
-
-
-
-
### Example: Forwarding Syslog
-
-
-
-
For syslog data, you can map severity levels to OTEL severity.
The remap transform:
@@ -219,9 +182,6 @@ The remap transform:
- Preserves syslog metadata as attributes
- Handles the syslog-specific fields
-
-
-
```yaml {filename:vector.yaml}
sources:
syslog_input:
@@ -299,10 +259,6 @@ sinks:
codec: otlp
```
-
-
-
-
## VRL Remap Reference
Here are the key VRL functions you'll use when building OTEL log records:
diff --git a/docs/platforms/dart/common/index.mdx b/docs/platforms/dart/common/index.mdx
index 8cb3ec4aa923a..a15ba542b8fb8 100644
--- a/docs/platforms/dart/common/index.mdx
+++ b/docs/platforms/dart/common/index.mdx
@@ -24,24 +24,13 @@ This guide focuses on plain Dart. If you're building a Flutter app, use the dedi
## Install
-
-
-
-
Add the Sentry Dart SDK to your `pubspec.yaml`:
-
-
-
```yml {filename:pubspec.yaml}
dependencies:
sentry: ^{{@inject packages.version('sentry.dart') }}
```
-
-
-
-
## Configure
Choose the features you want to configure, and this guide will show you how:
@@ -54,15 +43,8 @@ Choose the features you want to configure, and this guide will show you how:
Configuration should happen as **early as possible** in your application's lifecycle.
-
-
-
-
Import and initialize the SDK in your app's entry point:
-
-
-
```dart
import 'package:sentry/sentry.dart';
@@ -84,25 +66,14 @@ Future main() async {
}
```
-
-
-
-
## Verify Your Setup
Let's test your setup and confirm that data reaches your Sentry project.
### Issues
-
-
-
-
To verify that Sentry captures errors and creates issues in your Sentry project, add this intentional error to your application:
-
-
-
```dart
import 'package:sentry/sentry.dart';
@@ -116,10 +87,6 @@ try {
}
```
-
-
-
-
diff --git a/docs/platforms/dart/common/tracing/streamed-spans/index.mdx b/docs/platforms/dart/common/tracing/streamed-spans/index.mdx
index 01c455fadffc5..c0df776307acf 100644
--- a/docs/platforms/dart/common/tracing/streamed-spans/index.mdx
+++ b/docs/platforms/dart/common/tracing/streamed-spans/index.mdx
@@ -67,23 +67,12 @@ Follow ___CURRENT_URL___ to migrate custom instrumentation and filtering to span
## Configuration
-
-
-
-
Configure tracing with
`tracesSampleRate` or `tracesSampler`. No additional lifecycle setting is
required.
-
-
-
-
-
-
-
To opt out of span streaming, set `options.traceLifecycle = SentryTraceLifecycle.static`. Transaction mode supports `beforeSendTransaction` and `ignoreTransactions`; these options have no effect in stream mode.
Use only the APIs for the tracing mode you choose. Calls to APIs from the other mode are ignored:
@@ -122,15 +111,8 @@ The SDK instruments common operations for you, but you can wrap your own code in
### Start a Span
-
-
-
-
Use `Sentry.startSpan` to create a span that ends automatically when the callback completes:
-
-
-
```dart
final result = await Sentry.startSpan(
'my-operation',
@@ -144,16 +126,8 @@ final result = await Sentry.startSpan(
);
```
-
-
-
-
-
Child spans created inside the callback are automatically associated with the parent through zones:
-
-
-
```dart
await Sentry.startSpan('parent-operation', (_) async {
await Sentry.startSpan('child-step-1', (_) async {
@@ -166,19 +140,11 @@ await Sentry.startSpan('parent-operation', (_) async {
});
```
-
-
-
-
-
By default, a span inherits the currently active span as its parent. To change this, pass `parentSpan`:
- `parentSpan: null` forces a service span with no local parent.
- `parentSpan: someSpan` parents the new span under a specific span.
-
-
-
```dart
// force a new service span
await Sentry.startSpan(
@@ -210,44 +176,22 @@ try {
}
```
-
-
-
-
#### Create Spans for Synchronous Work
-
-
-
-
`Sentry.startSpan` takes an asynchronous callback (returning `Future`). For synchronous work, use `Sentry.startSpanSync`, which takes a synchronous callback (returning `T`). Both variants can be freely nested, and parent-child relationships resolve correctly across sync and async boundaries:
-
-
-
```dart
final config = Sentry.startSpanSync('parse-config', (_) {
return Config.parse(raw);
});
```
-
-
-
-
If a span isn't sampled, the callback still runs and receives a no-op span, so all span operations remain safe to call.
#### Create Spans That Outlive a Callback
-
-
-
-
Use `Sentry.startInactiveSpan` when the work can't be wrapped in a single callback — widget lifecycles, stream subscriptions, or platform channel round-trips. You have to call `end()` manually, and other spans do **not** automatically become its children — to nest a span under it, pass it explicitly via `parentSpan` when starting the child.
-
-
-
```dart
final paymentSpan = Sentry.startInactiveSpan(
'payment',
@@ -260,21 +204,10 @@ void onPaymentComplete() {
}
```
-
-
-
-
#### Retroactively Set Span Timing
-
-
-
-
When the real start or end of the work happened before you could create or end the span (for example, a duration measured by a platform channel) pass `startTimestamp` or an explicit `end` time:
-
-
-
```dart
// startTimestamp is available on the callback variants
Sentry.startSpanSync('replay-import', (_) => importRows(),
@@ -285,18 +218,10 @@ final paymentSpan = Sentry.startInactiveSpan('payment');
paymentSpan.end(endTimestamp: nativeEnd);
```
-
-
-
-
## Add Attributes
Attach structured metadata to spans using typed `SentryAttribute` values.
-
-
-
-
You can set attributes when starting a span:
@@ -305,9 +230,6 @@ Sentry automatically sets several standard attributes on spans. To avoid acciden
-
-
-
```dart
await Sentry.startSpan(
'process-order',
@@ -323,16 +245,8 @@ await Sentry.startSpan(
);
```
-
-
-
-
-
Or add them to an already running span with `setAttribute` or `setAttributes`. Use `removeAttribute` to remove an attribute:
-
-
-
```dart
await Sentry.startSpan('handle-request', (span) async {
span.setAttribute(
@@ -349,10 +263,6 @@ await Sentry.startSpan('handle-request', (span) async {
});
```
-
-
-
-
Each attribute value is created with a typed `SentryAttribute` factory:
@@ -411,36 +321,18 @@ You can shape what ends up in Sentry by filtering span data or dropping spans en
### Filter Spans
-
-
-
-
To modify or redact span data before it's sent, use `beforeSendSpan`:
-
-
-
```dart
options.beforeSendSpan = (span, hint) {
span.removeAttribute('http.request.body');
};
```
-
-
-
-
### Drop Spans
-
-
-
-
To prevent specific spans from being sent, use `ignoreSpans`. Rules are evaluated at span start and match against the span name. Attribute-based matching is not yet supported.
-
-
-
```dart
options.ignoreSpans = [
IgnoreSpanRule.nameEquals('health-check'),
@@ -450,10 +342,6 @@ options.ignoreSpans = [
];
```
-
-
-
-
| Factory | Matches |
@@ -471,15 +359,8 @@ When an ignored span has children, the children are re-parented to the nearest r
If you use `tracesSampleRate`, no changes are needed — it works the same way in stream mode.
-
-
-
-
If you use a custom `tracesSampler`, the shape of the sampling context is different in stream mode. Instead of a transaction context, read the span's `name` and `attributes` from `samplingContext.spanContext`:
-
-
-
```dart
options.tracesSampler = (samplingContext) {
final spanContext = samplingContext.spanContext;
@@ -490,10 +371,6 @@ options.tracesSampler = (samplingContext) {
};
```
-
-
-
-
Only service spans are sampled and child spans inherit the service span's decision. When a service span isn't sampled, its callback still executes with a no-op span, so all span operations remain safe to call.
## Distributed Tracing (Optional)
diff --git a/docs/platforms/dart/guides/flutter/index.mdx b/docs/platforms/dart/guides/flutter/index.mdx
index 7a590f8d3b7e6..236116b398d18 100644
--- a/docs/platforms/dart/guides/flutter/index.mdx
+++ b/docs/platforms/dart/guides/flutter/index.mdx
@@ -21,15 +21,8 @@ categories:
Sentry captures data by using an SDK within your application's runtime.
-
-
-
-
We recommend installing the SDK through our [Sentry Wizard](https://github.com/getsentry/sentry-wizard). Run one of the following commands inside your project directory:
-
-
-
```bash {tabTitle:brew} {mdExpandTabs}
brew install getsentry/tools/sentry-wizard && sentry-wizard -i flutter
```
@@ -72,10 +65,6 @@ chmod +x sentry-wizard
npx @sentry/wizard@latest -i flutter
```
-
-
-
-
This will patch your project and configure the SDK. You only need to patch the project once, then you can add the patched files to your version control system.
If you prefer, you can also [set up the SDK manually](/platforms/dart/guides/flutter/manual-setup/).
@@ -102,23 +91,12 @@ Let's test your setup and confirm that data reaches your Sentry project.
### Issues
-
-
-
-
The wizard added a sample exception to `main.dart` that is captured when the app starts. Run your app to send it to Sentry:
-
-
-
```bash
flutter run
```
-
-
-
-
After you've confirmed the issue in Sentry, remove the sample exception from `main.dart` so it isn't captured on every launch.
diff --git a/docs/platforms/dart/guides/flutter/manual-setup.mdx b/docs/platforms/dart/guides/flutter/manual-setup.mdx
index 2e59542fe955a..29fb4440898c6 100644
--- a/docs/platforms/dart/guides/flutter/manual-setup.mdx
+++ b/docs/platforms/dart/guides/flutter/manual-setup.mdx
@@ -12,24 +12,13 @@ If you can't (or prefer not to) run the [automatic setup](/platforms/dart/guides
## Install
-
-
-
-
Add the Sentry Flutter SDK to your `pubspec.yaml`:
-
-
-
```yml {filename:pubspec.yaml}
dependencies:
sentry_flutter: ^{{@inject packages.version('sentry.dart.flutter') }}
```
-
-
-
-
### Apple Platform Setup
The Flutter plugin installs the native Sentry SDK through Swift Package Manager. CocoaPods is not supported for this plugin.
@@ -59,15 +48,8 @@ Choose the features you want to configure, and this guide will show you how:
Configuration should happen as **early as possible** in your application's lifecycle. Logs and metrics are enabled by default; use `Sentry.logger` and `Sentry.metrics` after initialization without an enable flag.
-
-
-
-
Import and initialize the SDK in your app's `main` function:
-
-
-
```dart
import 'package:flutter/widgets.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
@@ -102,25 +84,14 @@ Future main() async {
}
```
-
-
-
-
## Verify Your Setup
Let's test your setup and confirm that data reaches your Sentry project.
### Issues
-
-
-
-
To verify that Sentry captures errors and creates issues in your Sentry project, add this intentional error to your application:
-
-
-
```dart
import 'package:sentry_flutter/sentry_flutter.dart';
@@ -134,10 +105,6 @@ try {
}
```
-
-
-
-
diff --git a/docs/platforms/javascript/common/logs/index.mdx b/docs/platforms/javascript/common/logs/index.mdx
index e423e3f1fd146..8b0c66648def5 100644
--- a/docs/platforms/javascript/common/logs/index.mdx
+++ b/docs/platforms/javascript/common/logs/index.mdx
@@ -14,18 +14,10 @@ Sentry Logs are **high-cardinality** — you can pass any attributes you want an
-
-
-
-
-
## Setup
Logs are enabled by default. Just initialize the SDK and use `Sentry.logger` to send logs.
-
-
-
```javascript
@@ -48,12 +40,6 @@ export default defineCloudflareOptions((env) => ({
-
-
-
-
-
-
## Send Logs
Use `Sentry.logger` to send logs at different levels. A log message is required for Sentry to send the log.
@@ -67,9 +53,6 @@ Use `Sentry.logger` to send logs at different levels. A log message is required
| `error` | Failures that need attention |
| `fatal` | Critical failures, system down |
-
-
-
```javascript
Sentry.logger.trace("Entering function", { fn: "processOrder" });
Sentry.logger.debug("Cache lookup", { key: "user:123" });
@@ -79,21 +62,12 @@ Sentry.logger.error("Payment failed", { reason: "card_declined" });
Sentry.logger.fatal("Database unavailable", { host: "primary" });
```
-
-
-
-
-
-
## Add Context
Pass structured data as the second argument — these attributes become searchable columns in Sentry.
Use `Sentry.logger.fmt` for parameterized messages. Values are automatically extracted as searchable attributes.
-
-
-
```javascript
// Pass attributes directly
Sentry.logger.info("User signed up", {
@@ -108,12 +82,6 @@ const productName = "Widget Pro";
Sentry.logger.info(Sentry.logger.fmt`User ${userId} purchased ${productName}`);
```
-
-
-
-
-
-
## Shared Attributes
@@ -124,9 +92,6 @@ To attach attributes to a broader or narrower context, set them on a specific sc
See Attributes for more information.
-
-
-
```javascript
// Applied to all logs and metrics
Sentry.setAttributes({
@@ -148,12 +113,6 @@ Sentry.withScope((scope) => {
});
```
-
-
-
-
-
-
## Console Integration
Already using `console.log`? Capture console calls as Sentry Logs with `consoleLoggingIntegration`.
@@ -162,9 +121,6 @@ Multiple arguments are parsed as searchable attributes (requires SDK `10.13.0`+)
For [Consola](https://github.com/unjs/consola) users, use `Sentry.createConsolaReporter()` instead (requires SDK `10.12.0`+).
-
-
-
```javascript
@@ -206,21 +162,12 @@ export default defineCloudflareOptions((env) => ({
-
-
-
-
-
-
## Filter Logs
Use `beforeSendLog` to filter or modify logs before they're sent. Return `null` to drop a log.
The log object includes: `level`, `message`, `timestamp`, and `attributes`.
-
-
-
```javascript
@@ -269,11 +216,6 @@ export default defineCloudflareOptions((env) => ({
-
-
-
-
-
## How Logs Link to Other Features
Everything in Sentry is linked by trace. When you're viewing a log, you can jump to the parent trace to see the full request context. When you're viewing a trace, you can see all logs emitted during that operation. This connection makes it easy to move between high-level performance data and detailed diagnostic logs.
diff --git a/docs/platforms/javascript/common/session-replay/index.mdx b/docs/platforms/javascript/common/session-replay/index.mdx
index 84f865183e6be..f3229d5070955 100644
--- a/docs/platforms/javascript/common/session-replay/index.mdx
+++ b/docs/platforms/javascript/common/session-replay/index.mdx
@@ -72,35 +72,18 @@ Session Replay only runs in the browser, so you only need to configure it in `in
There is currently no PII scrubbing in canvas recordings!
-
-
-
-
-
#### Enable Canvas Recording
Add `replayCanvasIntegration()` to record HTML canvas elements. This is opt-in and tree-shaken from your bundle if not used.
-
-
-
-
-
-
-
-
-
#### 3D and WebGL Canvases
For 3D/WebGL canvases, the integration needs `preserveDrawingBuffer` to export images, which can affect performance. To avoid this, enable manual snapshotting and call `snapshot()` inside your paint loop.
Call `snapshot()` in the same execution loop as draw commands to avoid capturing empty buffers.
-
-
-
```javascript
// Step 1: Enable manual snapshotting
Sentry.replayCanvasIntegration({
@@ -116,19 +99,10 @@ function paint() {
}
```
-
-
-
-
-
-
#### WebGPU Canvases
WebGPU canvas textures expire after the current task completes. Use `skipRequestAnimationFrame: true` to capture immediately after rendering.
-
-
-
```javascript
// Step 1: Enable manual snapshotting
Sentry.replayCanvasIntegration({
@@ -150,19 +124,10 @@ function paint() {
}
```
-
-
-
-
### Content Security Policy (CSP)
-
-
-
-
-
#### Configure CSP for Replay
Session Replay uses a WebWorker for compression off the main UI thread. Add these CSP entries to allow workers to load.
@@ -173,19 +138,11 @@ Safari versions ≤ 15.4 also need `child-src`.
-
-
-
```text
worker-src 'self' blob:
child-src 'self' blob:
```
-
-
-
-
-
If you're unable to update your CSP policy to allow inline web workers, you can also [use a custom compression worker](./configuration/#using-a-custom-compression-worker) instead.
@@ -216,11 +173,6 @@ If you prefer not to record an entire session, you can elect to capture a replay
Sampling controls how much traffic results in a Session Replay.
-
-
-
-
-
#### Configure Sample Rates
- - Percentage of sessions to record fully
@@ -240,9 +192,6 @@ Sampling controls how much traffic results in a Session Replay.
-
-
-
```javascript {filename:instrumentation-client.ts}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -257,11 +206,6 @@ Sentry.init({
});
```
-
-
-
-
-
### How Sampling Works
Sampling begins as soon as a session starts. When someone visits your application, sampling decisions happen in this order:
diff --git a/docs/platforms/javascript/common/tracing/streamed-spans/index__v10.x.mdx b/docs/platforms/javascript/common/tracing/streamed-spans/index__v10.x.mdx
index b11a53698d866..6f05a18b2ab64 100644
--- a/docs/platforms/javascript/common/tracing/streamed-spans/index__v10.x.mdx
+++ b/docs/platforms/javascript/common/tracing/streamed-spans/index__v10.x.mdx
@@ -100,15 +100,8 @@ Each flush sends only the spans accumulated since the last flush, grouped into e
### Start a Span
-
-
-
-
Use `Sentry.startSpan()` to create a span that is automatically ended when the callback completes:
-
-
-
```javascript
const result = await Sentry.startSpan(
{ name: "my-operation", attributes: { "my.attribute": "value" } },
@@ -119,17 +112,8 @@ const result = await Sentry.startSpan(
);
```
-
-
-
-
-
-
Child spans created inside the callback are automatically associated with the parent:
-
-
-
```javascript
await Sentry.startSpan({ name: "parent-operation" }, async () => {
await Sentry.startSpan({ name: "child-step-1" }, async () => {
@@ -142,25 +126,14 @@ await Sentry.startSpan({ name: "parent-operation" }, async () => {
});
```
-
-
-
-
For more details on span creation APIs, such as `startSpan`, `startSpanManual`, or `startInactiveSpan`, see Instrumentation.
## Add Attributes
Attach structured metadata to spans using `attributes`, which can be `string`, `number`, or `boolean`, as well as arrays of these types.
-
-
-
-
You can set attributes when starting a span:
-
-
-
```javascript
Sentry.startSpan(
{
@@ -178,17 +151,8 @@ Sentry.startSpan(
);
```
-
-
-
-
-
-
Or add them to an already running span:
-
-
-
```javascript
Sentry.startSpan({ name: "handle-request" }, (span) => {
// Set a single attribute
@@ -202,13 +166,8 @@ Sentry.startSpan({ name: "handle-request" }, (span) => {
});
```
-
-
-
For examples, see Adding Span Attributes.
-
-
### Shared Attributes
Previously, transaction mode applied shared tags (`Sentry.setTag(s)`) to the service span (transaction).
@@ -217,10 +176,6 @@ Set shared attributes on a specific scope instead.
You don't need to remove tags from your code, since they still apply to errors.
Instead, add attributes for all data that's relevant for spans, logs metrics.
-
-
-
-
Use `Sentry.setAttribute` and `Sentry.setAttributes` to attach attributes that are automatically included in all spans (as well as your logs and metrics).
These work just like `Sentry.setTag` and `Sentry.setTags`, but they accept `string`, `number`, and `boolean` values.
@@ -228,9 +183,6 @@ To attach attributes to a broader or narrower context, set them on a specific sc
See Attributes for more information.
-
-
-
```javascript
// Applied to all spans, logs and metrics
Sentry.setAttributes({
@@ -252,10 +204,6 @@ Sentry.withScope((scope) => {
});
```
-
-
-
-
## Breadcrumbs
In stream mode, breadcrumbs are no longer sent with spans.
@@ -265,10 +213,6 @@ They remain attached to errors, so you don't need to change how you record them.
### Filter Spans
-
-
-
-
To modify or redact span data before it's sent, use `beforeSendSpan`. In stream mode, wrap it with `Sentry.withStreamedSpan()` so the SDK applies it to spans as they are flushed rather than only at transaction time.
@@ -278,9 +222,6 @@ To modify or redact span data before it's sent, use
-
-
```JavaScript
@@ -327,10 +268,6 @@ Sentry.init({
-
-
-
-
If you're using `beforeSendSpan`, wrap it with `Sentry.withStreamedSpan()` as shown above, otherwise the SDK falls back to transaction mode.
@@ -353,15 +290,8 @@ If you're using `beforeSendTransaction` to drop spans, use [`ignoreSpans`](#drop
In stream mode, `ignoreSpans` is evaluated at span start, so only the span name and attributes available at that point are taken into account. Any name updates or additional attributes added while the span is active won't influence whether the span is dropped.
-
-
-
-
To prevent specific spans from being created, use the `ignoreSpans` option:
-
-
-
```javascript
@@ -419,10 +349,6 @@ Sentry.init({
-
-
-
-
If a matching span is a service span, all of its child spans are dropped as well. If a child span matches, only that span is dropped and its children are reparented to the nearest ancestor.
diff --git a/docs/platforms/javascript/guides/angular/index.mdx b/docs/platforms/javascript/guides/angular/index.mdx
index 6416ff0e830b9..a16215e9b8f88 100644
--- a/docs/platforms/javascript/guides/angular/index.mdx
+++ b/docs/platforms/javascript/guides/angular/index.mdx
@@ -25,24 +25,12 @@ at least Angular 17.
## Install
-
-
-
-
Run the Sentry wizard to automatically configure Sentry in your Angular application. It will then guide you through the setup process, asking you to enable additional (optional) Sentry features for your application beyond error monitoring.
-
-
-
-
```bash
npx @sentry/wizard@latest -i angular
```
-
-
-
-
This guide assumes that you enable all features and allow the wizard to add an example component to your application. You can add or remove features at any time, but setting them up now will save you the effort of configuring them manually later.
diff --git a/docs/platforms/javascript/guides/angular/manual-setup.mdx b/docs/platforms/javascript/guides/angular/manual-setup.mdx
index 9f04c928e159c..e191d042612c7 100644
--- a/docs/platforms/javascript/guides/angular/manual-setup.mdx
+++ b/docs/platforms/javascript/guides/angular/manual-setup.mdx
@@ -23,20 +23,10 @@ You need:
## Install
-
-
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application.
If you're updating your Sentry SDK to the latest version, check out our migration guide to learn more about breaking changes.
-
-
-
-
```bash {tabTitle:npm}
npm install @sentry/angular --save
```
@@ -49,10 +39,6 @@ yarn add @sentry/angular
pnpm add @sentry/angular
```
-
-
-
-
In its current major version, the Sentry Angular SDK supports Angular 14 and newer.
@@ -94,18 +80,8 @@ Choose the features you want to configure, and this guide will show you how:
### Initialize the SDK
-
-
-
-
-
-
The main configuration should happen as early as possible in your app's lifecycle. Typically that means in your `main.ts` file.
-
-
-
-
```typescript {tabTitle: App Config} {mdExpandTabs} {filename: main.ts} {5-41}
import { bootstrapApplication } from "@angular/platform-browser";
import { appConfig } from "./app/app.config";
@@ -219,18 +195,8 @@ platformBrowserDynamic()
.catch((err) => console.error(err));
```
-
-
-
-
### Register Sentry Providers
-
-
-
-
-
-
The Sentry Angular SDK exports a couple of Angular providers that are necessary to fully instrument your application. We recommend registering them in your `app.config.ts` or main `app.module.ts`:
@@ -239,10 +205,6 @@ If your Angular app is configured for SSR, make sure that the Sentry providers a
-
-
-
-
```typescript {tabTitle: App Config (Angular 19+)} {mdExpandTabs} {filename: app.config.ts} {9, 14-25}
import {
ApplicationConfig,
@@ -338,10 +300,6 @@ import * as Sentry from "@sentry/angular";
export class AppModule {}
```
-
-
-
-
@@ -379,10 +337,6 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
To verify that Sentry captures errors and creates issues in your Sentry project, add the following test button to one of your components (e.g. `app.component.ts`), which will trigger an error that Sentry will capture when you click it.
@@ -391,10 +345,6 @@ To verify that Sentry captures errors and creates issues in your Sentry project,
-
-
-
-
```javascript {filename: app.component.ts} {5, 9-11}
@Component({
selector: "app-root",
@@ -410,25 +360,13 @@ class AppComponent {
}
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet to start a trace to measure the time it takes to execute your code.
Open the page in a browser and click the button to trigger a frontend error and performance trace.
-
-
-
-
```javascript {filename: app.component.ts} {10-11, 13-14}
@Component({
selector: "app-root",
@@ -448,10 +386,6 @@ class AppComponent {
}
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/azure-functions/index.mdx b/docs/platforms/javascript/guides/azure-functions/index.mdx
index c15efbdf34fbc..731574513496e 100644
--- a/docs/platforms/javascript/guides/azure-functions/index.mdx
+++ b/docs/platforms/javascript/guides/azure-functions/index.mdx
@@ -25,32 +25,14 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add `@sentry/node` as a runtime dependency to your application:
-
-
-
-
-
-
-
## Configure
-
-
-
-
Make sure to initialize Sentry at the top of your function file before importing any other modules:
-
-
-
```javascript {tabTitle:async}
const Sentry = require("@sentry/node");
// ___PRODUCT_OPTION_START___ profiling
@@ -85,21 +67,10 @@ Sentry.init({
// your function code
```
-
-
-
-
### Capture Errors
-
-
-
-
Because Azure Functions are short-lived, you have to explicitly `flush` Sentry events after calling `captureException`, or they may be lost before being sent to Sentry.
-
-
-
```javascript {tabTitle:async}
const Sentry = require("@sentry/node");
@@ -121,10 +92,6 @@ module.exports = async function (context, req) {
};
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
@@ -139,15 +106,8 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
Let's verify that Sentry captures errors and creates issues in your Sentry project. Add an intentional error in your function:
-
-
-
```javascript {tabTitle:async}
const Sentry = require("@sentry/node");
@@ -172,21 +132,11 @@ module.exports = async function (context, req) {
};
```
-
-
-
-
### Tracing
-
-
-
To test tracing, update your function to include a custom span:
-
-
-
```javascript {tabTitle:async}
const Sentry = require("@sentry/node");
@@ -206,10 +156,6 @@ module.exports = async function (context, req) {
};
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/bun/index.mdx b/docs/platforms/javascript/guides/bun/index.mdx
index d70ce4d8aa9ac..ba7b0ba8e49a6 100644
--- a/docs/platforms/javascript/guides/bun/index.mdx
+++ b/docs/platforms/javascript/guides/bun/index.mdx
@@ -23,37 +23,19 @@ Choose the features you want to configure, and this guide will show you how:
### Install the SDK
-
-
-
-
Use the Bun package manager to add the Sentry SDK to your application:
-
-
-
```bash {tabTitle:Bun}
bun add @sentry/bun
```
-
-
-
-
## Configure
### Initialize the Sentry SDK
-
-
-
-
Sentry should be initialized as early in your app as possible.
Create a file named `instrument.js` in the root directory of your project and add the following code:
-
-
-
```javascript {filename: instrument.js}
import * as Sentry from "@sentry/bun";
@@ -73,23 +55,12 @@ Sentry.init({
});
```
-
-
-
-
### Build With the Sentry Plugin (Recommended)
-
-
-
-
We recommend building with the Sentry plugin, because it adds spans from your dependencies, such as database drivers, AI SDKs, and web frameworks like Express, Koa and Hapi. Bun has no runtime hook Sentry can use to instrument those packages, so the plugin rewrites them as `bun build` bundles them.
Add `sentryBunPlugin` from `@sentry/bun/plugin` to your `Bun.build()` call, then run the output the same way, with `--preload`. Errors, the spans you create yourself, and `Bun.serve`, `node:http` and `fetch` spans work either way.
-
-
-
```typescript {filename:build.ts}
import { sentryBunPlugin } from "@sentry/bun/plugin";
@@ -101,21 +72,10 @@ await Bun.build({
});
```
-
-
-
-
### Apply Instrumentation to Your App
-
-
-
-
Preload your instrumentation file with the [`--preload`](https://bun.com/docs/runtime#param-preload) flag. This is what guarantees that `Sentry.init()` runs before any other module is loaded.
-
-
-
```bash {tabTitle:From source}
bun --preload ./instrument.js app.js
```
@@ -124,10 +84,6 @@ bun --preload ./instrument.js app.js
bun --preload ./instrument.js dist/app.js
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
@@ -142,15 +98,8 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
First, let's verify that Sentry captures errors and creates issues in your Sentry project. Add the following code snippet to your main application file, which will call an undefined function, triggering an error that Sentry will capture:
-
-
-
```javascript
setTimeout(() => {
try {
@@ -161,22 +110,11 @@ setTimeout(() => {
}, 99);
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code:
-
-
-
```javascript
Sentry.startSpan(
{
@@ -195,10 +133,6 @@ Sentry.startSpan(
);
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/capacitor/index.mdx b/docs/platforms/javascript/guides/capacitor/index.mdx
index e80630e6733c3..7b8dab639d01e 100644
--- a/docs/platforms/javascript/guides/capacitor/index.mdx
+++ b/docs/platforms/javascript/guides/capacitor/index.mdx
@@ -22,21 +22,10 @@ This guide will show you setup instructions for Angular, React, Vue, and Nuxt. I
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add Sentry's Capacitor SDK and the SDK for the framework you're using to your application:
-
-
-
-
-
-
-
#### Angular
@@ -74,23 +63,12 @@ Choose the features you want to configure, and this guide will show you how:
### Initialize the Sentry SDK
-
-
-
-
Initialize Sentry as early as possible in your application's lifecycle.
If you're using Angular, React, Vue, or Nuxt, make sure to forward the `init` method from the framework's Sentry SDK, as you can see in these code snippets. If you're following the vanilla setup, you don't need to do this.
-
-
-
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
@@ -109,10 +87,6 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
To verify that Sentry captures errors and creates issues in your Sentry project, add the following test button and logic.
@@ -121,9 +95,6 @@ To verify that Sentry captures errors and creates issues in your Sentry project,
-
-
-
```javascript {tabTitle: Angular 12, 13, 14+} {mdExpandTabs}
@Component({
selector: "app-root",
@@ -187,24 +158,13 @@ export default {
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet and wrap the error in a custom span.
Then, open the page in a browser and click the button to trigger a frontend error and trace.
-
-
-
```javascript {tabTitle: Angular 12, 13, 14+} {mdExpandTabs}
import * as Sentry from "@sentry/capacitor";
@@ -292,10 +252,6 @@ export default {
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/cloudflare/features/pages.mdx b/docs/platforms/javascript/guides/cloudflare/features/pages.mdx
index 1815e5364ca64..b750335e57c4c 100644
--- a/docs/platforms/javascript/guides/cloudflare/features/pages.mdx
+++ b/docs/platforms/javascript/guides/cloudflare/features/pages.mdx
@@ -28,17 +28,10 @@ Cloudflare Pages applications are instrumented with the `sentryPagesPlugin` midd
### Add the Middleware
-
-
-
-
To use the Sentry SDK, add the `sentryPagesPlugin` as [middleware to your Cloudflare Pages application](https://developers.cloudflare.com/pages/functions/middleware/).
-
-
-
```javascript {filename:functions/_middleware.js}
import * as Sentry from "@sentry/cloudflare";
@@ -56,20 +49,10 @@ export const onRequest = [
];
```
-
-
-
-
-
-
-
If you don't have access to the `onRequest` middleware API, you can use the `wrapRequestHandler` API instead. For example:
-
-
-
```javascript
// hooks.server.js
import { wrapRequestHandler } from "@sentry/cloudflare/request";
@@ -87,10 +70,6 @@ export const handle = ({ event, resolve }) => {
};
```
-
-
-
-
## Control the Data You Send to Sentry (Optional)
@@ -115,25 +94,14 @@ For the full list of categories and their defaults, see the
-
-
-
To test your tracing configuration, start a span around the failing code:
```javascript {filename:debug-sentry.js}
diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx
index d409e432b6b51..bd7fec2cc7944 100644
--- a/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx
+++ b/docs/platforms/javascript/guides/cloudflare/frameworks/astro.mdx
@@ -36,18 +36,10 @@ The SDK reads standard Sentry environment variables including `SENTRY_DSN`, `SEN
-
-
For Cloudflare Pages, you need to manually set up the `@sentry/cloudflare` SDK using the Pages middleware.
-
-
-
1. Install both SDKs:
-
-
-
```bash {tabTitle:npm}
npm install @sentry/astro @sentry/cloudflare
```
@@ -60,17 +52,8 @@ yarn add @sentry/astro @sentry/cloudflare
pnpm add @sentry/astro @sentry/cloudflare
```
-
-
-
-
-
-
2. Add the Sentry Astro integration to your `astro.config.mjs`:
-
-
-
```javascript {filename:astro.config.mjs}
import { defineConfig } from "astro/config";
import cloudflare from "@astrojs/cloudflare";
@@ -82,17 +65,8 @@ export default defineConfig({
});
```
-
-
-
-
-
-
3.
-
-
-
```javascript {filename:functions/_middleware.js}
import * as Sentry from "@sentry/cloudflare";
@@ -106,17 +80,8 @@ export const onRequest = [
];
```
-
-
-
-
-
-
4. Make sure to [configure Cloudflare for Sentry](/platforms/javascript/guides/cloudflare/#wrangler-configuration).
-
-
-
diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx
index f288e761527f2..fad55e7a83325 100644
--- a/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx
+++ b/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx
@@ -35,15 +35,8 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the React Router and Cloudflare SDK:
-
-
-
```bash {tabTitle:npm}
npm install @sentry/react-router @sentry/cloudflare --save
```
@@ -56,25 +49,14 @@ yarn add @sentry/react-router @sentry/cloudflare
pnpm add @sentry/react-router @sentry/cloudflare
```
-
-
-
-
## Configure
### Configure Client-side Sentry
-
-
-
-
Initialize Sentry in your `entry.client.tsx` file.
The `sentryOnError` handler integrates with React Router's [`onError` hook](https://reactrouter.com/how-to/error-reporting) to automatically capture and report client-side errors to Sentry.
-
-
-
```tsx {filename: app/entry.client.tsx}
import { HydratedRouter } from "react-router/dom";
import * as Sentry from "@sentry/react-router/cloudflare";
@@ -133,21 +115,10 @@ startTransition(() => {
});
```
-
-
-
-
### Configure Server-side Sentry
-
-
-
-
First, create an `instrument.server.mjs` file to initialize Sentry on the server:
-
-
-
```js {filename:instrument.server.mjs}
import * as Sentry from "@sentry/react-router";
@@ -166,12 +137,6 @@ Sentry.init({
});
```
-
-
-
-
-
-
Next, update your `server.ts` file to use the `wrapRequestHandler` method from the `@sentry/cloudflare/request` subpath:
@@ -186,9 +151,6 @@ On Shopify Oxygen, never import anything directly from `@sentry/cloudflare`. Onl
-
-
-
```ts {filename:server.ts}
import { wrapRequestHandler } from "@sentry/cloudflare/request";
// ...other imports
@@ -231,23 +193,12 @@ export default {
};
```
-
-
-
-
### Enable Distributed Tracing
-
-
-
-
Update your `entry.server.tsx` file to inject trace meta tags:
-
-
-
```tsx {filename:app/entry.server.tsx}
import "./instrument.server";
import { HandleErrorFunction, ServerRouter } from "react-router";
@@ -289,25 +240,14 @@ export const handleError: HandleErrorFunction = (error, { request }) => {
export default Sentry.wrapSentryHandleRequest(handleRequest);
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
-
-
-
-
The stack traces in your Sentry errors probably won't look like your actual code without unminifying them. To fix this, upload your source maps to Sentry.
First, update `vite.config.ts` to include the `sentryReactRouter` plugin, making sure to pass both the Vite and Sentry configurations to it.
-
-
-
```ts {filename:vite.config.ts}
import { reactRouter } from "@react-router/dev/vite";
import { hydrogen } from "@shopify/hydrogen/vite";
@@ -336,17 +276,8 @@ export default defineConfig((config) => ({
}));
```
-
-
-
-
-
-
Since the `buildEnd` hook will not be executed for Hydrogen, you need to manually upload source maps using the [Sentry CLI](/cli/) instead.
-
-
-
```bash
# Inject debug IDs
sentry-cli sourcemaps inject /path/to/build/dir
@@ -354,10 +285,6 @@ sentry-cli sourcemaps inject /path/to/build/dir
sentry-cli sourcemaps upload /path/to/build/dir
```
-
-
-
-
### Control the Data You Send to Sentry (Optional)
-
-
-
To verify that Sentry captures errors and creates issues in your Sentry project, throw an error in a loader.
Next, open the `/sentry-test` route in your browser, and you should trigger an error.
-
-
-
```tsx {filename: app/routes/sentry-test.tsx}
import type { Route } from "./+types/sentry-test";
@@ -397,24 +317,13 @@ export default function SentryTestPage() {
}
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code.
Open the `/sentry-test` route in your browser. You should start a trace and trigger an error.
-
-
-
```tsx {filename: app/routes/sentry-test.tsx}
import * as Sentry from "@sentry/react-router/cloudflare";
import type { Route } from "./+types/sentry-test";
@@ -436,10 +345,6 @@ export default function SentryTestPage() {
}
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx
index 87b9c85bf2122..dc987930018ab 100644
--- a/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx
+++ b/docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx
@@ -27,17 +27,10 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry Remix and Cloudflare SDKs to your application.
With npm, add `--legacy-peer-deps`: `@remix-run/cloudflare` requires `@cloudflare/workers-types` version 4, while Wrangler 4 requires version 5.
-
-
-
```bash {tabTitle:npm}
npm install @sentry/remix @sentry/cloudflare --save --legacy-peer-deps
```
@@ -50,10 +43,6 @@ yarn add @sentry/remix @sentry/cloudflare
pnpm add @sentry/remix @sentry/cloudflare
```
-
-
-
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
-
-
-
-
## Configure
When deploying TanStack Start to Cloudflare Workers, you need to wrap the server entry point with `Sentry.withSentry` from `@sentry/cloudflare`. TanStack Start allows you to create a custom server entry file for this purpose.
@@ -58,10 +47,6 @@ When deploying TanStack Start to Cloudflare Workers, you need to wrap the server
### Create a Custom Server Entry
-
-
-
-
Create a `src/server.ts` file that wraps the TanStack Start handler with Sentry.
Use `wrapFetchWithSentry` from `@sentry/tanstackstart-react` to instrument TanStack Start server functions with tracing.
@@ -72,9 +57,6 @@ Due to type differences between TanStack Start and Cloudflare Workers, you'll ne
-
-
-
```typescript {filename:src/server.ts}
import * as Sentry from "@sentry/cloudflare";
import { wrapFetchWithSentry } from "@sentry/tanstackstart-react";
@@ -95,21 +77,10 @@ export default Sentry.withSentry(
);
```
-
-
-
-
### Update Wrangler Configuration
-
-
-
-
Update your `wrangler.jsonc` (or `wrangler.toml`) to use your custom server entry:
-
-
-
```json {diff} {filename:wrangler.jsonc}
{
"name": "my-tanstack-app",
@@ -118,21 +89,10 @@ Update your `wrangler.jsonc` (or `wrangler.toml`) to use your custom server entr
}
```
-
-
-
-
### Configure Client-Side Sentry
-
-
-
-
Initialize Sentry in your `src/router.tsx` file for client-side error tracking:
-
-
-
```tsx {diff} {filename:src/router.tsx}
+import * as Sentry from "@sentry/tanstackstart-react";
import { createRouter } from '@tanstack/react-router'
@@ -177,16 +137,8 @@ export const getRouter = () => {
}
```
-
-
-
-
### Capture Server-Side Errors
-
-
-
-
To capture server-side errors from HTTP requests and server function calls, add Sentry's global middlewares to `createStart()` in your `src/start.ts` file.
The Sentry middleware should be the first middleware in the arrays to ensure all errors are captured.
@@ -196,9 +148,6 @@ The Sentry middleware should be the first middleware in the arrays to ensure all
`captureException` to manually capture those errors.
-
-
-
```tsx {filename:src/start.ts}
import {
sentryGlobalFunctionMiddleware,
@@ -214,10 +163,6 @@ export const startInstance = createStart(() => {
});
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
{
## Verify Your Setup
-
-
-
-
To verify Sentry is capturing errors, add a test button to one of your pages:
-
-
-
```tsx
-
-
-
Run your app with `wrangler dev` (or through your Vite build with Cloudflare plugin), click the button, and check your Sentry project for the error.
diff --git a/docs/platforms/javascript/guides/cloudflare/index.mdx b/docs/platforms/javascript/guides/cloudflare/index.mdx
index 07bc0e6562d4e..b82a9bc7d03ae 100644
--- a/docs/platforms/javascript/guides/cloudflare/index.mdx
+++ b/docs/platforms/javascript/guides/cloudflare/index.mdx
@@ -44,21 +44,10 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
-
-
-
-
## Configure
This guide sets Sentry up through Vite, which is what we recommend for Cloudflare Workers. The plugin does the wiring at build time, so your Worker code stays untouched.
@@ -71,19 +60,12 @@ Not using Vite? See the Wrangler setup
-
-
-
Add the Sentry plugin to your existing `vite.config.ts`, next to `cloudflare()`. Both of its behaviors are on by default.
`autoInstrumentation` wraps your Worker entry, and any Durable Object, Workflow or Agents SDK class in your wrangler config, at build time, so you don't have to call `Sentry.withSentry()` yourself. `buildTimeInstrumentation` instruments bundled dependencies such as database clients, which is the only way to trace them in the Workers runtime, where the SDK can't patch them at runtime.
To see its options, which packages it instruments, and how to opt out of either behavior, see Vite Plugin.
-
-
-
```typescript {filename:vite.config.ts} {diff}
import { cloudflare } from "@cloudflare/vite-plugin";
+import { sentryCloudflareVitePlugin } from "@sentry/cloudflare/vite";
@@ -97,10 +79,6 @@ To see its options, which packages it instruments, and how to opt out of either
});
```
-
-
-
-
Run `vite build` before `wrangler deploy`, and use `vite dev` in place of `wrangler dev` for local development.
### Wrangler Configuration
@@ -112,17 +90,10 @@ Run `vite build` before `wrangler deploy`, and use `vite dev` in place of `wrang
### Add Your Sentry Options
-
-
-
-
Create an `instrument.server.ts` file next to your Worker entry, the file that `main` points at in your wrangler config. If `main` is `src/index.ts`, the file belongs at `src/instrument.server.ts`, not at the project root.
The name is fixed. The plugin looks for `instrument.server` with a `.ts`, `.mts`, `.js`, `.mjs` or `.cjs` extension, and passes its default export to `withSentry`. Use `defineCloudflareOptions` to get the options type-checked.
-
-
-
```typescript {filename:src/instrument.server.ts}
import { defineCloudflareOptions } from "@sentry/cloudflare";
@@ -138,10 +109,6 @@ export default defineCloudflareOptions((env) => ({
}));
```
-
-
-
-
If you don't add an `instrument.server.*` file, the SDK reads its configuration from the Worker's `env` at runtime instead: `SENTRY_DSN`, `SENTRY_ENVIRONMENT`, `SENTRY_TRACES_SAMPLE_RATE`, `SENTRY_DEBUG`, `SENTRY_TUNNEL` and `SENTRY_TRACE_LIFECYCLE`. Set them as secrets or vars in your wrangler config.
@@ -164,15 +131,8 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
First, let's make sure Sentry is correctly capturing errors and creating issues in your project.
-
-
-
-
Add the following code snippet to your main worker file to create a `/debug-sentry` route that triggers an error when called:
-
-
-
```javascript {filename:index.js}
export default {
async fetch(request) {
@@ -188,10 +148,6 @@ export default {
};
```
-
-
-
-
### Tracing
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes to run your code.
diff --git a/docs/platforms/javascript/guides/cloudflare/install/wrangler.mdx b/docs/platforms/javascript/guides/cloudflare/install/wrangler.mdx
index 11229f092a97d..362b6f4b63789 100644
--- a/docs/platforms/javascript/guides/cloudflare/install/wrangler.mdx
+++ b/docs/platforms/javascript/guides/cloudflare/install/wrangler.mdx
@@ -23,15 +23,8 @@ You also have to keep the wrapper in your code, and list your RPC trace propagat
## Configure
-
-
-
-
Wrap your exported handler with `Sentry.withSentry()` to start capturing errors and traces from your Worker:
-
-
-
```typescript {filename:index.ts}
import * as Sentry from "@sentry/cloudflare";
@@ -53,10 +46,6 @@ export default Sentry.withSentry(
);
```
-
-
-
-
## Instrument Durable Objects, Workflows, and Agents
Durable Objects, Workflows, and Agents SDK classes each need their own wrapper: `instrumentDurableObjectWithSentry`, `instrumentWorkflowWithSentry`, and `instrumentAgentWithSentry`. Each wrapper takes an options callback like `withSentry` does. Define the callback once to share it, and export each wrapped class under the name that your wrangler config uses:
@@ -128,15 +117,8 @@ For the full list of categories and their defaults, see the
-
-
-
Then head over to your project on [Sentry.io](https://sentry.io) to view the collected data (it takes a couple of moments for the data to appear).
diff --git a/docs/platforms/javascript/guides/cordova/index.mdx b/docs/platforms/javascript/guides/cordova/index.mdx
index f1027655a7367..157e67b41932c 100644
--- a/docs/platforms/javascript/guides/cordova/index.mdx
+++ b/docs/platforms/javascript/guides/cordova/index.mdx
@@ -46,10 +46,6 @@ using [Sentry Capacitor](/platforms/javascript/guides/capacitor/), [Sentry React
### Install the Sentry SDK
-
-
-
-
Run this `cordova` command to add the Sentry SDK to your application:
This command starts the Sentry Wizard, which will patch your project (you need to do this only once).
@@ -59,30 +55,16 @@ The wizard helps configure your project by:
- Adding a build step to Xcode to upload debug symbols for iOS crashes
- Configuring source map uploads so you can see your original JavaScript code in Sentry instead of minified production code
-
-
-
```bash
cordova plugin add sentry-cordova
```
-
-
-
-
## Configure
### Initialize the Sentry SDK
-
-
-
-
Initialize Sentry as early as possible in your application. For this, `init` the SDK in the `deviceready` event:
-
-
-
```javascript
onDeviceReady: function() {
var Sentry = cordova.require("sentry-cordova.Sentry");
@@ -92,29 +74,14 @@ onDeviceReady: function() {
}
```
-
-
-
-
### Allow the Sentry Domain
-
-
-
-
Make sure your app can talk to Sentry by adding this to your `config.xml`:
-
-
-
```xml {filename:config.xml}
```
-
-
-
-
### Control the Data You Send to Sentry (Optional)
See Data Collected for the data the SDK sends by default, and Scrubbing Sensitive Data to learn how to remove data before it's sent.
@@ -123,21 +90,10 @@ See Data Collected
-
-
-
This snippet includes an intentional error, so you can test that everything is working as soon as you set it up.
-
-
-
-
-
-
-
### View Captured Data in Sentry
To view and resolve the recorded error, log in to [sentry.io](https://sentry.io) and select your project. Clicking the error's title opens a page where you can view detailed information and mark it as resolved.
diff --git a/docs/platforms/javascript/guides/deno/index.mdx b/docs/platforms/javascript/guides/deno/index.mdx
index 03e6221cbfa32..098dfe3040692 100644
--- a/docs/platforms/javascript/guides/deno/index.mdx
+++ b/docs/platforms/javascript/guides/deno/index.mdx
@@ -29,34 +29,16 @@ Choose the features you want to configure, and this guide will show you how:
### Import the Sentry SDK
-
-
-
-
Import the Sentry Deno SDK directly from the npm registry, before importing any other modules. The first line registers the hook that instruments your database drivers, message queues, AI libraries and web frameworks. It only works as the first import of your entry file:
-
-
-
```javascript {filename: main.ts}
import "___SDK_PACKAGE___/import";
import * as Sentry from "___SDK_PACKAGE___";
// your other imports
```
-
-
-
-
-
-
-
-
The hook reads your dependencies from a local `node_modules` directory, not from Deno's global npm cache. Set `nodeModulesDir` in your `deno.json`:
-
-
-
```json {filename: deno.json}
{
"imports": {
@@ -66,23 +48,12 @@ The hook reads your dependencies from a local `node_modules` directory, not from
}
```
-
-
-
-
## Configure
### Initialize the Sentry SDK
-
-
-
-
Initialize Sentry as early as possible in your app:
-
-
-
```javascript {filename: main.ts}
import "___SDK_PACKAGE___/import";
import * as Sentry from "___SDK_PACKAGE___";
@@ -103,21 +74,10 @@ Sentry.init({
});
```
-
-
-
-
### Grant Permissions
-
-
-
-
Deno blocks access to the network, the file system and system information until you grant it. Start your app with all four permissions so that the SDK can send complete events. Add the other hosts your app talks to, separated by commas:
-
-
-
```bash
deno run \
--allow-net=___ORG_INGEST_DOMAIN___ \
@@ -127,10 +87,6 @@ deno run \
main.ts
```
-
-
-
-
| Flag | What it gives you |
@@ -158,15 +114,8 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
First, let's verify that Sentry captures errors and creates issues in your Sentry project. Add the following code snippet to your main application file, which will call an undefined function, triggering an error that Sentry will capture:
-
-
-
```javascript
setTimeout(() => {
try {
@@ -177,22 +126,11 @@ setTimeout(() => {
}, 99);
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code:
-
-
-
```javascript
Sentry.startSpan(
{
@@ -211,10 +149,6 @@ Sentry.startSpan(
);
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/effect/index.mdx b/docs/platforms/javascript/guides/effect/index.mdx
index 3cd8fb2579da7..9c91a891e8b69 100644
--- a/docs/platforms/javascript/guides/effect/index.mdx
+++ b/docs/platforms/javascript/guides/effect/index.mdx
@@ -34,15 +34,8 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application.
-
-
-
```bash {tabTitle:npm}
npm install @sentry/effect --save
```
@@ -55,20 +48,12 @@ yarn add @sentry/effect
pnpm add @sentry/effect
```
-
-
-
-
## Configure
The SDK provides an `effectLayer` that initializes Sentry. You can compose it with additional Effect layers to enable tracing, logging, and metrics. The `effectLayer`, `SentryEffectTracer`, `SentryEffectLogger`, and `SentryEffectMetricsLayer` exports are the same for Effect v3 and v4. The only difference between versions is how you compose layers for tracing and logging, which is covered in the snippets below.
### Effect v3
-
-
-
-
- Node: Provide `SentryLive` before launching your HTTP layer (for example, with `NodeRuntime`).
@@ -76,9 +61,6 @@ The SDK provides an `effectLayer` that initializes Sentry. You can compose it wi
In both cases, use `Layer.setTracer` to configure tracing and `Logger.replace` to configure logging.
-
-
-
```typescript {tabTitle: Server} {filename: main.ts}
import * as Sentry from "@sentry/effect";
import { NodeRuntime } from "@effect/platform-node";
@@ -159,25 +141,14 @@ const SentryLive = Layer.mergeAll(
const MainLive = YourAppLayer.pipe(Layer.provide(SentryLive));
```
-
-
-
-
### Effect v4
-
-
-
-
Effect v4 changes how you install the default `Tracer` and `Logger` services. Use `Layer.succeed(Tracer.Tracer, …)` plus `Logger.layer([…])`.
With SDK version 10.75.0 or higher, `effectLayer` also registers a Sentry `ErrorReporter`. Sentry then captures the failures that Effect reports, for example a route handler of Effect's HTTP server that fails. Learn more in Capturing Errors.
-
-
-
```typescript {tabTitle: Server} {filename: main.ts}
import * as Sentry from "@sentry/effect";
import { NodeRuntime } from "@effect/platform-node";
@@ -260,10 +231,6 @@ const SentryLive = Layer.mergeAll(
const MainLive = YourAppLayer.pipe(Layer.provide(SentryLive));
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
@@ -278,15 +245,8 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
To verify that Sentry captures errors and creates issues in your Sentry project, add a test error:
-
-
-
```typescript
import { Effect } from "effect";
import * as Sentry from "@sentry/effect";
@@ -298,22 +258,11 @@ const program = Effect.gen(function* () {
// Run with your layer that includes Sentry.effectLayer
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet to create a custom span:
-
-
-
```typescript
import { Effect } from "effect";
import * as Sentry from "@sentry/effect";
@@ -331,25 +280,14 @@ const program = Effect.gen(function* () {
});
```
-
-
-
-
### Logs
-
-
-
To verify that Sentry catches your logs, add some log statements to your application:
-
-
-
-
```typescript
import { Effect } from "effect";
import * as Sentry from "@sentry/effect";
@@ -373,10 +311,6 @@ const program = Effect.gen(function* () {
});
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/electron/index.mdx b/docs/platforms/javascript/guides/electron/index.mdx
index 354c8b2292fca..acd7adcda290e 100644
--- a/docs/platforms/javascript/guides/electron/index.mdx
+++ b/docs/platforms/javascript/guides/electron/index.mdx
@@ -14,15 +14,8 @@ categories:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
```bash {tabTitle:npm}
npm install @sentry/electron --save
```
@@ -35,10 +28,6 @@ yarn add @sentry/electron
pnpm add @sentry/electron
```
-
-
-
-
## Configure
Choose the features you want to configure, and this guide will show you how:
@@ -58,15 +47,8 @@ You should initialize the SDK in both the `main` process and every `renderer` pr
### Configure the Main Process
-
-
-
-
Initialize the SDK in your Electron `main` process as early as possible:
-
-
-
```javascript
import * as Sentry from "@sentry/electron/main";
@@ -85,21 +67,10 @@ Sentry.init({
});
```
-
-
-
-
### Configure the Renderer Process
-
-
-
-
Initialize the SDK in your Electron renderer processes as early as possible. All renderer events are sent through the main process so passing `dsn`, `release` or `environment` to renderer `init` will have no effect.
-
-
-
```javascript
import * as Sentry from "@sentry/electron/renderer";
@@ -139,64 +110,32 @@ Sentry.init({
});
```
-
-
-
-
### Configure Any Utility Processes
-
-
-
-
If your app uses utility processes, initialize Sentry in each one.
-
-
-
```javascript
import * as Sentry from "@sentry/electron/utility";
Sentry.init();
```
-
-
-
-
-
-
-
If your app uses a preload script and `contextIsolation: true`, Sentry can't automatically capture errors that occur in the preload context. To include those, initialize Sentry in your preload script as well:
-
-
-
```javascript
import * as Sentry from "@sentry/electron/renderer";
Sentry.init(); // don't forget to add your configuration options
```
-
-
-
-
-
-
-
-
If you change the `userData` directory used by your app, ensure this change is made before you configure the SDK as this path is used to cache scope and events between application restarts.
-
-
-
```javascript
import { app } from "electron";
import * as Sentry from "@sentry/electron/main";
@@ -205,23 +144,12 @@ app.setPath("userData", "~/.config/my-app");
Sentry.init({ dsn: "___PUBLIC_DSN___" });
```
-
-
-
-
### Using Framework-Specific SDKs
-
-
-
-
If you're using a framework in your renderers, you can combine the Electron SDK with the framework SDK:
-
-
-
```javascript
import { init } from "@sentry/electron/renderer";
import { init as reactInit } from "@sentry/react";
@@ -238,10 +166,6 @@ init(
);
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
@@ -256,17 +180,10 @@ Let's test your setup and confirm that Sentry is working correctly.
### Issues
-
-
-
-
**Main process error**
Add an event listener that throws an error in your main process:
-
-
-
```javascript
import { app } from "electron";
import * as Sentry from "@sentry/electron/main";
@@ -276,39 +193,22 @@ app.on("ready", () => {
});
```
-
-
-
-
-
-
**Renderer process error**
Add a test button in one of your HTML pages:
-
-
-
```html {filename: index.html}
```
-
-
-
-
-
-
Then, in your renderer, add the following:
Finally, start your app and trigger two errors that Sentry will capture: one from the
main process and one from the renderer.
-
-
```javascript
document.getElementById("testError").addEventListener("click", () => {
@@ -316,24 +216,13 @@ document.getElementById("testError").addEventListener("click", () => {
});
```
-
-
-
-
### Tracing
-
-
-
-
To test tracing in your renderer, start a trace to measure the time it takes to execute your code.
Then, start your app and trigger two errors that Sentry will capture: one from the main process and one from the renderer. It will also start a trace with the defined name.
-
-
-
```javascript
document.getElementById("testError").addEventListener("click", () => {
Sentry.startSpan({ op: "test", name: "Renderer test span" }, () => {
@@ -342,10 +231,6 @@ document.getElementById("testError").addEventListener("click", () => {
});
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/elysia/index.mdx b/docs/platforms/javascript/guides/elysia/index.mdx
index d9a6b4ca920c9..7e1cf220de0a0 100644
--- a/docs/platforms/javascript/guides/elysia/index.mdx
+++ b/docs/platforms/javascript/guides/elysia/index.mdx
@@ -37,10 +37,6 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your runtime and preferred package manager to add the Sentry SDK to your application:
@@ -48,9 +44,6 @@ Run the command for your runtime and preferred package manager to add the Sentry
handles all instrumentation natively.
-
-
-
```bash {tabTitle:Bun} {mdExpandTabs}
bun add @sentry/elysia
```
@@ -63,21 +56,10 @@ yarn add @sentry/elysia @elysiajs/node
pnpm add @sentry/elysia @elysiajs/node
```
-
-
-
-
## Configure
-
-
-
-
Call `Sentry.init()` before creating your Elysia app, then wrap the app with `Sentry.withElysia()` before defining routes.
-
-
-
```javascript {tabTitle:Bun} {mdExpandTabs} {filename: index.ts}
import * as Sentry from "@sentry/elysia";
import { Elysia } from "elysia";
@@ -125,22 +107,11 @@ const app = Sentry.withElysia(new Elysia({ adapter: node() }))
.listen(3000);
```
-
-
-
-
### Customize Automatic Error Capturing (Optional)
-
-
-
-
The SDK captures 5xx errors automatically via a global `onError` hook. Client errors (3xx/4xx) are not captured by default.
You can customize which errors are captured using the `shouldHandleError` option.
-
-
-
```javascript
const app = Sentry.withElysia(new Elysia(), {
shouldHandleError: (context) => {
@@ -150,10 +121,6 @@ const app = Sentry.withElysia(new Elysia(), {
});
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
@@ -168,38 +135,20 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
First, let's verify that Sentry captures errors and creates issues in your Sentry project. Add the following route to your app, which triggers an error that Sentry will capture:
-
-
-
```javascript
app.get("/debug-sentry", () => {
throw new Error("My first Sentry error!");
});
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code:
-
-
-
```javascript
app.get("/debug-sentry", async () => {
await Sentry.startSpan(
@@ -215,10 +164,6 @@ app.get("/debug-sentry", async () => {
});
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/ember/index.mdx b/docs/platforms/javascript/guides/ember/index.mdx
index 93e9edc4cd3c9..ba92dfd4ed7fa 100644
--- a/docs/platforms/javascript/guides/ember/index.mdx
+++ b/docs/platforms/javascript/guides/ember/index.mdx
@@ -15,21 +15,10 @@ categories:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
-
-
-
-
## Configure
**Error Monitoring** starts working as soon as you call `Sentry.init()`. **Logs** and **Application Metrics** need no extra configuration, and you'll learn how to send them in steps [#3](#send-logs) and [#4](#send-application-metrics-).
@@ -39,10 +28,6 @@ This guide also enables **Tracing**, **Session Replay**, and **User Feedback**.
### Initialize the SDK
-
-
-
-
Call `Sentry.init()` in `app/app.ts` before defining your `Application` class.
The snippet also turns on:
@@ -53,9 +38,6 @@ The snippet also turns on:
Don't need a feature? Remove its integration and options from the snippet.
-
-
-
```typescript {filename:app/app.ts}
import Application from "@ember/application";
import Resolver from "ember-resolver";
@@ -97,23 +79,12 @@ export default class App extends Application {
loadInitializers(App, config.modulePrefix);
```
-
-
-
-
### Enable Performance Instrumentation
-
-
-
-
To capture page loads, navigation, classic component renders, and runloop timings, create an instance initializer that calls `instrumentAppInstancePerformance()`. The `tracesSampleRate` option in `Sentry.init()` controls how much tracing data Sentry captures.
The SDK skips this instrumentation during FastBoot server rendering. To customize it, see Ember Options.
-
-
-
```typescript {filename:app/instance-initializers/sentry-performance.ts}
import type ApplicationInstance from "@ember/application/instance";
import { instrumentAppInstancePerformance } from "@sentry/ember";
@@ -125,10 +96,6 @@ export function initialize(appInstance: ApplicationInstance): void {
export default { initialize };
```
-
-
-
-
### Add Readable Stack Traces With Source Maps
@@ -139,10 +106,6 @@ export default { initialize };
## Send Logs
-
-
-
-
Use `Sentry.logger` to send logs at different levels, such as `info`, `warn`, or `error`.
You can pass any attributes you want and search or filter by them later.
@@ -150,9 +113,6 @@ If you're already logging with `console` or [Consola](https://github.com/unjs/co
See Set Up Logs for all available logging methods and the syntax for formatting messages.
-
-
-
```javascript
Sentry.logger.info("User example action completed");
@@ -167,24 +127,13 @@ Sentry.logger.error("Validation failed", {
});
```
-
-
-
-
## Send Application Metrics
-
-
-
-
Use `Sentry.metrics` to send counters, gauges, and distributions from your app to Sentry.
You can pass any attributes you want and search or filter by them later.
See Set Up Metrics for all available metric types and configuration options.
-
-
-
```javascript
Sentry.metrics.count("checkout.failed", 1);
@@ -196,21 +145,11 @@ Sentry.metrics.distribution("api_latency", 187, {
});
```
-
-
-
-
## Verify Your Setup
Let's test your setup and confirm that Sentry is working correctly and sending data to your Sentry project.
-
-
-
-
Add the following test button to one of your templates, which will trigger an error when you click it:
-
-
```handlebars {filename: application.hbs}
{{! rest of your page }}
@@ -219,16 +158,8 @@ Add the following test button to one of your templates, which will trigger an er
```
-
-
-
-
-
Next, add the corresponding action to your controller or component.
-
-
-
```javascript {filename: application.js}
import Controller from "@ember/controller";
import { action } from "@ember/object";
@@ -241,10 +172,6 @@ export default class ApplicationController extends Controller {
}
```
-
-
-
-
### View Captured Data in Sentry
diff --git a/docs/platforms/javascript/guides/firebase/index.mdx b/docs/platforms/javascript/guides/firebase/index.mdx
index 0549b511e808e..62a9a51256449 100644
--- a/docs/platforms/javascript/guides/firebase/index.mdx
+++ b/docs/platforms/javascript/guides/firebase/index.mdx
@@ -38,15 +38,8 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your Firebase Functions project:
-
-
-
```bash {tabTitle:npm}
@@ -79,21 +72,10 @@ pnpm add @sentry/node @sentry/profiling-node
-
-
-
-
## Configure
-
-
-
-
Create an initialization file (for example, `instrument.js`) that imports and initializes Sentry.
-
-
-
```javascript {filename:instrument.js}
const Sentry = require("@sentry/node");
// ___PRODUCT_OPTION_START___ profiling
@@ -131,12 +113,6 @@ Sentry.init({
});
```
-
-
-
-
-
-
Import the initialization file at the very top of your functions entry point (for example, `index.js`), before any other imports:
@@ -144,8 +120,6 @@ Import the initialization file at the very top of your functions entry point (fo
calls, including Firebase imports. This ensures Sentry can properly instrument
all modules.
-
-
```javascript {filename:index.js}
require("./instrument"); // Require Sentry initialization first
@@ -168,10 +142,6 @@ exports.onUserCreated = onDocumentCreated("users/{userId}", async (event) => {
});
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
@@ -186,15 +156,8 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
Add a test function that throws an error to verify Sentry is capturing errors:
-
-
-
```javascript {filename:index.js}
require("./instrument"); // Import Sentry initialization first
const { onRequest } = require("firebase-functions/https");
@@ -204,39 +167,19 @@ exports.testSentry = onRequest(async (request, response) => {
});
```
-
-
-
-
-
-
Deploy your functions and trigger the test endpoint:
-
-
-
```bash
firebase deploy --only functions
curl https://-.cloudfunctions.net/testSentry
```
-
-
-
-
### Tracing
-
-
-
-
Firebase Functions are automatically instrumented for tracing. You can also create custom spans:
-
-
-
```javascript {filename:index.js}
require("./instrument");
const Sentry = require("@sentry/node");
@@ -252,10 +195,6 @@ exports.tracedFunction = onRequest(async (request, response) => {
});
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/gatsby/index.mdx b/docs/platforms/javascript/guides/gatsby/index.mdx
index dc90aa371da11..1e077dfe392fd 100644
--- a/docs/platforms/javascript/guides/gatsby/index.mdx
+++ b/docs/platforms/javascript/guides/gatsby/index.mdx
@@ -15,10 +15,6 @@ categories:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application.
@@ -27,9 +23,6 @@ Run the command for your preferred package manager to add the Sentry SDK to your
-
-
-
```bash {tabTitle:npm}
npm install @sentry/gatsby --save
```
@@ -42,21 +35,10 @@ yarn add @sentry/gatsby
pnpm add @sentry/gatsby
```
-
-
-
-
### Register the Sentry SDK
-
-
-
-
Register `@sentry/gatsby` in your Gatsby configuration file (typically `gatsby-config.(js|ts)`).
-
-
-
```javascript {tabTitle: CommonJS}{filename:gatsby-config.(js|ts)}
module.exports = {
plugins: [
@@ -82,10 +64,6 @@ const config: GatsbyConfig = {
export default config;
```
-
-
-
-
## Configure
Choose the features you want to configure, and this guide will show you how:
@@ -103,15 +81,8 @@ Choose the features you want to configure, and this guide will show you how:
### Initialize the Sentry SDK
-
-
-
-
Initialize Sentry as early as possible in your application. For this, create a new file `sentry.config.(js|ts)` in your project root and add the following:
-
-
-
```javascript {filename:sentry.config.(js|ts)}
import * as Sentry from "@sentry/gatsby";
@@ -153,10 +124,6 @@ Sentry.init({
});
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
@@ -175,10 +142,6 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
To verify that Sentry captures errors and creates issues in your Sentry project, add the following test button to one of your pages.
@@ -188,9 +151,6 @@ To verify that Sentry captures errors and creates issues in your Sentry project,
-
-
-
```javascript {filename:index.(jsx|tsx)}
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet and wrap the error in a custom span.
Then, open the page in a browser and click the button to trigger a frontend error and trace.
-
-
-
```javascript {filename:index.(jsx|tsx)}
-
-
-
diff --git a/docs/platforms/javascript/guides/gcp-functions/index.mdx b/docs/platforms/javascript/guides/gcp-functions/index.mdx
index 3e30400e212d8..614ddfa02ed63 100644
--- a/docs/platforms/javascript/guides/gcp-functions/index.mdx
+++ b/docs/platforms/javascript/guides/gcp-functions/index.mdx
@@ -36,38 +36,16 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
-
-
-
-
## Configure
-
-
-
-
Make sure to initialize Sentry at the top of your function code and wrap each function with the appropriate helper. Select the tab that matches the kind of function you're using (HTTP, Background, or CloudEvent):
-
-
-
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
@@ -82,15 +60,8 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
Let's verify that Sentry captures errors and creates issues in your Sentry project. Add an intentional error in your function:
-
-
-
```javascript {tabTitle:Http functions} {mdExpandTabs}
exports.helloHttp = Sentry.wrapHttpFunction((req, res) => {
throw new Error("Sentry Test Error - This is intentional!");
@@ -111,21 +82,11 @@ exports.helloEvents = Sentry.wrapCloudEventFunction((context, callback) => {
});
```
-
-
-
-
### Tracing
-
-
-
To test tracing, wrap your code in a span:
-
-
-
```javascript {tabTitle:Http functions} {mdExpandTabs}
exports.helloHttp = Sentry.wrapHttpFunction(async (req, res) => {
await Sentry.startSpan(
@@ -164,10 +125,6 @@ exports.helloEvent = Sentry.wrapCloudEventFunction(async (context) => {
});
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/hono/index.mdx b/docs/platforms/javascript/guides/hono/index.mdx
index 71ad13f56a967..e6dc2483d43e7 100644
--- a/docs/platforms/javascript/guides/hono/index.mdx
+++ b/docs/platforms/javascript/guides/hono/index.mdx
@@ -36,15 +36,8 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Install the `@sentry/hono` package:
-
-
-
```bash {tabTitle:npm}
npm install @sentry/hono
```
@@ -57,21 +50,10 @@ yarn add @sentry/hono
pnpm add @sentry/hono
```
-
-
-
-
### Install the Peer Dependency for Your Runtime
-
-
-
-
The SDK needs a runtime-specific peer dependency. Install the one that matches your environment and keep its version in sync with `@sentry/hono`. You won't import it directly, but it must be present in your project.
-
-
-
```bash {tabTitle:Cloudflare Workers} {mdExpandTabs}
npm install @sentry/cloudflare
```
@@ -88,23 +70,12 @@ npm install @sentry/bun
deno add npm:@sentry/deno
```
-
-
-
-
### Install the Profiling Package (Node.js Only)
-
-
-
-
Profiling is only available for the Node.js runtime. Install the `@sentry/profiling-node` package:
-
-
-
```bash {tabTitle:npm}
npm install @sentry/profiling-node --save
```
@@ -117,25 +88,14 @@ yarn add @sentry/profiling-node
pnpm add @sentry/profiling-node
```
-
-
-
-
## Configure
-
-
-
-
If you're deploying to Cloudflare Workers, set the `nodejs_compat` compatibility flag. The SDK needs `AsyncLocalStorage`, which requires this flag.
-
-
-
```jsonc {tabTitle:JSON} {filename:wrangler.jsonc}
{
"compatibility_flags": ["nodejs_compat"],
@@ -146,23 +106,12 @@ If you're deploying to Cloudflare Workers, set the `nodejs_compat` compatibility
compatibility_flags = ["nodejs_compat"]
```
-
-
-
-
-
-
-
-
Node.js requires Sentry to initialize before your application loads so it can instrument third-party libraries (like database clients). Create a separate initialization file:
-
-
-
```typescript {filename:instrument.mjs}
// IMPORTANT: import from `@sentry/hono/node`, not `@sentry/node`
import * as Sentry from "@sentry/hono/node";
@@ -198,19 +147,8 @@ Sentry.init({
});
```
-
-
-
-
-
-
-
-
Load this file with the `--import` flag when starting your app. You can also set this as an environment variable instead:
-
-
-
```bash {tabTitle:CLI Option}
node --import ./instrument.mjs app.js
```
@@ -219,25 +157,14 @@ node --import ./instrument.mjs app.js
NODE_OPTIONS="--import ./instrument.mjs"
```
-
-
-
-
### Add the Sentry Middleware
-
-
-
-
Add the `sentry()` middleware as early as possible in your Hono app.
Before continuing, make sure you've completed the runtime-specific steps above: **Cloudflare Workers** users need to enable Node.js compatibility, and **Node.js** users need to create the instrument file. Since Node.js initializes Sentry in that file, the middleware doesn't take any options.
-
-
-
```typescript {tabTitle:Cloudflare Workers} {filename:index.ts} {mdExpandTabs}
import { Hono } from "hono";
import { sentry } from "@sentry/hono/cloudflare";
@@ -324,21 +251,10 @@ app.use(
Deno.serve(app.fetch);
```
-
-
-
-
-
-
-
-
To access environment variables from your Cloudflare Worker bindings (for example, to store the DSN as a secret), pass a callback instead of a plain options object. The function receives the Worker `env`:
-
-
-
```typescript {filename:index.ts}
import { Hono } from "hono";
import { sentry } from "@sentry/hono/cloudflare";
@@ -352,10 +268,6 @@ app.use(sentry(app, (env) => ({ dsn: env.SENTRY_DSN })));
export default app;
```
-
-
-
-
### Report Unhandled Exceptions
diff --git a/docs/platforms/javascript/guides/nestjs/index.mdx b/docs/platforms/javascript/guides/nestjs/index.mdx
index d1babb2906957..eb37fbc9c5b5b 100644
--- a/docs/platforms/javascript/guides/nestjs/index.mdx
+++ b/docs/platforms/javascript/guides/nestjs/index.mdx
@@ -26,51 +26,22 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
-
-
-
-
## Configure
### Initialize the Sentry SDK
-
-
-
-
To import and initialize Sentry, create a file named `instrument.ts` in the root directory of your project and add the following code:
-
-
-
-
-
-
-
### Apply Instrumentation to Your App
-
-
-
-
Make sure to import the `instrument.ts` file before any other modules:
-
-
-
```typescript {filename: main.ts} {1-2}
// Import this first!
import "./instrument";
@@ -87,17 +58,8 @@ async function bootstrap() {
bootstrap();
```
-
-
-
-
-
-
Afterward, add the `SentryModule` as a root module to your main module:
-
-
-
```typescript {filename: app.module.ts} {2, 8}
import { Module } from "@nestjs/common";
import { SentryModule } from "@sentry/nestjs/setup";
@@ -115,10 +77,6 @@ import { AppService } from "./app.service";
export class AppModule {}
```
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
diff --git a/docs/platforms/javascript/guides/nextjs/capturing-errors/index.mdx b/docs/platforms/javascript/guides/nextjs/capturing-errors/index.mdx
index 47918080aea38..22c75d1cf790c 100644
--- a/docs/platforms/javascript/guides/nextjs/capturing-errors/index.mdx
+++ b/docs/platforms/javascript/guides/nextjs/capturing-errors/index.mdx
@@ -9,10 +9,6 @@ Sentry's Next.js SDK automatically captures most unhandled errors. However, Next
## Automatic vs Manual Capture
-
-
-
-
### What's Captured Automatically
The SDK captures these without any code:
@@ -30,9 +26,6 @@ Next.js intercepts errors in these patterns, hiding them from Sentry:
If you catch an error and don't re-throw it, Sentry never sees it.
-
-
-
```tsx
// Automatic: unhandled errors bubble up to Sentry
throw new Error("This is captured automatically");
@@ -47,23 +40,12 @@ try {
}
```
-
-
-
-
## Error Boundaries
-
-
-
-
Next.js `error.tsx` files catch rendering errors to show a fallback UI. This is good for UX but means errors never reach Sentry's global handler.
**Add `captureException` in every error boundary** to maintain visibility.
-
-
-
```tsx {filename:app/error.tsx}
"use client";
@@ -90,21 +72,12 @@ export default function Error({
}
```
-
-
-
-
-
-
### Global Error Boundary
`global-error.tsx` is a last-resort safety net that only triggers when your root layout itself fails. This is rare—most errors are caught by route-level `error.tsx` files first.
Include `` and `` tags since it replaces the entire document.
-
-
-
```tsx {filename:app/global-error.tsx}
"use client";
@@ -133,23 +106,12 @@ export default function GlobalError({
}
```
-
-
-
-
## Caught Errors
-
-
-
-
When you catch errors to return graceful responses (in Server Actions, API routes, or middleware), add `captureException` before returning.
**The pattern is the same everywhere:** if you `catch` and don't `throw`, call `captureException`.
-
-
-
```tsx {filename:app/actions.ts}
"use server";
@@ -168,10 +130,6 @@ export async function createPost(formData: FormData) {
}
```
-
-
-
-
### Adding Context
Add metadata to help debug errors:
@@ -211,19 +169,12 @@ app/
## Troubleshooting
-
-
-
-
### Errors Not Appearing
1. **Error boundary intercepting** — Check that `captureException` is called in your `error.tsx` files
2. **SDK not initialized** — Verify config files exist with correct DSN
3. **`beforeSend` filtering** — Check if a hook is dropping errors
-
-
-
```tsx {filename:app/error.tsx}
"use client";
@@ -240,39 +191,21 @@ export default function Error({ error }: { error: Error }) {
}
```
-
-
-
-
-
-
### Duplicate Errors
If you see the same error twice, you're likely capturing in multiple places. Check that only one handler captures each error.
-
-
-
```tsx
// Don't capture in both error.tsx AND a parent component
// Pick one location per error
```
-
-
-
-
-
-
### Missing Stack Traces
Server errors may show minified traces in production. Enable source maps for readable traces.
The `digest` property on server errors is a hash you can search for in logs.
-
-
-
```tsx
// Server errors include a digest for debugging
error: Error & { digest?: string }
@@ -281,8 +214,4 @@ error: Error & { digest?: string }
console.error("Error digest:", error.digest);
```
-
-
-
-
See Source Maps for setup instructions.
diff --git a/docs/platforms/javascript/guides/nextjs/index.mdx b/docs/platforms/javascript/guides/nextjs/index.mdx
index 761c52c7e23e1..af4d15d83054b 100644
--- a/docs/platforms/javascript/guides/nextjs/index.mdx
+++ b/docs/platforms/javascript/guides/nextjs/index.mdx
@@ -37,11 +37,6 @@ Prefer to set things up yourself? Check out the [Manual Setup](/platforms/javasc
The wizard configured Sentry for all Next.js runtime environments and created files to test your setup.
-
-
-
-
-
### SDK Initialization
Next.js runs code in different environments. The wizard creates separate initialization files for each:
@@ -50,9 +45,6 @@ Next.js runs code in different environments. The wizard creates separate initial
- **Server** (`sentry.server.config.ts`) — Runs in Node.js
- **Edge** (`sentry.edge.config.ts`) — Runs in edge runtimes
-
-
-
```typescript {tabTitle:Client} {mdExpandTabs} {filename:instrumentation-client.ts}
import * as Sentry from "@sentry/nextjs";
@@ -106,19 +98,10 @@ The example above samples 100% of traces in development and 10% in production. M
-
-
-
-
-
-
### Server-Side Registration
The `instrumentation.ts` file registers your server and edge configurations with Next.js.
-
-
-
```typescript {filename:instrumentation.ts}
import * as Sentry from "@sentry/nextjs";
@@ -134,19 +117,10 @@ export async function register() {
export const onRequestError = Sentry.captureRequestError;
```
-
-
-
-
-
-
### Next.js Configuration
Your `next.config.ts` is wrapped with `withSentryConfig` to enable source map uploads, tunneling (to avoid ad-blockers), and other build-time features.
-
-
-
```typescript {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -164,19 +138,10 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
-
### Error Handling
The wizard creates `app/global-error.tsx` to capture React rendering errors in your App Router application.
-
-
-
```tsx {filename:app/global-error.tsx}
"use client";
@@ -202,21 +167,12 @@ export default function GlobalError({
}
```
-
-
-
-
-
-
### Source Maps
The wizard creates `.env.sentry-build-plugin` with your auth token for source map uploads. This file is automatically added to `.gitignore`.
For CI/CD, set the `SENTRY_AUTH_TOKEN` environment variable in your build system.
-
-
-
```bash {tabTitle:Local Development} {filename:.env.sentry-build-plugin}
SENTRY_AUTH_TOKEN=sntrys_eyJ...
```
@@ -226,19 +182,10 @@ SENTRY_AUTH_TOKEN=sntrys_eyJ...
SENTRY_AUTH_TOKEN=sntrys_eyJ...
```
-
-
-
-
-
-
### Example Page
The wizard creates `/sentry-example-page` with a button that triggers a test error. Use this to verify your setup.
-
-
-
```
app/
├── sentry-example-page/
@@ -248,11 +195,6 @@ app/
└── route.ts # Test API route
```
-
-
-
-
-
## Control the Data You Send to Sentry (Optional)
diff --git a/docs/platforms/javascript/guides/nextjs/logs/index.mdx b/docs/platforms/javascript/guides/nextjs/logs/index.mdx
index 70409b73c9458..37549811269a6 100644
--- a/docs/platforms/javascript/guides/nextjs/logs/index.mdx
+++ b/docs/platforms/javascript/guides/nextjs/logs/index.mdx
@@ -12,10 +12,6 @@ Sentry Logs let you send structured log data from your Next.js application. Unli
## Setup
-
-
-
-
### Enable Logging
Logs are enabled by default across all three runtime files. Initialize the SDK as usual, then use `Sentry.logger` to send logs.
@@ -26,9 +22,6 @@ Logs work across all Next.js runtimes:
- **Server** — Node.js server-side logging
- **Edge** — Edge runtime logging
-
-
-
```typescript {tabTitle:Client} {mdExpandTabs} {filename:instrumentation-client.ts}
import * as Sentry from "@sentry/nextjs";
@@ -53,16 +46,8 @@ Sentry.init({
});
```
-
-
-
-
## Send Logs
-
-
-
-
### Log Levels
Use the appropriate level for each message:
@@ -76,9 +61,6 @@ Use the appropriate level for each message:
| `error` | Failures that need attention |
| `fatal` | Critical failures, system down |
-
-
-
```typescript
import * as Sentry from "@sentry/nextjs";
@@ -91,25 +73,14 @@ Sentry.logger.error("Payment failed", { reason: "card_declined" });
Sentry.logger.fatal("Database unavailable", { host: "primary" });
```
-
-
-
-
## Add Context
-
-
-
-
### Attributes
Pass structured data as the second argument. These attributes become queryable columns in Sentry.
Use the `fmt` helper for parameterized messages — values are extracted as searchable attributes.
-
-
-
```typescript
// Pass attributes directly
Sentry.logger.info("User signed up", {
@@ -122,12 +93,6 @@ Sentry.logger.info("User signed up", {
Sentry.logger.info(Sentry.logger.fmt`User ${userId} purchased ${productName}`);
```
-
-
-
-
-
-
### Shared Attributes
@@ -136,9 +101,6 @@ Use `Sentry.setAttribute` and `Sentry.setAttributes` to attach attributes that a
See Different Kinds of Scopes to learn more.
-
-
-
```typescript
// Applied to all logs and metrics
Sentry.setAttributes({
@@ -160,29 +122,18 @@ Sentry.withScope((scope) => {
});
```
-
-
-
-
## Best Practices
## Integrations
-
-
-
-
### Console
Capture `console.log`, `console.warn`, and `console.error` calls as structured logs.
The integration parses multiple arguments as searchable attributes.
-
-
-
```typescript
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -199,21 +150,12 @@ console.log("User action:", userId, success);
// -> message.parameter.1: success
```
-
-
-
-
-
-
### Pino
Send logs from the [Pino](https://github.com/pinojs/pino) logging library to Sentry.
Requires SDK version `10.18.0` or higher.
-
-
-
```typescript
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -223,21 +165,12 @@ Sentry.init({
See Pino integration docs for configuration options.
-
-
-
-
-
-
### Consola
Send logs from the [Consola](https://github.com/unjs/consola) logging library to Sentry.
Requires SDK version `10.12.0` or higher.
-
-
-
```typescript
import { consola } from "consola";
@@ -248,21 +181,12 @@ const sentryReporter = Sentry.createConsolaReporter({
consola.addReporter(sentryReporter);
```
-
-
-
-
-
-
### Winston
Send logs from the [Winston](https://github.com/winstonjs/winston) logging library to Sentry.
Requires SDK version `9.13.0` or higher.
-
-
-
```typescript
import winston from "winston";
import Transport from "winston-transport";
@@ -276,11 +200,6 @@ const logger = winston.createLogger({
});
```
-
-
-
-
-
### Upcoming Integrations
- [Node Bunyan](https://github.com/getsentry/sentry-javascript/issues/16474)
@@ -289,10 +208,6 @@ const logger = winston.createLogger({
## Filter Logs
-
-
-
-
### beforeSendLog
Filter or modify logs before they're sent. Return `null` to drop a log.
@@ -303,9 +218,6 @@ Use this to:
- Filter noisy logs
- Add computed attributes
-
-
-
```typescript {filename:instrumentation-client.ts}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -326,10 +238,6 @@ Sentry.init({
});
```
-
-
-
-
## Default Attributes
Sentry automatically adds these attributes to every log:
diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx
index 86c9379b31a28..77d865a77fd74 100644
--- a/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx
+++ b/docs/platforms/javascript/guides/nextjs/manual-setup/index.mdx
@@ -41,18 +41,10 @@ Choose the features you want to configure:
## Install
-
-
-
-
-
### Install the Sentry SDK
Run the command for your preferred package manager to add the Sentry SDK to your application.
-
-
-
```bash {tabTitle:npm}
npm install @sentry/nextjs --save
```
@@ -65,25 +57,12 @@ yarn add @sentry/nextjs
pnpm add @sentry/nextjs
```
-
-
-
-
-
## Configure
-
-
-
-
-
### Apply Instrumentation to Your App
Extend your app's default Next.js options by adding `withSentryConfig` into your `next.config.ts` file.
-
-
-
```typescript {filename:next.config.ts}
import type { NextConfig } from "next";
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -101,12 +80,6 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
-
### Initialize Sentry SDKs
Create the following files in your application's root directory (or `src` folder if you have one):
@@ -120,9 +93,6 @@ Create the following files in your application's root directory (or `src` folder
variable like `NEXT_PUBLIC_SENTRY_DSN`.
-
-
-
```typescript {tabTitle:Client} {mdExpandTabs} {filename:instrumentation-client.ts}
import * as Sentry from "@sentry/nextjs";
@@ -193,12 +163,6 @@ The example above samples 100% of traces in development and 10% in production. M
-
-
-
-
-
-
### Register Server-Side SDK
Create a [Next.js Instrumentation file](https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation) named `instrumentation.ts` in your project root (or `src` folder). This file imports your server and edge configurations and exports `onRequestError` to capture server-side errors.
@@ -208,9 +172,6 @@ Create a [Next.js Instrumentation file](https://nextjs.org/docs/app/building-you
and Next.js 15.
-
-
-
```typescript {filename:instrumentation.ts}
import * as Sentry from "@sentry/nextjs";
@@ -228,34 +189,16 @@ export async function register() {
export const onRequestError = Sentry.captureRequestError;
```
-
-
-
-
-
-
### Capture React Render Errors
Create `app/global-error.tsx` to capture errors that occur anywhere in your App Router application.
-
-
-
-
-
-
-
-
-
### Server Actions
Wrap your Server Actions with `Sentry.withServerActionInstrumentation()`.
-
-
-
```typescript {filename:app/actions.ts}
"use server";
import * as Sentry from "@sentry/nextjs";
@@ -278,12 +221,6 @@ export async function submitForm(formData: FormData) {
}
```
-
-
-
-
-
-
### Source Maps (Optional)
Add the `authToken` option to your `next.config.ts` to enable readable stack traces. Set the `SENTRY_AUTH_TOKEN` environment variable in your CI/CD.
@@ -292,9 +229,6 @@ Add the `authToken` option to your `next.config.ts` to enable readable stack tra
Keep your auth token secret and out of version control.
-
-
-
```typescript {filename:next.config.ts}
export default withSentryConfig(nextConfig, {
org: "___ORG_SLUG___",
@@ -312,12 +246,6 @@ export default withSentryConfig(nextConfig, {
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
```
-
-
-
-
-
-
### Tunneling (Optional)
Prevent ad blockers from blocking Sentry events by routing them through your Next.js server.
@@ -338,9 +266,6 @@ export const config = {
-
-
-
```typescript {filename:next.config.ts}
export default withSentryConfig(nextConfig, {
// Use a fixed route (recommended)
@@ -348,11 +273,6 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
### Control the Data You Send to Sentry (Optional)
@@ -361,20 +281,12 @@ export default withSentryConfig(nextConfig, {
Test your error monitoring setup by throwing an error and viewing it in Sentry.
-
-
-
-
-
### Throw a Test Error
Add this button to any page and click it to trigger a test error.
-
-
-
```jsx
-
-
-
-
### Verify
Open [**Issues**](https://sentry.io/orgredirect/organizations/:orgslug/issues/) in Sentry to see your test error. [Learn more about capturing errors](/platforms/javascript/guides/nextjs/capturing-errors/).
@@ -401,11 +308,6 @@ Based on the features you selected above, verify each one is working correctly.
-
-
-
-
-
### Session Replay
Session Replay captures video-like reproductions of user sessions. It's configured with `replayIntegration()` in your client config.
@@ -414,9 +316,6 @@ By default, Sentry masks all text, inputs, and media. You can customize this in
**Verify:** Trigger an error or navigate your app, then check [**Replays**](https://sentry.io/orgredirect/organizations/:orgslug/replays/) in Sentry.
-
-
-
```typescript {filename:instrumentation-client.ts}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -434,20 +333,10 @@ Sentry.init({
});
```
-
-
-
-
-
-
-
-
-
-
### Tracing
Tracing is configured with `tracesSampleRate` in your SDK init files. Next.js routes and API calls are automatically instrumented.
@@ -456,9 +345,6 @@ Add [custom spans](/platforms/javascript/guides/nextjs/tracing/instrumentation/c
**Verify:** Navigate to any page, then check [**Traces**](https://sentry.io/orgredirect/organizations/:orgslug/explore/traces/) in Sentry.
-
-
-
```typescript
import * as Sentry from "@sentry/nextjs";
@@ -471,20 +357,10 @@ const result = await Sentry.startSpan(
);
```
-
-
-
-
-
-
-
-
-
-
### Logs
Logs are enabled by default. Use the Sentry logger to send structured logs from anywhere in your application.
@@ -493,9 +369,6 @@ Connect popular logging libraries via [Integrations](/platforms/javascript/guide
**Verify:** Add a log statement, trigger it, then check [**Logs**](https://sentry.io/orgredirect/organizations/:orgslug/explore/logs/) in Sentry.
-
-
-
```typescript
import * as Sentry from "@sentry/nextjs";
@@ -510,20 +383,10 @@ Sentry.logger.warn("Warning message");
Sentry.logger.error("Error occurred");
```
-
-
-
-
-
-
-
-
-
-
### User Feedback
User Feedback adds an embeddable widget via `feedbackIntegration()` that lets users report bugs directly from your app.
@@ -532,9 +395,6 @@ User Feedback adds an embeddable widget via `feedbackIntegration()` that lets us
[Learn more about User Feedback](/platforms/javascript/guides/nextjs/user-feedback/)
-
-
-
```typescript {filename:instrumentation-client.ts}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -547,18 +407,8 @@ Sentry.init({
});
```
-
-
-
-
-
-
-
-
-
-
### Application Metrics
Track and analyze custom application metrics to understand trends and patterns in your app's performance and behavior over time.
@@ -566,9 +416,6 @@ Track and analyze custom application metrics to understand trends and patterns i
**Verify:** Add a metrics statement, trigger it, then check [**Metrics**](https://sentry.io/orgredirect/organizations/:orgslug/explore/metrics/) in Sentry.
-
-
-
```typescript
import * as Sentry from "@sentry/nextjs";
@@ -579,11 +426,6 @@ Sentry.metrics.distribution("api_latency", 187, {
});
```
-
-
-
-
-
Hybrid Apps (App Router + Pages Router)
If your application uses both the App Router and Pages Router:
diff --git a/docs/platforms/javascript/guides/nextjs/manual-setup/pages-router.mdx b/docs/platforms/javascript/guides/nextjs/manual-setup/pages-router.mdx
index 349431dc2cdd7..2360bf58348f4 100644
--- a/docs/platforms/javascript/guides/nextjs/manual-setup/pages-router.mdx
+++ b/docs/platforms/javascript/guides/nextjs/manual-setup/pages-router.mdx
@@ -30,18 +30,10 @@ Choose the features you want to configure:
## Install
-
-
-
-
-
### Install the Sentry SDK
Run the command for your preferred package manager to add the Sentry SDK to your application.
-
-
-
```bash {tabTitle:npm}
npm install @sentry/nextjs --save
```
@@ -54,18 +46,8 @@ yarn add @sentry/nextjs
pnpm add @sentry/nextjs
```
-
-
-
-
-
## Configure
-
-
-
-
-
### Apply Instrumentation to Your App
Extend your app's default Next.js options by adding `withSentryConfig` into your `next.config.ts` (or `next.config.js`) file.
@@ -76,9 +58,6 @@ Extend your app's default Next.js options by adding `withSentryConfig` into your
and page data fetching methods.
-
-
-
```typescript {tabTitle:Webpack} {filename:next.config.ts}
import type { NextConfig } from "next";
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -127,12 +106,6 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
-
### Initialize Sentry SDKs
Create the following files in your application's root directory (or `src` folder if you have one):
@@ -152,9 +125,6 @@ Older setups initialized the browser SDK in `sentry.client.config.ts`. That file
-
-
-
```typescript {tabTitle:Client} {mdExpandTabs} {filename:instrumentation-client.ts}
import * as Sentry from "@sentry/nextjs";
@@ -220,12 +190,6 @@ Monitor your [usage stats](https://sentry.io/orgredirect/organizations/:orgslug/
-
-
-
-
-
-
### Register Server-Side SDK
Create a [Next.js Instrumentation file](https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation) named `instrumentation.ts` in your project root (or `src` folder) to load it at server startup.
@@ -237,9 +201,6 @@ The `onRequestError` export is what captures server-side errors in the Pages Rou
and Next.js 15.
-
-
-
```typescript {filename:instrumentation.ts}
import * as Sentry from "@sentry/nextjs";
@@ -257,29 +218,14 @@ export async function register() {
export const onRequestError = Sentry.captureRequestError;
```
-
-
-
-
-
-
### Capture Pages Router Errors
Create or update `pages/_error.tsx` to capture errors that occur during server-side rendering or in page components.
The `getInitialProps` method captures the error asynchronously, ensuring Sentry has time to send the error before serverless functions terminate.
-
-
-
-
-
-
-
-
-
### Source Maps (Optional)
Add the `authToken` option to your `next.config.ts` to enable readable stack traces. Set the `SENTRY_AUTH_TOKEN` environment variable in your CI/CD.
@@ -288,9 +234,6 @@ Add the `authToken` option to your `next.config.ts` to enable readable stack tra
Keep your auth token secret and out of version control.
-
-
-
```typescript {filename:next.config.ts}
export default withSentryConfig(nextConfig, {
org: "___ORG_SLUG___",
@@ -308,11 +251,6 @@ export default withSentryConfig(nextConfig, {
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
```
-
-
-
-
-
### Control the Data You Send to Sentry (Optional)
@@ -321,18 +259,10 @@ SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
Test your error monitoring setup by throwing an error and viewing it in Sentry.
-
-
-
-
-
### Throw a Test Error
Add this button to any page and click it to trigger a test error.
-
-
-
```tsx {filename:pages/index.tsx}
export default function Home() {
return (
@@ -348,11 +278,6 @@ export default function Home() {
}
```
-
-
-
-
-
### Verify
Open [**Issues**](https://sentry.io/orgredirect/organizations/:orgslug/issues/) in Sentry to see your test error. [Learn more about capturing errors](/platforms/javascript/guides/nextjs/capturing-errors/).
@@ -363,20 +288,12 @@ Based on the features you selected above, verify each one is working correctly.
-
-
-
-
-
### Session Replay
Session Replay captures video-like reproductions of user sessions. It's configured with `replayIntegration()` in your client config.
**Verify:** Trigger an error or navigate your app, then check [**Replays**](https://sentry.io/orgredirect/organizations/:orgslug/replays/) in Sentry.
-
-
-
```typescript {filename:instrumentation-client.ts}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -388,29 +305,16 @@ Sentry.init({
});
```
-
-
-
-
-
-
-
-
-
-
### Tracing
Tracing is configured with `tracesSampleRate` in your SDK init files. Next.js routes and API calls are automatically instrumented.
**Verify:** Navigate to any page, then check [**Traces**](https://sentry.io/orgredirect/organizations/:orgslug/explore/traces/) in Sentry.
-
-
-
```typescript {filename:sentry.server.config.ts}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -419,29 +323,16 @@ Sentry.init({
});
```
-
-
-
-
-
-
-
-
-
-
### Logs
Logs are enabled by default. Use the Sentry logger to send structured logs.
**Verify:** Add a log statement, trigger it, then check [**Logs**](https://sentry.io/orgredirect/organizations/:orgslug/explore/logs/) in Sentry.
-
-
-
```typescript
import * as Sentry from "@sentry/nextjs";
@@ -450,18 +341,8 @@ Sentry.logger.warn("Warning message");
Sentry.logger.error("Error occurred");
```
-
-
-
-
-
-
-
-
-
-
### Application Metrics
Track and analyze custom application metrics to understand trends and patterns in your app's performance and behavior over time.
@@ -469,9 +350,6 @@ Track and analyze custom application metrics to understand trends and patterns i
**Verify:** Add a metrics statement, trigger it, then check [**Metrics**](https://sentry.io/orgredirect/organizations/:orgslug/explore/metrics/) in Sentry.
-
-
-
```typescript
import * as Sentry from "@sentry/nextjs";
@@ -482,20 +360,10 @@ Sentry.metrics.distribution("api_latency", 187, {
});
```
-
-
-
-
-
## Vercel Cron Jobs (Optional)
Automatically create [Cron Monitors](/product/monitors-and-alerts/monitors/crons/) in Sentry for your [Vercel cron jobs](https://vercel.com/docs/cron-jobs).
-
-
-
-
-
### Enable Automatic Cron Monitoring
There are two ways to do this, depending on how you build:
@@ -505,9 +373,6 @@ There are two ways to do this, depending on how you build:
If you enable both, the SDK uses the span-based approach and logs a warning telling you to drop the other one.
-
-
-
```typescript {tabTitle:Span-based} {mdExpandTabs} {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -528,11 +393,6 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
Hybrid Apps (App Router + Pages Router)
If your application uses both the App Router and Pages Router:
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 c375210378619..9b941ed5e3ad2 100644
--- a/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx
+++ b/docs/platforms/javascript/guides/nextjs/manual-setup/webpack-setup.mdx
@@ -30,20 +30,12 @@ For a complete reference of all build configuration options, see the [Build Conf
With Webpack, Sentry automatically instruments your server functions, middleware, and app directory components at build time. You can control this behavior:
-
-
-
-
-
### Configure Auto-Instrumentation
These options are enabled by default with Webpack. Disable them if you prefer manual instrumentation or experience build issues.
**Note**: These options instrument Pages Router pages, API routes, and App Router components, but do NOT automatically instrument Server Actions. Server Actions require manual wrapping using `withServerActionInstrumentation()`.
-
-
-
```typescript {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -66,11 +58,6 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
## Exclude Routes From Instrumentation
With Webpack, you can exclude specific routes from automatic instrumentation. This is useful for health check endpoints or routes that shouldn't be monitored.
@@ -80,18 +67,10 @@ With Webpack, you can exclude specific routes from automatic instrumentation. Th
telemetry features instead of build-time instrumentation.
-
-
-
-
-
### Configure Route Exclusions
Specify routes as URL paths (not file system paths). Routes must have a leading slash and no trailing slash.
-
-
-
```typescript {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -106,29 +85,16 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
## Source Map Upload
By default, Webpack uploads source maps **during the build process** using the Sentry Webpack Plugin. This happens separately for each build (client, server, edge), which can increase build time.
For faster builds, you can use the post-build upload mode (available in Next.js 15.4.1+), which uploads all source maps in a single operation after all builds complete.
-
-
-
-
-
### Default: Upload During Build
The Sentry Webpack Plugin runs during each webpack compilation and uploads source maps as they're generated.
-
-
-
```typescript {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -139,16 +105,6 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
-
-
-
-
-
### Option: Upload After Build (Next.js 15.4.1+)
Enable post-build upload for faster builds. All source maps are uploaded once after all webpack builds complete.
@@ -157,9 +113,6 @@ Enable post-build upload for faster builds. All source maps are uploaded once af
This option requires Next.js 15.4.1 or later. Turbopack always uses this mode.
-
-
-
```typescript {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -173,23 +126,10 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
-
-
-
-
-
### Control Which Files Are Uploaded
If the defaults pick up too much or too little, narrow the upload with the `sourcemaps` options. These are top-level options and apply to both Webpack and Turbopack builds. See [Build Configuration](/platforms/javascript/guides/nextjs/configuration/build/) for the full list.
-
-
-
```typescript {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -205,27 +145,14 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
## Server Actions with Webpack
Server Actions (functions marked with `"use server"`) are **not automatically instrumented** by Webpack's build-time instrumentation. You must manually wrap them for error and performance monitoring.
-
-
-
-
-
### Manual Server Action Instrumentation
Wrap Server Actions with `withServerActionInstrumentation()` to capture errors and performance data.
-
-
-
```typescript {filename:app/actions.ts}
"use server";
import * as Sentry from "@sentry/nextjs";
@@ -245,11 +172,6 @@ export async function submitForm(formData: FormData) {
}
```
-
-
-
-
-
## React Component Annotation
Component annotation adds `data-sentry-*` attributes to your React components at build time, so Sentry can tell you which component a user interacted with in [Session Replay](/platforms/javascript/guides/nextjs/session-replay/) and [breadcrumbs](/platforms/javascript/guides/nextjs/enriching-events/breadcrumbs/).
@@ -263,18 +185,10 @@ Component annotation adds `data-sentry-*` attributes to your React components at
deprecated, and will be removed in the next major version.
-
-
-
-
-
### Enable Component Annotation
Enable `reactComponentAnnotation` to track component names in your application. This is especially useful for debugging user interactions in Session Replay.
-
-
-
```typescript {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -285,23 +199,10 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
-
-
-
-
-
### Exclude Specific Components
If you have components you don't want annotated (for privacy or performance reasons), you can exclude them by name.
-
-
-
```typescript {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -313,20 +214,10 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
## Tunneling with Webpack
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
Enable tunneling to bypass ad-blockers. Use a fixed route so you can exclude it from middleware if needed.
@@ -341,9 +232,6 @@ tunnelRoute: true, // Auto-generated random route
-
-
-
```typescript {filename:next.config.ts}
import { withSentryConfig } from "@sentry/nextjs/config";
@@ -353,11 +241,6 @@ export default withSentryConfig(nextConfig, {
});
```
-
-
-
-
-
## Migrating from Webpack to Turbopack
If you're upgrading to Turbopack:
diff --git a/docs/platforms/javascript/guides/nextjs/tracing/index.mdx b/docs/platforms/javascript/guides/nextjs/tracing/index.mdx
index 69e895b9905bf..cd5f5c2ccd587 100644
--- a/docs/platforms/javascript/guides/nextjs/tracing/index.mdx
+++ b/docs/platforms/javascript/guides/nextjs/tracing/index.mdx
@@ -20,19 +20,12 @@ Before enabling tracing, ensure you have:
## Enable Tracing
-
-
-
-
### Configure Sample Rate
Add `tracesSampleRate` to your Sentry configuration in all three runtime files.
**Start with 100% in development, and 10-20% in production.** Adjust based on traffic volume and budget.
-
-
-
```typescript {tabTitle:Client} {mdExpandTabs} {filename:instrumentation-client.ts}
import * as Sentry from "@sentry/nextjs";
@@ -60,16 +53,8 @@ Sentry.init({
});
```
-
-
-
-
## What's Traced Automatically
-
-
-
-
### By Runtime
The SDK instruments different operations depending on where your code runs:
@@ -80,9 +65,6 @@ The SDK instruments different operations depending on where your code runs:
| **Server** | API routes, Server Components, `getServerSideProps` |
| **Edge** | Middleware, edge API routes |
-
-
-
```tsx
// All of these create spans automatically
@@ -101,18 +83,10 @@ export default async function Page() {
}
```
-
-
-
-
For configuration options like timeouts, INP settings, and filtering spans, see Automatic Instrumentation.
## Server Actions
-
-
-
-
### Why Manual Instrumentation?
Server Actions are **not** automatically instrumented. Without wrapping, they appear as anonymous server operations with no timing or context.
@@ -123,9 +97,6 @@ Use `withServerActionInstrumentation` to:
- Connect client and server traces via `headers`
- Attach form data to Sentry events via `formData`
-
-
-
```tsx {filename:app/actions.ts}
"use server";
@@ -145,19 +116,10 @@ export async function createOrder(formData: FormData) {
}
```
-
-
-
-
-
-
### With Headers and Form Data
Pass `headers` to connect client-side traces with server-side spans for full distributed tracing across the browser-to-server boundary. Pass `formData` to attach submitted form data to Sentry events for easier debugging.
-
-
-
```tsx {filename:app/actions.ts}
"use server";
@@ -179,10 +141,6 @@ export async function submitForm(formData: FormData) {
}
```
-
-
-
-
## Web Vitals
The SDK automatically captures [Web Vitals](/product/dashboards/sentry-dashboards/frontend/web-vitals/) in the browser. These metrics measure real user experience:
@@ -201,10 +159,6 @@ To configure collection, see the Custom Instrumentation.
-
-
-
```tsx {filename:app/api/checkout/route.ts}
import * as Sentry from "@sentry/nextjs";
@@ -242,19 +193,10 @@ export async function POST(request: Request) {
}
```
-
-
-
-
-
-
### Add Attributes
Attach data to spans for filtering and debugging in Sentry.
-
-
-
```tsx
Sentry.startSpan(
{
@@ -272,16 +214,8 @@ Sentry.startSpan(
);
```
-
-
-
-
## Distributed Tracing
-
-
-
-
### Automatic Propagation
The SDK automatically propagates trace context for:
@@ -290,9 +224,6 @@ The SDK automatically propagates trace context for:
For external APIs, configure `tracePropagationTargets`:
-
-
-
```typescript {filename:instrumentation-client.ts}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -307,10 +238,6 @@ Sentry.init({
});
```
-
-
-
-
For CORS configuration and manual trace propagation (WebSockets, etc.), see Distributed Tracing.
## Quick Reference
@@ -327,19 +254,12 @@ For CORS configuration and manual trace propagation (WebSockets, etc.), see
-
-
-
### High trace volume
If you're sending too many traces, lower your sample rate or use `tracesSampler` for dynamic sampling based on route.
See Configure Sampling for more options.
-
-
-
```typescript
Sentry.init({
tracesSampler: ({ name }) => {
@@ -353,12 +273,6 @@ Sentry.init({
});
```
-
-
-
-
-
-
### Detached spans with `after()` or `waitUntil()`
If you're using Next.js's [`after()`](https://nextjs.org/docs/app/api-reference/functions/after) or [`waitUntil`](https://vercel.com/docs/functions/functions-api-reference/vercel-functions-package#waituntil) and you see multiple root spans (like individual `db` spans) instead of one cohesive trace, your spans are becoming detached.
@@ -367,9 +281,6 @@ This happens when `after()` or `waitUntil()` runs after the response is sent. By
Wrap your deferred work with `startSpan` inside the `after()` or `waitUntil()` callback to group all background spans into a single transaction:
-
-
-
```tsx {filename:app/api/webhook/route.ts}
import { after } from "next/server";
import { waitUntil } from '@vercel/functions';
@@ -395,7 +306,3 @@ export async function POST(request: Request) {
return Response.json({ received: true });
}
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/nitro/index.mdx b/docs/platforms/javascript/guides/nitro/index.mdx
index f0d0db71ab390..9c6e727ddcfd7 100644
--- a/docs/platforms/javascript/guides/nitro/index.mdx
+++ b/docs/platforms/javascript/guides/nitro/index.mdx
@@ -36,15 +36,8 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
```bash {tabTitle:npm}
npm install @sentry/nitro --save
```
@@ -57,25 +50,14 @@ yarn add @sentry/nitro
pnpm add @sentry/nitro
```
-
-
-
-
## Configure
The Nitro SDK is configured in two places: a build-time wrapper that registers a Nitro module, and a runtime file that initializes the SDK before your server starts.
### Configure the Nitro Build
-
-
-
-
Wrap your Nitro config with `withSentryConfig` so the Sentry module is registered during the build. Provide your auth token, organization, and project slugs so that source maps are automatically uploaded during production builds.
-
-
-
```typescript {filename: nitro.config.ts}
import { defineNitroConfig } from "nitro/config";
import { withSentryConfig } from "@sentry/nitro";
@@ -92,17 +74,8 @@ export default withSentryConfig(config, {
});
```
-
-
-
-
-
-
If you use Nitro as a Vite plugin, wrap the options you pass to `nitro()` instead:
-
-
-
```typescript {filename: vite.config.ts}
import { defineConfig } from "vite";
import { nitro } from "nitro/vite";
@@ -127,38 +100,18 @@ export default defineConfig({
});
```
-
-
-
-
-
-
Add your auth token to your environment:
-
-
-
```bash {filename:.env}
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
```
-
-
-
-
### Initialize the Sentry SDK
-
-
-
-
Create an `instrument.mjs` file in your project root:
-
-
-
```javascript {filename: instrument.mjs}
import * as Sentry from "@sentry/nitro";
@@ -176,25 +129,14 @@ Sentry.init({
});
```
-
-
-
-
### Source Maps
By default, `withSentryConfig` generates hidden source maps, uploads them to Sentry, and deletes the `.map` files after the build. This gives you readable stack traces in Sentry without shipping source maps to production. If you already set `sourcemap` in your Nitro config, the SDK respects your setting.
### Run Your Application
-
-
-
-
Load the instrumentation file with Node's `--import` flag before any Nitro command. This works for `nitro dev`, `nitro preview`, and your production start script:
-
-
-
```json {filename: package.json}
{
"scripts": {
@@ -205,10 +147,6 @@ Load the instrumentation file with Node's `--import` flag before any Nitro comma
}
```
-
-
-
-
### Control the Data You Send to Sentry (Optional)
@@ -219,15 +157,8 @@ Let's test your setup and confirm that Sentry is working correctly and sending d
### Issues
-
-
-
-
Add a test route that throws an error, then open `/debug-sentry` in your browser (or `curl` it) to trigger the error:
-
-
-
```javascript {filename: server/routes/debug-sentry.ts}
import { defineHandler } from "nitro/h3";
@@ -236,23 +167,12 @@ export default defineHandler(() => {
});
```
-
-
-
-
### Tracing
-
-
-
-
To verify tracing, add a handler that starts a manual span:
-
-
-
```javascript {filename: server/routes/debug-sentry.ts}
import { defineHandler } from "nitro/h3";
import * as Sentry from "@sentry/nitro";
@@ -271,10 +191,6 @@ export default defineHandler(async () => {
});
```
-
-
-
-
diff --git a/docs/platforms/javascript/guides/nuxt/index.mdx b/docs/platforms/javascript/guides/nuxt/index.mdx
index c74ac97b61a1b..0fd2306ca119c 100644
--- a/docs/platforms/javascript/guides/nuxt/index.mdx
+++ b/docs/platforms/javascript/guides/nuxt/index.mdx
@@ -52,46 +52,24 @@ The SDK bundles `sentry.server.config.ts` into the Nitro server build and initia
### Run in Production Mode (Recommended)
-
-
-
-
Build your project with `nuxi build`, then start the server.
-
-
-
```bash
# Start your app after building your project with `nuxi build`
node .output/server/index.mjs
```
-
-
-
-
### Run in Development Mode
-
-
-
-
Sentry also monitors the server side during development. Start the dev server as usual.
Spans from some libraries, such as database clients, can be missing in development mode.
Errors and request traces always work. To learn more, see Development Mode.
-
-
-
```bash
nuxt dev
```
-
-
-
-
If you used the Nuxt installation wizard, after building and running your project:
1. Open the example page `/sentry-example-page` in your browser. For most Nuxt applications, this will be at localhost.
diff --git a/docs/platforms/javascript/guides/nuxt/index__v10.x.mdx b/docs/platforms/javascript/guides/nuxt/index__v10.x.mdx
index 1efc86e43a73b..bb23c64627f41 100644
--- a/docs/platforms/javascript/guides/nuxt/index__v10.x.mdx
+++ b/docs/platforms/javascript/guides/nuxt/index__v10.x.mdx
@@ -58,46 +58,24 @@ We **recommend testing in production mode** as it most closely resembles your de
### Run in Production Mode (Recommended)
-
-
-
-
After building with `nuxi build`, run your project and make sure to load Sentry on the server side by explicitly adding it via `--import` (read more about this flag in [Installation Methods](/platforms/javascript/guides/nuxt/install__v10.x/)).
-
-
-
```
# Start your app after building your project with `nuxi build`
node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs
```
-
-
-
-
### Run in Development Mode
-
-
-
-
The server config file is generated in the `.nuxt` directory the first time you run `nuxt dev`. If you delete your `.nuxt` directory, you'll need to run `nuxt dev` once without the `NODE_OPTIONS` variable to regenerate it.
If you only want to use Sentry on the client-side or only need basic error monitoring on the server side, you can omit the `--import` flag when running your application.
-
-
-
```
# Run the dev server with the --import flag after running `nuxt dev` once (without the flag)
NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev
```
-
-
-
-
If you used the Nuxt installation wizard, after building and running your project:
1. Open the example page `/sentry-example-page` in your browser. For most Nuxt applications, this will be at localhost.
diff --git a/docs/platforms/javascript/guides/nuxt/manual-setup__v10.x.mdx b/docs/platforms/javascript/guides/nuxt/manual-setup__v10.x.mdx
index d86002fef66e8..88678b0385301 100644
--- a/docs/platforms/javascript/guides/nuxt/manual-setup__v10.x.mdx
+++ b/docs/platforms/javascript/guides/nuxt/manual-setup__v10.x.mdx
@@ -67,15 +67,8 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
```bash {tabTitle:npm}
npm install @sentry/nuxt --save
```
@@ -88,44 +81,22 @@ yarn add @sentry/nuxt
pnpm add @sentry/nuxt
```
-
-
-
-
## Configure
### Apply Instrumentation to Your App
-
-
-
-
Add the Sentry Nuxt module to your `nuxt.config.ts` file:
-
-
-
```javascript {filename:nuxt.config.ts}
export default defineNuxtConfig({
modules: ["@sentry/nuxt/module"],
});
```
-
-
-
-
### Configure Client-Side Sentry
-
-
-
-
Add a `sentry.client.config.ts` file to the root of your project (this is probably the same level as the `package.json`). In this file, import and initialize Sentry, specifying any SDK options for the client:
-
-
-
```javascript {filename:sentry.client.config.ts}
import * as Sentry from "@sentry/nuxt";
@@ -169,19 +140,10 @@ Sentry.init({
});
```
-
-
-
-
-
-
We recommend you store your Sentry [Data Source Name](/concepts/key-terms/dsn-explainer/) (DSN) in an environment variable and configure it via the Nuxt runtime config.
This allows you to access the DSN using `useRuntimeConfig().public.sentry.dsn`.
-
-
-
```javascript {filename:nuxt.config.ts}
export default defineNuxtConfig({
modules: ["@sentry/nuxt/module"],
@@ -195,23 +157,12 @@ export default defineNuxtConfig({
});
```
-
-
-
-
### Configure Server-Side Sentry
-
-
-
-
Add a `sentry.server.config.ts` file to the root of your project and initialize Sentry in it.
We recommend you store your Sentry [Data Source Name](/concepts/key-terms/dsn-explainer/) (DSN) in an environment variable.
-
-
-
```javascript {filename:sentry.server.config.ts}
import * as Sentry from "@sentry/nuxt";
@@ -229,20 +180,10 @@ Sentry.init({
});
```
-
-
-
-
-
-
-
Since Sentry on the server side needs to be loaded before `useRuntimeConfig()` is fully available, environment variables are only accessible via `process.env`. To make sure your environment variables are available, use one of these methods:
-
-
-
Load environment variables from your `.env` file when starting the server:
```bash {tabTitle: node}
@@ -259,45 +200,23 @@ dotenv.config();
// ... rest of the file
```
-
-
-
-
-
-
-
**Sentry's server-side monitoring doesn't work in development mode**. To enable it, you first need to build your application and then load the Sentry server-side config using the `--import` flag when running your application.
Check out the [`--import` CLI flag](/platforms/javascript/guides/nuxt/install/cli-import__v10.x/) docs for setup instructions.
-
-
-
```
# Start your app after building your project with `nuxi build`
node --import ./.output/server/sentry.server.config.mjs .output/server/index.mjs
```
-
-
-
-
-
### Add Readable Stack Traces With Source Maps (Optional)
-
-
-
-
To upload source maps for clear error stack traces, add your Sentry auth token, organization, and project slugs in the `sentry` options inside your configuration file:
These `sentry` options only affect the **build time** of the SDK.
-
-
-
```javascript {filename:nuxt.config.ts} {3-10}
export default defineNuxtConfig({
modules: ["@sentry/nuxt/module"],
@@ -310,50 +229,26 @@ export default defineNuxtConfig({
});
```
-
-
-
-
-
-
To keep your auth token secure, always store it in an environment variable instead of directly in your files:
-
-
-
```bash {filename:.env}
SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
```
-
-
-
-
#### Enable Client-Side Source Maps
-
-
-
-
While Nuxt generates source maps on the server side by default, you need to explicitly enable client-side source maps in your Nuxt configuration.
The `hidden` option enables source map generation while preventing source map reference comments that would normally appear at the end of each generated file in the build output.
-
-
-
```javascript {filename:nuxt.config.ts} {2}
export default defineNuxtConfig({
sourcemap: { client: "hidden" },
});
```
-
-
-
-
### Avoid Ad Blockers With Tunneling (Optional)
-
-
-
To verify that Sentry captures errors and creates issues in your Sentry project, create a test page with a button.
-
-
-
```html {tabTitle:Vue} {filename:pages/example-error.vue}
```
-
-
-
-
-
-
diff --git a/platform-includes/getting-started-config/ruby.mdx b/platform-includes/getting-started-config/ruby.mdx
index 3470806ca5229..eac663b0f468b 100644
--- a/platform-includes/getting-started-config/ruby.mdx
+++ b/platform-includes/getting-started-config/ruby.mdx
@@ -1,13 +1,6 @@
-
-
-
Import and initialize the SDK in your app's entry point:
-
-
-
-
```ruby
require 'sentry-ruby'
@@ -36,7 +29,3 @@ Sentry.init do |config|
# ___PRODUCT_OPTION_END___ profiling
end
```
-
-
-
-
diff --git a/platform-includes/getting-started-config/ruby.rack.mdx b/platform-includes/getting-started-config/ruby.rack.mdx
index b62dc39d6c3e4..99fda82207ef4 100644
--- a/platform-includes/getting-started-config/ruby.rack.mdx
+++ b/platform-includes/getting-started-config/ruby.rack.mdx
@@ -1,14 +1,7 @@
#### With Rackup
-
-
-
-
Import and initialize the SDK and add `use Sentry::Rack::CaptureExceptions` to your `config.ru` or other rackup file:
-
-
-
```ruby {filename:config.ru}
require 'sentry-ruby'
@@ -40,21 +33,10 @@ end
use Sentry::Rack::CaptureExceptions
```
-
-
-
-
#### Without Rackup
-
-
-
-
If you're not using Rackup to run your app, you have to place Sentry's initialization code **before** your code requires Sinatra:
-
-
-
```ruby {filename:app.rb}
require 'sentry-ruby'
@@ -91,7 +73,3 @@ get "/" do
raise "foo"
end
```
-
-
-
-
diff --git a/platform-includes/getting-started-config/ruby.rails.mdx b/platform-includes/getting-started-config/ruby.rails.mdx
index 8a469bb649c51..b6332cac04190 100644
--- a/platform-includes/getting-started-config/ruby.rails.mdx
+++ b/platform-includes/getting-started-config/ruby.rails.mdx
@@ -1,12 +1,6 @@
-
-
-
Initialize the SDK within your `config/initializers/sentry.rb`:
-
-
-
```ruby {filename:config/initializers/sentry.rb}
Sentry.init do |config|
config.dsn = '___PUBLIC_DSN___'
@@ -33,7 +27,3 @@ Sentry.init do |config|
# ___PRODUCT_OPTION_END___ profiling
end
```
-
-
-
-
diff --git a/platform-includes/getting-started-config/ruby.resque.mdx b/platform-includes/getting-started-config/ruby.resque.mdx
index edb95d0fe8358..593cb405c5163 100644
--- a/platform-includes/getting-started-config/ruby.resque.mdx
+++ b/platform-includes/getting-started-config/ruby.resque.mdx
@@ -1,12 +1,6 @@
-
-
-
Import and initialize the SDK in your app's entry point:
-
-
-
```ruby
require 'sentry-ruby'
@@ -36,21 +30,8 @@ Sentry.init do |config|
end
```
-
-
-
-
-
-
Sentry relies on the `at_exit` hook to flush all events before the process exits. To make sure none of your events are lost, set the following environment variable when you run Resque:
-
-
-
```bash
RUN_AT_EXIT_HOOKS=1 rake resque:workers
```
-
-
-
-
diff --git a/platform-includes/getting-started-data-collection/javascript.aws-lambda__v10.x.mdx b/platform-includes/getting-started-data-collection/javascript.aws-lambda__v10.x.mdx
index a5db4c83c07c3..9df1784c1ff59 100644
--- a/platform-includes/getting-started-data-collection/javascript.aws-lambda__v10.x.mdx
+++ b/platform-includes/getting-started-data-collection/javascript.aws-lambda__v10.x.mdx
@@ -1,7 +1,3 @@
-
-
-
-
When you set the `dataCollection` option, you opt into the SDK's new data collection behavior, which is the default in version 11.
The SDK then sends user identity data (IP address, ID, and similar) and other data like HTTP bodies and URL query parameters.
This will give you rich debugging context.
@@ -11,10 +7,6 @@ The SDK always filters sensitive values whose keys match a built-in denylist, su
To send less data, turn off the categories you don't need in the `dataCollection` option.
For the full list of categories and their defaults, see the `dataCollection` options.
-
-
-
-
```javascript {3-8}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -26,7 +18,3 @@ Sentry.init({
},
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-data-collection/javascript.cloudflare.mdx b/platform-includes/getting-started-data-collection/javascript.cloudflare.mdx
index 06c30f92d304a..aee059012e5bc 100644
--- a/platform-includes/getting-started-data-collection/javascript.cloudflare.mdx
+++ b/platform-includes/getting-started-data-collection/javascript.cloudflare.mdx
@@ -1,7 +1,3 @@
-
-
-
-
By default, the SDK sends user identity data (IP address, ID, and similar) and other data like HTTP bodies and URL query parameters.
This will give you rich debugging context.
@@ -10,10 +6,6 @@ The SDK always filters sensitive values whose keys match a built-in denylist, su
To send less data, turn off the categories you don't need in the `dataCollection` option.
For the full list of categories and their defaults, see the `dataCollection` options.
-
-
-
-
```typescript {filename:src/instrument.server.ts} {5-7}
import { defineCloudflareOptions } from "@sentry/cloudflare";
@@ -25,7 +17,3 @@ export default defineCloudflareOptions((env) => ({
},
}));
```
-
-
-
-
diff --git a/platform-includes/getting-started-data-collection/javascript.electron.mdx b/platform-includes/getting-started-data-collection/javascript.electron.mdx
index 1928658b57981..4422107f96cc8 100644
--- a/platform-includes/getting-started-data-collection/javascript.electron.mdx
+++ b/platform-includes/getting-started-data-collection/javascript.electron.mdx
@@ -1,8 +1,3 @@
-
-
-
-
-
By default, the SDK sends user identity data (IP address, ID, and similar) and other data like HTTP bodies and URL query parameters.
This will give you rich debugging context.
@@ -12,10 +7,6 @@ To send less data, turn off the categories you don't need in the `dataCollection
The `userInfo` value set in the `main` process controls IP address inference for events from all processes. The other categories apply to the process where they are set.
For the full list of categories and their defaults, see the `dataCollection` options.
-
-
-
-
```javascript {5-8}
import * as Sentry from "@sentry/electron/main";
@@ -27,7 +18,3 @@ Sentry.init({
},
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-data-collection/javascript.eve.mdx b/platform-includes/getting-started-data-collection/javascript.eve.mdx
index 5b5abf0dca45e..eb643a6dac89c 100644
--- a/platform-includes/getting-started-data-collection/javascript.eve.mdx
+++ b/platform-includes/getting-started-data-collection/javascript.eve.mdx
@@ -1,7 +1,3 @@
-
-
-
-
By default, the SDK sends the inputs and outputs of your LLM and tool calls, such as prompts, responses, and tool arguments.
This will give you rich debugging context. Review the data your agent handles before you deploy to production.
@@ -10,10 +6,6 @@ The SDK always filters sensitive values whose keys match a built-in denylist, su
To send less data, turn off the categories you don't need in the `dataCollection` option.
For the full list of categories and their defaults, see the `dataCollection` options.
-
-
-
-
```typescript {filename:agent/instrumentation/sentry.ts} {4-6}
export default defineInstrumentation(
Sentry.eveInstrumentation({
@@ -24,7 +16,3 @@ export default defineInstrumentation(
})
);
```
-
-
-
-
diff --git a/platform-includes/getting-started-data-collection/javascript.mastra.mdx b/platform-includes/getting-started-data-collection/javascript.mastra.mdx
index 521f25e282159..336ce09f4525f 100644
--- a/platform-includes/getting-started-data-collection/javascript.mastra.mdx
+++ b/platform-includes/getting-started-data-collection/javascript.mastra.mdx
@@ -1,7 +1,3 @@
-
-
-
-
By default, the SDK sends the inputs and outputs of your LLM and tool calls, such as prompts, responses, and tool arguments.
This will give you rich debugging context. Review the data your agent handles before you deploy to production.
@@ -10,10 +6,6 @@ The SDK always filters sensitive values whose keys match a built-in denylist, su
To send less data, turn off the categories you don't need in the `dataCollection` option.
For the full list of categories and their defaults, see the `dataCollection` options.
-
-
-
-
```javascript {filename:src/mastra/public/instrument.mjs} {3-5}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -22,7 +14,3 @@ Sentry.init({
},
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-data-collection/javascript.mdx b/platform-includes/getting-started-data-collection/javascript.mdx
index 623aa89d8b7f2..cf053e79b978d 100644
--- a/platform-includes/getting-started-data-collection/javascript.mdx
+++ b/platform-includes/getting-started-data-collection/javascript.mdx
@@ -2,17 +2,10 @@ By default, the SDK sends user identity data (IP address, ID, and similar) and o
This will give you rich debugging context.
The SDK always filters sensitive values whose keys match a built-in denylist, such as `auth` or `password`, and sends `[Filtered]` instead.
-
-
-
To send less data, turn off the categories you don't need in the `dataCollection` option.
For the full list of categories and their defaults, see the `dataCollection` options.
-
-
-
-
```javascript {3-5}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -22,7 +15,3 @@ Sentry.init({
},
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-data-collection/javascript.nuxt__v10.x.mdx b/platform-includes/getting-started-data-collection/javascript.nuxt__v10.x.mdx
index 025b60e9029ea..f6266f00eb2b1 100644
--- a/platform-includes/getting-started-data-collection/javascript.nuxt__v10.x.mdx
+++ b/platform-includes/getting-started-data-collection/javascript.nuxt__v10.x.mdx
@@ -1,7 +1,3 @@
-
-
-
-
When you set the `dataCollection` option, you opt into the SDK's new data collection behavior, which is the default in version 11.
The SDK then sends user identity data (IP address, ID, and similar) and other data like HTTP bodies and URL query parameters.
This will give you rich debugging context.
@@ -11,10 +7,6 @@ The SDK always filters sensitive values whose keys match a built-in denylist, su
To send less data, turn off the categories you don't need in the `dataCollection` option.
For the full list of categories and their defaults, see the `dataCollection` options.
-
-
-
-
```javascript {3-8}
Sentry.init({
dsn: "___PUBLIC_DSN___",
@@ -26,7 +18,3 @@ Sentry.init({
},
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-install/javascript.mdx b/platform-includes/getting-started-install/javascript.mdx
index b5bd17a066f2f..bb50e9730ce62 100644
--- a/platform-includes/getting-started-install/javascript.mdx
+++ b/platform-includes/getting-started-install/javascript.mdx
@@ -1,17 +1,9 @@
We recommend installing Sentry via a package manager. If that isn't an option for you, you can use the [Loader Script](/platforms/javascript/install/loader/) or a CDN bundle.
-
-
-
-
-
#### Option 1: Package Manager (Recommended)
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
```bash {tabTitle:npm}
npm install @sentry/browser --save
```
@@ -24,12 +16,6 @@ yarn add @sentry/browser
pnpm add @sentry/browser
```
-
-
-
-
-
-
#### Option 2: Loader Script
In Sentry, go to
diff --git a/platform-includes/getting-started-install/python.mdx b/platform-includes/getting-started-install/python.mdx
index 7fb779b7a08c7..d6a76689a44a4 100644
--- a/platform-includes/getting-started-install/python.mdx
+++ b/platform-includes/getting-started-install/python.mdx
@@ -1,12 +1,5 @@
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
```bash {tabTitle:pip}
pip install "sentry-sdk"
```
@@ -18,7 +11,3 @@ uv add "sentry-sdk"
```bash {tabTitle:poetry}
poetry add "sentry-sdk"
```
-
-
-
-
diff --git a/platform-includes/getting-started-install/ruby.mdx b/platform-includes/getting-started-install/ruby.mdx
index 42bf034e7c883..79dd8963a4e27 100644
--- a/platform-includes/getting-started-install/ruby.mdx
+++ b/platform-includes/getting-started-install/ruby.mdx
@@ -1,42 +1,20 @@
-
-
-
-
Add the `sentry-ruby` gem to your `Gemfile`:
-
-
-
```ruby {filename:Gemfile}
gem "sentry-ruby"
```
-
-
-
-
-
-
-
-
Add the `sentry-ruby` and `stackprof` gems to your `Gemfile`:
-
-
-
```ruby {filename:Gemfile}
gem "stackprof"
gem "sentry-ruby"
```
-
-
-
-
diff --git a/platform-includes/getting-started-install/ruby.rails.mdx b/platform-includes/getting-started-install/ruby.rails.mdx
index f59f399243c4f..bc33c813ae80b 100644
--- a/platform-includes/getting-started-install/ruby.rails.mdx
+++ b/platform-includes/getting-started-install/ruby.rails.mdx
@@ -1,44 +1,22 @@
-
-
-
-
Add the `sentry-ruby` and `sentry-rails` gems to your `Gemfile`:
-
-
-
```ruby {filename:Gemfile}
gem "sentry-ruby"
gem "sentry-rails"
```
-
-
-
-
-
-
-
-
Add the `sentry-ruby`, `sentry-rails` and `stackprof` gems to your `Gemfile`:
-
-
-
```ruby {filename:Gemfile}
gem "stackprof"
gem "sentry-ruby"
gem "sentry-rails"
```
-
-
-
-
diff --git a/platform-includes/getting-started-install/ruby.resque.mdx b/platform-includes/getting-started-install/ruby.resque.mdx
index 23344e1e5eeed..6ff5f371b6570 100644
--- a/platform-includes/getting-started-install/ruby.resque.mdx
+++ b/platform-includes/getting-started-install/ruby.resque.mdx
@@ -1,44 +1,22 @@
-
-
-
-
Add the `sentry-ruby` and `sentry-resque` gems to your `Gemfile`:
-
-
-
```ruby {filename:Gemfile}
gem "sentry-ruby"
gem "sentry-resque"
```
-
-
-
-
-
-
-
-
Add the `sentry-ruby`, `sentry-resque`, and `stackprof` gems to your `Gemfile`:
-
-
-
```ruby {filename:Gemfile}
gem "stackprof"
gem "sentry-ruby"
gem "sentry-resque"
```
-
-
-
-
diff --git a/platform-includes/getting-started-install/ruby.sidekiq.mdx b/platform-includes/getting-started-install/ruby.sidekiq.mdx
index 781f0c3b0a475..8208bb0b49e92 100644
--- a/platform-includes/getting-started-install/ruby.sidekiq.mdx
+++ b/platform-includes/getting-started-install/ruby.sidekiq.mdx
@@ -1,44 +1,22 @@
-
-
-
-
Add the `sentry-ruby` and `sentry-sidekiq` gems to your `Gemfile`:
-
-
-
```ruby {filename:Gemfile}
gem "sentry-ruby"
gem "sentry-sidekiq"
```
-
-
-
-
-
-
-
-
Add the `sentry-ruby`, `sentry-sidekiq`, and `stackprof` gems to your `Gemfile`:
-
-
-
```ruby {filename:Gemfile}
gem "stackprof"
gem "sentry-ruby"
gem "sentry-sidekiq"
```
-
-
-
-
diff --git a/platform-includes/getting-started-node/javascript.mdx b/platform-includes/getting-started-node/javascript.mdx
index bdfbdd4b138e1..6b1a0e27256a2 100644
--- a/platform-includes/getting-started-node/javascript.mdx
+++ b/platform-includes/getting-started-node/javascript.mdx
@@ -14,21 +14,10 @@ Choose the features you want to configure, and this guide will show you how:
### Install the Sentry SDK
-
-
-
-
Run the command for your preferred package manager to add the Sentry SDK to your application:
-
-
-
-
-
-
-
## Configure
### Initialize the Sentry SDK
diff --git a/platform-includes/getting-started-sourcemaps-short-version/javascript.cloudflare.mdx b/platform-includes/getting-started-sourcemaps-short-version/javascript.cloudflare.mdx
index d8757881bde56..64b5ba5b3c928 100644
--- a/platform-includes/getting-started-sourcemaps-short-version/javascript.cloudflare.mdx
+++ b/platform-includes/getting-started-sourcemaps-short-version/javascript.cloudflare.mdx
@@ -1,14 +1,7 @@
-
-
-
-
The stack traces in your Sentry errors probably won't look like your actual code without unminifying them. To fix this, upload your source maps to Sentry.
First, set the `upload_source_maps` option to `true` in your `wrangler.(jsonc|toml)` config file to enable source map uploading:
-
-
-
```jsonc {tabTitle:JSON} {filename:wrangler.jsonc}
{
"upload_source_maps": true,
@@ -19,21 +12,8 @@ First, set the `upload_source_maps` option to `true` in your `wrangler.(jsonc|to
upload_source_maps = true
```
-
-
-
-
-
-
Next, run the Sentry Wizard to finish your setup:
-
-
-
```bash
npx @sentry/wizard@latest -i sourcemaps
```
-
-
-
-
diff --git a/platform-includes/getting-started-sourcemaps-short-version/javascript.mdx b/platform-includes/getting-started-sourcemaps-short-version/javascript.mdx
index 81534a135a226..4a2c2f17b3767 100644
--- a/platform-includes/getting-started-sourcemaps-short-version/javascript.mdx
+++ b/platform-includes/getting-started-sourcemaps-short-version/javascript.mdx
@@ -1,19 +1,7 @@
-
-
-
-
The stack traces in your Sentry errors probably won't look like your actual code without unminifying them. To fix this, upload your source maps to Sentry. The easiest way to do this is by using the Sentry Wizard.
Alternatively, take a look at our Uploading Source Maps documentation.
-
-
-
-
```bash
npx @sentry/wizard@latest -i sourcemaps
```
-
-
-
-
diff --git a/platform-includes/getting-started-tunneling/javascript.mdx b/platform-includes/getting-started-tunneling/javascript.mdx
index 39962565e41c6..99e9fa6eea924 100644
--- a/platform-includes/getting-started-tunneling/javascript.mdx
+++ b/platform-includes/getting-started-tunneling/javascript.mdx
@@ -1,22 +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. You can find a detailed explanation on how to do this on our Troubleshooting page.
-
-
-
-
```javascript {3}
Sentry.init({
dsn: "___PUBLIC_DSN___",
tunnel: "/tunnel",
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx b/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx
index c7034fe06cac0..7a1e6d6768bc2 100644
--- a/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx
+++ b/platform-includes/getting-started-tunneling/javascript.sveltekit.mdx
@@ -1,22 +1,10 @@
-
-
-
-
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.
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. You can find a detailed explanation on how to do this on our [Troubleshooting page](/platforms/javascript/guides/sveltekit/troubleshooting/#using-the-tunnel-option).
-
-
-
-
```javascript {filename:hooks.client.(js|ts)} {3}
Sentry.init({
dsn: "___PUBLIC_DSN___",
tunnel: "/tunnel",
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-verify/javascript.express.mdx b/platform-includes/getting-started-verify/javascript.express.mdx
index 3cb0b89c252f5..8b44eea158599 100644
--- a/platform-includes/getting-started-verify/javascript.express.mdx
+++ b/platform-includes/getting-started-verify/javascript.express.mdx
@@ -1,37 +1,19 @@
### Issues
-
-
-
-
First, let's make sure Sentry is correctly capturing errors and creating issues in your project. Add the following code snippet to your main application file; it defines a route that will deliberately trigger an error when called:
-
-
-
```javascript
app.get("/debug-sentry", function mainHandler(req, res) {
throw new Error("My first Sentry error!");
});
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code:
-
-
-
```javascript
app.get("/debug-sentry", async (req, res) => {
await Sentry.startSpan(
@@ -47,10 +29,6 @@ app.get("/debug-sentry", async (req, res) => {
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-verify/javascript.fastify.mdx b/platform-includes/getting-started-verify/javascript.fastify.mdx
index 116530e770384..32b69ad9f29d8 100644
--- a/platform-includes/getting-started-verify/javascript.fastify.mdx
+++ b/platform-includes/getting-started-verify/javascript.fastify.mdx
@@ -1,37 +1,19 @@
### Issues
-
-
-
-
First, let's make sure Sentry is correctly capturing errors and creating issues in your project. Add the following code snippet to your main application file; it defines a route that will deliberately trigger an error when called:
-
-
-
```javascript
app.get("/debug-sentry", function mainHandler(req, res) {
throw new Error("My first Sentry error!");
});
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code:
-
-
-
```javascript
app.get("/debug-sentry", async (request, reply) => {
await Sentry.startSpan(
@@ -47,10 +29,6 @@ app.get("/debug-sentry", async (request, reply) => {
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-verify/javascript.hapi.mdx b/platform-includes/getting-started-verify/javascript.hapi.mdx
index 183d9c7798e5a..7502f98762e10 100644
--- a/platform-includes/getting-started-verify/javascript.hapi.mdx
+++ b/platform-includes/getting-started-verify/javascript.hapi.mdx
@@ -1,14 +1,7 @@
### Issues
-
-
-
-
First, let's make sure Sentry is correctly capturing errors and creating issues in your project. Add the following code snippet to your main application file; it defines a route that will deliberately trigger an error when called:
-
-
-
```javascript
server.route({
method: "GET",
@@ -19,23 +12,12 @@ server.route({
});
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code:
-
-
-
```javascript
server.route({
method: "GET",
@@ -55,10 +37,6 @@ server.route({
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-verify/javascript.hono.mdx b/platform-includes/getting-started-verify/javascript.hono.mdx
index 479d3496a2062..0b811f96a1a27 100644
--- a/platform-includes/getting-started-verify/javascript.hono.mdx
+++ b/platform-includes/getting-started-verify/javascript.hono.mdx
@@ -1,37 +1,19 @@
### Issues
-
-
-
-
First, let's verify that Sentry captures errors and creates issues in your Sentry project. Add the following code snippet to your main application file, adding a route that triggers an error that Sentry will capture:
-
-
-
```javascript
app.get("/debug-sentry", () => {
throw new Error("My first Sentry error!");
});
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code:
-
-
-
```javascript
app.get("/debug-sentry", async () => {
await Sentry.startSpan(
@@ -47,10 +29,6 @@ app.get("/debug-sentry", async () => {
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-verify/javascript.koa.mdx b/platform-includes/getting-started-verify/javascript.koa.mdx
index 51a7a87773429..00cf86c161385 100644
--- a/platform-includes/getting-started-verify/javascript.koa.mdx
+++ b/platform-includes/getting-started-verify/javascript.koa.mdx
@@ -1,14 +1,7 @@
### Issues
-
-
-
-
To check that Sentry captures errors, add this middleware before your other middleware in your main application file. Then visit `/debug-sentry` to trigger a test error:
-
-
-
```javascript
app.use(async (ctx, next) => {
if (ctx.path === "/debug-sentry") {
@@ -18,22 +11,11 @@ app.use(async (ctx, next) => {
});
```
-
-
-
-
### Tracing
-
-
-
-
To test your tracing configuration, update the previous code snippet by starting a trace to measure the time it takes for the execution of your code:
-
-
-
```javascript
app.use(async (ctx, next) => {
if (ctx.path !== "/debug-sentry") {
@@ -54,10 +36,6 @@ app.use(async (ctx, next) => {
});
```
-
-
-
-
diff --git a/platform-includes/getting-started-verify/javascript.mdx b/platform-includes/getting-started-verify/javascript.mdx
index bfb147be304e7..7df738b554440 100644
--- a/platform-includes/getting-started-verify/javascript.mdx
+++ b/platform-includes/getting-started-verify/javascript.mdx
@@ -2,11 +2,6 @@ Let's test your setup and confirm that data reaches your Sentry project.
### Issues
-
-
-
-
-
To verify that Sentry captures errors and creates issues in your Sentry project, add a button that throws an error when clicked.
@@ -15,10 +10,6 @@ To verify that Sentry captures errors and creates issues in your Sentry project,
-
-
-
-
```html