diff --git a/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx b/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx index 385431b855dc9..c6c2578fc2153 100644 --- a/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx @@ -13,7 +13,7 @@ notSupported: - javascript.hapi - javascript.koa - javascript.nestjs - - javascript. + - javascript.deno - javascript.cloudflare - javascript.bun --- diff --git a/docs/platforms/javascript/guides/cloudflare/config.yml b/docs/platforms/javascript/guides/cloudflare/config.yml index b4574433d672a..5f4308c7eab38 100644 --- a/docs/platforms/javascript/guides/cloudflare/config.yml +++ b/docs/platforms/javascript/guides/cloudflare/config.yml @@ -1,6 +1,6 @@ title: Cloudflare description: 'Official Sentry SDK for Cloudflare Workers and Cloudflare Pages.' -sdk: sentry.javascript.bun +sdk: sentry.javascript.cloudflare categories: - javascript - server diff --git a/platform-includes/getting-started-config/javascript.cloudflare.mdx b/platform-includes/getting-started-config/javascript.cloudflare.mdx index dfe5d9efcfe79..ee7974fdff688 100644 --- a/platform-includes/getting-started-config/javascript.cloudflare.mdx +++ b/platform-includes/getting-started-config/javascript.cloudflare.mdx @@ -19,8 +19,7 @@ To use this SDK, add the `sentryPagesPlugin` as We recommend adding a `functions/_middleware.js` for the middleware setup so that Sentry is initialized for your entire app. -```javascript -// functions/_middleware.js +```javascript {filename:functions/_middleware.js} import * as Sentry from "@sentry/cloudflare"; export const onRequest = [ @@ -39,8 +38,6 @@ export const onRequest = [ To use this SDK, wrap your handler with the `withSentry` function. This will initialize the SDK and hook into the environment. Note that you can turn off almost all side effects using the respective options. -Currently only ESM handlers are supported. - ```javascript import * as Sentry from '@sentry/cloudflare'; diff --git a/platform-includes/performance/configure-sample-rate/javascript.cloudflare.mdx b/platform-includes/performance/configure-sample-rate/javascript.cloudflare.mdx index c858bd0f31ffd..d85bc18cdcb9b 100644 --- a/platform-includes/performance/configure-sample-rate/javascript.cloudflare.mdx +++ b/platform-includes/performance/configure-sample-rate/javascript.cloudflare.mdx @@ -1,60 +1,35 @@ -```javascript -import * as Sentry from "@sentry/bun"; - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [], -}); -``` - ## Cloudflare Pages -To use this SDK, add the `sentryPagesPlugin` as -[middleware to your Cloudflare Pages application](https://developers.cloudflare.com/pages/functions/middleware/). - -We recommend adding a `functions/_middleware.js` for the middleware setup so that Sentry is initialized for your entire -app. - -```javascript -// functions/_middleware.js +```javascript {filename:functions/_middleware.js} import * as Sentry from "@sentry/cloudflare"; export const onRequest = [ - // Make sure Sentry is the first middleware Sentry.sentryPagesPlugin((context) => ({ dsn: "___PUBLIC_DSN___", - // We recommend adjusting this value in production, or using tracesSampler - // for finer control - tracesSampleRate: 1.0, + // To set a uniform sample rate + tracesSampleRate: 0.2 - // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + // Alternatively, to control sampling dynamically + tracesSampler: samplingContext => { ... } })), - // Add more middlewares here ]; ``` ## Cloudflare Workers -To use this SDK, wrap your handler with the `withSentry` function. This will initialize the SDK and hook into the -environment. Note that you can turn off almost all side effects using the respective options. - -Currently only ESM handlers are supported. - -```javascript +```javascript {filename:functions/_middleware.js} import * as Sentry from '@sentry/cloudflare'; export default withSentry( env => ({ dsn: "___PUBLIC_DSN___", - // We recommend adjusting this value in production, or using tracesSampler - // for finer control - tracesSampleRate: 1.0, + // To set a uniform sample rate + tracesSampleRate: 0.2 - // Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled - tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/], + // Alternatively, to control sampling dynamically + tracesSampler: samplingContext => { ... } }), { async fetch(request, env, ctx) {