Skip to content

feat(js): Switch to non experimental option for logs #14460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/platforms/javascript/guides/angular/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ You need:
Choose the features you want to configure, and this guide will show you how:

<OnboardingOptionButtons
options={["error-monitoring", "performance", "session-replay", "user-feedback", "logs"]}
options={[
"error-monitoring",
"performance",
"session-replay",
"user-feedback",
"logs",
]}
/>

<PlatformContent includePath="getting-started-features-expandable" />
Expand Down Expand Up @@ -133,7 +139,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs
});

Expand Down Expand Up @@ -198,7 +204,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs
});

Expand Down
50 changes: 31 additions & 19 deletions docs/platforms/javascript/guides/astro/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,25 @@ This page walks you through adding Sentry to your Astro project, configuring it,

Before we get started, make sure you have the following:

* You need a Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
* An Astro project that uses Astro `3.0.0` or newer.
* A Node runtime:
* This SDK currently only works on Node runtimes (e.g. Node adapter, Vercel with Lambda functions).
Non-Node runtimes, like Vercel's Edge runtime or Cloudflare Pages, are currently not supported.
* If you're using Astro's Netflify adapter (`@astrojs/netlify`), you need version `5.0.0` or newer.
- You need a Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- An Astro project that uses Astro `3.0.0` or newer.
- A Node runtime:
- This SDK currently only works on Node runtimes (e.g. Node adapter, Vercel with Lambda functions).
Non-Node runtimes, like Vercel's Edge runtime or Cloudflare Pages, are currently not supported.
- If you're using Astro's Netflify adapter (`@astrojs/netlify`), you need version `5.0.0` or newer.

## Install

<OnboardingOptionButtons options={["error-monitoring", "performance", "profiling", "session-replay", "user-feedback", "logs"]} />
<OnboardingOptionButtons
options={[
"error-monitoring",
"performance",
"profiling",
"session-replay",
"user-feedback",
"logs",
]}
/>

Sentry captures data by using an SDK within your application's runtime.

Expand Down Expand Up @@ -70,7 +79,6 @@ To set up the Sentry SDK, register the Sentry integration and initialize the SDK

### Astro Integration Setup


```javascript {filename:astro.config.mjs}
import { defineConfig } from "astro/config";
import sentry from "@sentry/astro";
Expand All @@ -89,8 +97,12 @@ export default defineConfig({
```

<Alert level="warning">
Passing runtime-specific configuration options (`dsn`, `release`, `environment`, `sampleRate`, `tracesSampleRate`, `replaysSessionSampleRate`, `replaysOnErrorSampleRate`) to the Sentry integration will be deprecated in future versions.
We recommend passing your configuration directly to the respective `Sentry.init()` calls in `sentry.client.config.js` and `sentry.server.config.js` instead.
Passing runtime-specific configuration options (`dsn`, `release`,
`environment`, `sampleRate`, `tracesSampleRate`, `replaysSessionSampleRate`,
`replaysOnErrorSampleRate`) to the Sentry integration will be deprecated in
future versions. We recommend passing your configuration directly to the
respective `Sentry.init()` calls in `sentry.client.config.js` and
`sentry.server.config.js` instead.
</Alert>

### Client-Side Setup
Expand Down Expand Up @@ -122,7 +134,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs

// ___PRODUCT_OPTION_START___ performance
Expand All @@ -148,7 +160,7 @@ Sentry.init({
```javascript {filename:sentry.server.config.js}
import * as Sentry from "@sentry/astro";
// ___PRODUCT_OPTION_START___ profiling
import { nodeProfilingIntegration } from '@sentry/profiling-node';
import { nodeProfilingIntegration } from "@sentry/profiling-node";
// ___PRODUCT_OPTION_END___ profiling

Sentry.init({
Expand All @@ -167,7 +179,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs

// ___PRODUCT_OPTION_START___ performance
Expand All @@ -179,7 +191,7 @@ Sentry.init({

// Set sampling rate for profiling
// This is relative to tracesSampleRate
profilesSampleRate: 1.0
profilesSampleRate: 1.0,
// ___PRODUCT_OPTION_END___ profiling
});
```
Expand Down Expand Up @@ -211,13 +223,13 @@ Trigger a test error somewhere in your Astro app, for example in one of your pag
```

<Alert>
Errors triggered from within Browser DevTools are sandboxed and won't trigger an error handler.
Place the snippet directly in your code instead.
Errors triggered from within Browser DevTools are sandboxed and won't trigger
an error handler. Place the snippet directly in your code instead.
</Alert>

<Alert>
Learn more about manually capturing an error or message in our <PlatformLink to="/usage/">Usage
documentation</PlatformLink>.
Learn more about manually capturing an error or message in our{" "}
<PlatformLink to="/usage/">Usage documentation</PlatformLink>.
</Alert>

To view and resolve the recorded error, log into [sentry.io](https://sentry.io) and select your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
Expand Down Expand Up @@ -245,7 +257,7 @@ export default defineConfig({

<Alert>

Auto instrumentation only works for Astro 3.5.2 or newer. If you're using an older version, you need to [manually add the Sentry middleware](#manually-add-server-instrumentation) instead.
Auto instrumentation only works for Astro 3.5.2 or newer. If you're using an older version, you need to [manually add the Sentry middleware](#manually-add-server-instrumentation) instead.

</Alert>

Expand Down
14 changes: 8 additions & 6 deletions docs/platforms/javascript/guides/cloudflare/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ categories:
- serverless
---


You can use the Sentry Cloudflare SDK with popular frameworks running on Cloudflare:

- **[Astro](frameworks/astro/)**
- **[Astro](frameworks/astro/)**
- **[Hono](frameworks/hono/)**
- **[Remix](frameworks/remix/)**
- **[SvelteKit](frameworks/sveltekit/)**
Expand Down Expand Up @@ -41,7 +40,10 @@ Select which Sentry features you'd like to install in addition to Error Monitori

### Setup (Cloudflare Workers)

<PlatformContent includePath="getting-started-config" platform="javascript.cloudflare.workers" />
<PlatformContent
includePath="getting-started-config"
platform="javascript.cloudflare.workers"
/>

If you do not have access to the `onRequest` middleware API, you can use the `wrapRequestHandler` API instead. For example:

Expand Down Expand Up @@ -81,14 +83,14 @@ export const onRequest = [
dsn: "___PUBLIC_DSN___",

release: versionId,

// Adds request headers and IP for users, for more info visit:
// https://docs.sentry.io/platforms/javascript/guides/cloudflare/configuration/options/#sendDefaultPii
sendDefaultPii: true,
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs

// ___PRODUCT_OPTION_START___ performance
Expand All @@ -97,7 +99,7 @@ export const onRequest = [
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
tracesSampleRate: 1.0,
// ___PRODUCT_OPTION_END___ performance
}
};
}),
// Add more middlewares here
];
Expand Down
20 changes: 14 additions & 6 deletions docs/platforms/javascript/guides/ember/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ categories:

<Alert>

Sentry's Ember addon enables automatic reporting of errors, exceptions, and transactions.
Sentry's Ember addon enables automatic reporting of errors, exceptions, and transactions.

</Alert>

Expand All @@ -24,7 +24,15 @@ Select which Sentry features you'd like to install in addition to Error Monitori

## Install

<OnboardingOptionButtons options={["error-monitoring", "performance", "session-replay", "user-feedback", "logs"]} />
<OnboardingOptionButtons
options={[
"error-monitoring",
"performance",
"session-replay",
"user-feedback",
"logs",
]}
/>

Sentry captures data by using an SDK within your application's runtime.

Expand All @@ -46,11 +54,11 @@ import * as Sentry from "@sentry/ember";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// Adds request headers and IP for users, for more info visit:
// https://docs.sentry.io/platforms/javascript/guides/ember/configuration/options/#sendDefaultPii
sendDefaultPii: true,

// ___PRODUCT_OPTION_START___ session-replay
integrations: [
Sentry.replayIntegration(),
Expand All @@ -65,7 +73,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs

// ___PRODUCT_OPTION_START___ performance
Expand Down Expand Up @@ -96,7 +104,7 @@ export default class App extends Application {

<Alert>

This SDK uses Ember configuration conventions to manage its automatic instrumentation and other Sentry options. This additional configuration can be found under <PlatformLink to="/configuration/ember-options/">Ember options</PlatformLink>.
This SDK uses Ember configuration conventions to manage its automatic instrumentation and other Sentry options. This additional configuration can be found under <PlatformLink to="/configuration/ember-options/">Ember options</PlatformLink>.

</Alert>

Expand Down
17 changes: 12 additions & 5 deletions docs/platforms/javascript/guides/gatsby/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ Select which Sentry features you'd like to install in addition to Error Monitori

## Install

<OnboardingOptionButtons options={["error-monitoring", "performance", "session-replay", "user-feedback", "logs"]} />
<OnboardingOptionButtons
options={[
"error-monitoring",
"performance",
"session-replay",
"user-feedback",
"logs",
]}
/>

To use Sentry with your Gatsby application, you will need to use `@sentry/gatsby` (Sentry's Gatsby SDK):

Expand Down Expand Up @@ -53,17 +61,16 @@ module.exports = {

Then, configure your `Sentry.init`. For this, create a new file called `sentry.config.js` in the root of your project and add the following code:


```javascript {filename:sentry.config.(js|ts)}
import * as Sentry from "@sentry/gatsby";

Sentry.init({
dsn: "___PUBLIC_DSN___",

// Adds request headers and IP for users, for more info visit:
// https://docs.sentry.io/platforms/javascript/guides/gatsby/configuration/options/#sendDefaultPii
sendDefaultPii: true,

integrations: [
// ___PRODUCT_OPTION_START___ performance
Sentry.browserTracingIntegration(),
Expand All @@ -81,7 +88,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs

// ___PRODUCT_OPTION_START___ performance
Expand Down
14 changes: 10 additions & 4 deletions docs/platforms/javascript/guides/nextjs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ In addition to capturing errors, you can monitor interactions between multiple s
Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below.

<OnboardingOptionButtons
options={["error-monitoring", "performance", "session-replay", "user-feedback", "logs"]}
options={[
"error-monitoring",
"performance",
"session-replay",
"user-feedback",
"logs",
]}
/>

## Step 1: Install
Expand Down Expand Up @@ -82,7 +88,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs

// ___PRODUCT_OPTION_START___ performance
Expand All @@ -94,7 +100,7 @@ Sentry.init({
tracesSampleRate: 1.0,
// ___PRODUCT_OPTION_END___ performance
// ___PRODUCT_OPTION_START___ session-replay
// Capture Replay for 10% of all
// Capture Replay for 10% of all
// plus for 100% of sessions with an error
// Learn more at
// https://docs.sentry.io/platforms/javascript/session-replay/configuration/#general-integration-configuration
Expand All @@ -118,7 +124,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs

// ___PRODUCT_OPTION_START___ performance
Expand Down
16 changes: 10 additions & 6 deletions docs/platforms/javascript/guides/nextjs/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
Expand Down Expand Up @@ -184,7 +184,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs

// ...
Expand Down Expand Up @@ -216,7 +216,7 @@ Sentry.init({
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
_experiments: { enableLogs: true },
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs

// ...
Expand Down Expand Up @@ -459,6 +459,7 @@ Make sure to keep your auth token secret and out of version control.
You can prevent ad blockers from blocking Sentry events using tunneling. Use the `tunnelRoute` option to add an API endpoint in your application that forwards Sentry events to Sentry servers.

For better ad-blocker evasion, you can either:

- Set `tunnelRoute: true` to automatically generate a random tunnel route for each build, making it harder for ad-blockers to detect and block monitoring requests
- Set `tunnelRoute: "/my-tunnel-route"` to use a static route of your choosing

Expand All @@ -481,9 +482,12 @@ module.exports = withSentryConfig(nextConfig, {
```

<Expandable level="warning" title="Using Next.js middleware on Turbopack">
If you're using Turbopack, client-side event recording will fail if your Next.js middleware intercepts the configured tunnel route. To fix this, set the route to a fixed string (like `/error-monitoring`) and add a negative matcher like `(?!error-monitoring)` in your middleware to exclude the tunnel route.

If you're not using Turbopack, Sentry will automatically skip the tunnel route in your middleware.
If you're using Turbopack, client-side event recording will fail if your
Next.js middleware intercepts the configured tunnel route. To fix this, set
the route to a fixed string (like `/error-monitoring`) and add a negative
matcher like `(?!error-monitoring)` in your middleware to exclude the tunnel
route. If you're not using Turbopack, Sentry will automatically skip the
tunnel route in your middleware.
</Expandable>

## Step 6: Instrument Vercel Cron Jobs (Optional)
Expand Down
Loading