diff --git a/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx b/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx index 568c4d43fffc8..8ca9211b7bcec 100644 --- a/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx +++ b/docs/platforms/javascript/common/configuration/integrations/browserprofiling.mdx @@ -3,6 +3,7 @@ title: BrowserProfiling description: "Capture profiling data for the Browser." notSupported: - javascript.cordova + - javascript.capacitor - javascript.node - javascript.aws-lambda - javascript.azure-functions diff --git a/docs/platforms/javascript/common/profiling/browser-profiling.mdx b/docs/platforms/javascript/common/profiling/browser-profiling.mdx new file mode 100644 index 0000000000000..88ef66583980c --- /dev/null +++ b/docs/platforms/javascript/common/profiling/browser-profiling.mdx @@ -0,0 +1,83 @@ +--- +title: Browser Profiling +sidebar_order: 5000 +supported: + - javascript +notSupported: + - javascript.bun + - javascript.cordova + - javascript.capacitor + - javascript.deno + - javascript.cloudflare + - javascript.node + - javascript.aws-lambda + - javascript.azure-functions + - javascript.connect + - javascript.express + - javascript.fastify + - javascript.gcp-functions + - javascript.hapi + - javascript.koa + - javascript.nestjs +description: "Collect & view performance insights for JavaScript programs with Sentry's JavaScript Profiling integration." +--- + + + +Browser Profiling is currently in beta. Beta features are still in progress and may have bugs. We recognize the irony. + + + +The browser profiling integration is built using the [JS Self-Profiling API](https://wicg.github.io/js-self-profiling/) and will likely only move out of beta once the specification progresses and gains adoption. See [platform status](https://chromestatus.com/feature/5170190448852992). + +Note that since the profiling API is currently only exposed in Chromium, profiles collected only include that demographic. We hope that as the API gains adoption, other browsers will implement it as well. + + + +## Prerequisites + +To get started with JavaScript browser profiling, you'll need to: + +- Install the SDK, minimum version 7.60.0 +- Configure the document response header to include `Document-Policy: js-profiling` +- Configure the SDK to use the `BrowserProfilingIntegration` and set `profilesSampleRate` + +## Step 1: Install the SDK + + + +Install our SDK using either `yarn` or `npm`, the minimum version that supports profiling is **7.60.0**. + + + + + +Install our Electron SDK using either `yarn` or `npm`, the minimum version that supports profiling is **4.16.0**. + + + + + +## Step 2: Add Document-Policy: js-profiling header + +For the JavaScript browser profiler to start, the document response header needs to include a `Document-Policy` header key with the `js-profiling` value. + + + +## Step 3: Configure the SDK + +Configuration should happen as early as possible in your application's lifecycle. Once this is done, Sentry's JavaScript SDK will capture all unhandled exceptions and transactions. + + + +## The Difference Between DevTools & Sentry's JavaScript Browser Profiler + +What does Sentry's JavaScript browser profile offer that Chrome DevTools does not? + +- Sentry's JavaScript profiler runs in production and captures real user data, showing real-world performance. DevTools runs locally and only shows profiles of what's running on your machine. +- Sentry runs at a lower sampling rate of 100Hz with a 10ms sample period versus a sampling rate of 1000Hz and a 1ms sample period for DevTools. +- Sentry supports deobfuscation, making it so that all the function names in your code are correct. Typically, when you run JavaScript code, it's minified, meaning that all the function names are replaced with machine-generated abbreviations. + +Please note, that since the browser profiling API is currently only implemented in Chromium-based browsers, the profiles collected with Sentry's JavaScript browser profiling will inherently be biased toward that demographic. This is something that you'll need to consider if you're basing your decisions on the data collected. + +We hope that as the Javascript browser profiling API gains adoption, other browsers will implement it as well. If you find the browser profiling feature helpful and would like to see it gain further adoption, please consider supporting the spec at the official WICG repository. diff --git a/docs/platforms/javascript/common/profiling/index.mdx b/docs/platforms/javascript/common/profiling/index.mdx index 5088dc921cc53..dcddf31ebdde4 100644 --- a/docs/platforms/javascript/common/profiling/index.mdx +++ b/docs/platforms/javascript/common/profiling/index.mdx @@ -1,72 +1,13 @@ --- title: Set Up Profiling sidebar_order: 5000 -supported: - - javascript +description: "Collect & view performance insights for JavaScript programs with Sentry's Profiling integrations. Get started with browser and Node.js profiling to understand your application's performance." notSupported: - javascript.bun - javascript.cordova + - javascript.capacitor - javascript.deno - javascript.cloudflare -description: "Collect & view performance insights for JavaScript programs with Sentry’s JavaScript Profiling integration. Get started with browser profiling here." --- - - -Browser Profiling is currently in beta. Beta features are still in progress and may have bugs. We recognize the irony. - - - -The browser profiling integration is built using [JS Self-Profiling API](https://wicg.github.io/js-self-profiling/) and will likely only move out of beta once the specification progresses and gains adoption. See platform [status](https://chromestatus.com/feature/5170190448852992). - -Note that since the profiling API is currently only exposed in Chromium, profiles collected only include that demographic. This is obvious, but should not be forgotten when analyzing the data collected. We hope that as the API gains adoption, other browsers will implement it as well. - - - -## Prerequisites - -To get started with JavaScript browser profiling, you'll need to: - -- Install the SDK, minimum version 7.60.0 -- Configure the document response header to include `Document-Policy: js-profiling` -- Configure the SDK to use the `BrowserProfilingIntegration` and set `profilesSampleRate` - -## Step 1: Install the SDK - - - -Install our SDK using either `yarn` or `npm`, the minimum version that supports profiling is **7.60.0**. - - - - - -Install our Electron SDK using either `yarn` or `npm`, the minimum version that supports profiling is **4.16.0**. - - - - - -## Step 2: Add Document-Policy: js-profiling header - -For the JavaScript browser profiler to start, the document response header needs to include a `Document-Policy` header key with the `js-profiling` value. - - - -## Step 3: Configure the JavaScript SDK - -Configuration should happen as early as possible in your application's lifecycle. Once this is done, Sentry's JavaScript SDK will capture all unhandled exceptions and transactions. - - - -## The Difference Between DevTools & Sentry's JavaScript Browser Profiler - -What does Sentry's JavaScript browser profile offer that Chrome DevTools does not? - -- Sentry JavaScript profiler runs in production and captures real user data, showing real-world performance. DevTools runs locally on your machine and only shows profiles of what's running on your machine. -- Sentry runs at a lower sampling rate of 100Hz with a 10ms sample period versus a sampling rate of 1000Hz and a 1ms sample period for DevTools. -- Sentry supports deobfuscation, making it so that all the function names in your code are correct. Typically, when you run JavaScript code, it's minified, meaning that all the function names are replaced with machine-generated abbreviations. - -Please note, that since the browser profiling API is currently only implemented in Chromium-based browsers, the profiles collected with Sentry's JavaScript browser profiling will inherently be biased toward that demographic. This is something that you'll need to consider if you're basing your decisions on the data collected. - -We hope that as the Javascript browser profiling API gains adoption, other browsers will implement it as well. If you find the browser profiling feature helpful and would like to see it gain further adoption, please consider supporting the spec at the official WICG repository. + \ No newline at end of file diff --git a/docs/platforms/javascript/guides/nestjs/profiling/index.mdx b/docs/platforms/javascript/common/profiling/node-profiling.mdx similarity index 77% rename from docs/platforms/javascript/guides/nestjs/profiling/index.mdx rename to docs/platforms/javascript/common/profiling/node-profiling.mdx index 6c872ec942f17..42ccf5fb0edd6 100644 --- a/docs/platforms/javascript/guides/nestjs/profiling/index.mdx +++ b/docs/platforms/javascript/common/profiling/node-profiling.mdx @@ -1,7 +1,22 @@ --- -title: Set Up Profiling +title: Node Profiling sidebar_order: 5000 description: "Learn more about how to configure our Profiling integration and start profiling your code." +supported: + - javascript.nextjs + - javascript.sveltekit + - javascript.remix + - javascript.astro + - javascript.node + - javascript.aws-lambda + - javascript.azure-functions + - javascript.connect + - javascript.express + - javascript.fastify + - javascript.gcp-functions + - javascript.hapi + - javascript.koa + - javascript.nestjs --- By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. @@ -14,43 +29,25 @@ If you're adopting Profiling in a high-throughput environment, we recommend test ## Installation - - Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/nestjs` package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/nestjs @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/nestjs @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/nestjs @sentry/profiling-node -``` +You have to have the (minimum version `7.44.1`) package installed. ## Enabling Profiling -To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`. - +To enable profiling, add `@sentry/profiling-node` to your imports and set up `nodeProfilingIntegration` in your Sentry config. -```javascript -const Sentry = require("@sentry/nestjs"); +```javascript {diff} const { nodeProfilingIntegration } = require("@sentry/profiling-node"); Sentry.init({ dsn: "___PUBLIC_DSN___", integrations: [ // Add our Profiling integration - nodeProfilingIntegration(), ++ nodeProfilingIntegration(), ], tracesSampleRate: 1.0, - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, ++ // Set sampling rate for profiling - this is relative to tracesSampleRate ++ profilesSampleRate: 1.0, }); // Profiling happens automatically after setting it up with `Sentry.init()`. diff --git a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx b/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx deleted file mode 100644 index 471e531a5b780..0000000000000 --- a/docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Set Up Profiling -sidebar_order: 5000 -description: "Learn more about how to configure our Profiling integration and start profiling your code." ---- - -By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. - - - -If you're adopting Profiling in a high-throughput environment, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations. - - - -## Installation - - - -Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/aws-serverless` (minimum version `8.0.0`) package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/aws-serverless @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/aws-serverless @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/aws-serverless @sentry/profiling-node -``` - -## Enabling Profiling - -To enable profiling, import `@sentry/profiling-node`, add the `nodeProfilingIntegration` to your integrations, and set the `profilesSampleRate`. - - -```javascript -const Sentry = require("@sentry/aws-serverless"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, -}); - -// Profiling happens automatically after setting it up with `Sentry.init()`. -// All spans captured in your application will have profiling data attached to them. -// You can also manually capture spans with `startSpan`, as shown below: -Sentry.startSpan( - { - op: "rootSpan", - name: "My root span", - }, - () => { - // Any code in this callback will be profiled. - } -); -``` - -## How Does It Work? - -Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. - - - -## Precompiled Binaries - -Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: - -- macOS x64: Node v16, v18, v20 -- Linux ARM64 (musl): Node v16, v18, v20 -- Linux x64 (glibc): Node v16, v18, v20 -- Windows x64: Node v16, v18, v20 - -The set of common architectures should cover a wide variety of use cases, but if you have feedback or experience different behavior, please open an issue in the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript) repository. diff --git a/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx b/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx deleted file mode 100644 index 16308479c44ef..0000000000000 --- a/docs/platforms/javascript/guides/azure-functions/profiling/index.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Set Up Profiling -sidebar_order: 5000 -description: "Learn more about how to configure our Profiling integration and start profiling your code." ---- - -By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. - - - -If you're adopting Profiling in a high-throughput environment, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations. - - - -## Installation - - - -Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/node` (minimum version `7.44.1`) package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/node @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/node @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/node @sentry/profiling-node -``` - -## Enabling Profiling - -To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`. - - -```javascript -const Sentry = require("@sentry/node"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, -}); - -// Profiling happens automatically after setting it up with `Sentry.init()`. -// All spans captured in your application will have profiling data attached to them. -// You can also manually capture spans with `startSpan`, as shown below: -Sentry.startSpan( - { - op: "rootSpan", - name: "My root span", - }, - () => { - // Any code in this callback will be profiled. - } -); -``` - -## How Does It Work? - -Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. - - - -## Precompiled Binaries - -Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: - -- macOS x64: Node v16, v18, v20 -- Linux ARM64 (musl): Node v16, v18, v20 -- Linux x64 (glibc): Node v16, v18, v20 -- Windows x64: Node v16, v18, v20 - -The set of common architectures should cover a wide variety of use cases, but if you have feedback or experience different behavior, please open an issue in the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript) repository. diff --git a/docs/platforms/javascript/guides/connect/profiling/index.mdx b/docs/platforms/javascript/guides/connect/profiling/index.mdx deleted file mode 100644 index 16308479c44ef..0000000000000 --- a/docs/platforms/javascript/guides/connect/profiling/index.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Set Up Profiling -sidebar_order: 5000 -description: "Learn more about how to configure our Profiling integration and start profiling your code." ---- - -By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. - - - -If you're adopting Profiling in a high-throughput environment, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations. - - - -## Installation - - - -Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/node` (minimum version `7.44.1`) package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/node @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/node @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/node @sentry/profiling-node -``` - -## Enabling Profiling - -To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`. - - -```javascript -const Sentry = require("@sentry/node"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, -}); - -// Profiling happens automatically after setting it up with `Sentry.init()`. -// All spans captured in your application will have profiling data attached to them. -// You can also manually capture spans with `startSpan`, as shown below: -Sentry.startSpan( - { - op: "rootSpan", - name: "My root span", - }, - () => { - // Any code in this callback will be profiled. - } -); -``` - -## How Does It Work? - -Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. - - - -## Precompiled Binaries - -Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: - -- macOS x64: Node v16, v18, v20 -- Linux ARM64 (musl): Node v16, v18, v20 -- Linux x64 (glibc): Node v16, v18, v20 -- Windows x64: Node v16, v18, v20 - -The set of common architectures should cover a wide variety of use cases, but if you have feedback or experience different behavior, please open an issue in the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript) repository. diff --git a/docs/platforms/javascript/guides/express/profiling/index.mdx b/docs/platforms/javascript/guides/express/profiling/index.mdx deleted file mode 100644 index 16308479c44ef..0000000000000 --- a/docs/platforms/javascript/guides/express/profiling/index.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Set Up Profiling -sidebar_order: 5000 -description: "Learn more about how to configure our Profiling integration and start profiling your code." ---- - -By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. - - - -If you're adopting Profiling in a high-throughput environment, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations. - - - -## Installation - - - -Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/node` (minimum version `7.44.1`) package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/node @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/node @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/node @sentry/profiling-node -``` - -## Enabling Profiling - -To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`. - - -```javascript -const Sentry = require("@sentry/node"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, -}); - -// Profiling happens automatically after setting it up with `Sentry.init()`. -// All spans captured in your application will have profiling data attached to them. -// You can also manually capture spans with `startSpan`, as shown below: -Sentry.startSpan( - { - op: "rootSpan", - name: "My root span", - }, - () => { - // Any code in this callback will be profiled. - } -); -``` - -## How Does It Work? - -Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. - - - -## Precompiled Binaries - -Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: - -- macOS x64: Node v16, v18, v20 -- Linux ARM64 (musl): Node v16, v18, v20 -- Linux x64 (glibc): Node v16, v18, v20 -- Windows x64: Node v16, v18, v20 - -The set of common architectures should cover a wide variety of use cases, but if you have feedback or experience different behavior, please open an issue in the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript) repository. diff --git a/docs/platforms/javascript/guides/fastify/profiling/index.mdx b/docs/platforms/javascript/guides/fastify/profiling/index.mdx deleted file mode 100644 index 16308479c44ef..0000000000000 --- a/docs/platforms/javascript/guides/fastify/profiling/index.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Set Up Profiling -sidebar_order: 5000 -description: "Learn more about how to configure our Profiling integration and start profiling your code." ---- - -By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. - - - -If you're adopting Profiling in a high-throughput environment, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations. - - - -## Installation - - - -Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/node` (minimum version `7.44.1`) package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/node @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/node @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/node @sentry/profiling-node -``` - -## Enabling Profiling - -To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`. - - -```javascript -const Sentry = require("@sentry/node"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, -}); - -// Profiling happens automatically after setting it up with `Sentry.init()`. -// All spans captured in your application will have profiling data attached to them. -// You can also manually capture spans with `startSpan`, as shown below: -Sentry.startSpan( - { - op: "rootSpan", - name: "My root span", - }, - () => { - // Any code in this callback will be profiled. - } -); -``` - -## How Does It Work? - -Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. - - - -## Precompiled Binaries - -Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: - -- macOS x64: Node v16, v18, v20 -- Linux ARM64 (musl): Node v16, v18, v20 -- Linux x64 (glibc): Node v16, v18, v20 -- Windows x64: Node v16, v18, v20 - -The set of common architectures should cover a wide variety of use cases, but if you have feedback or experience different behavior, please open an issue in the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript) repository. diff --git a/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx b/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx deleted file mode 100644 index a64aa6ce254e5..0000000000000 --- a/docs/platforms/javascript/guides/gcp-functions/profiling/index.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Set Up Profiling -sidebar_order: 5000 -description: "Learn more about how to configure our Profiling integration and start profiling your code." ---- - -By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. - - - -If you're adopting Profiling in a high-throughput environment, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations. - - - -## Installation - - - -Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/google-cloud-serverless` (minimum version `8.0.0`) package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/google-cloud-serverless @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/google-cloud-serverless @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/google-cloud-serverless @sentry/profiling-node -``` - -## Enabling Profiling - -To enable profiling, import `@sentry/profiling-node`, add the `nodeProfilingIntegration` to your integrations, and set the `profilesSampleRate`. - - -```javascript -const Sentry = require("@sentry/google-cloud-serverless"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, -}); - -// Profiling happens automatically after setting it up with `Sentry.init()`. -// All spans captured in your application will have profiling data attached to them. -// You can also manually capture spans with `startSpan`, as shown below: -Sentry.startSpan( - { - op: "rootSpan", - name: "My root span", - }, - () => { - // Any code in this callback will be profiled. - } -); -``` - -## How Does It Work? - -Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. - - - -## Precompiled Binaries - -Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: - -- macOS x64: Node v16, v18, v20 -- Linux ARM64 (musl): Node v16, v18, v20 -- Linux x64 (glibc): Node v16, v18, v20 -- Windows x64: Node v16, v18, v20 - -The set of common architectures should cover a wide variety of use cases, but if you have feedback or experience different behavior, please open an issue in the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript) repository. diff --git a/docs/platforms/javascript/guides/hapi/profiling/index.mdx b/docs/platforms/javascript/guides/hapi/profiling/index.mdx deleted file mode 100644 index 16308479c44ef..0000000000000 --- a/docs/platforms/javascript/guides/hapi/profiling/index.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Set Up Profiling -sidebar_order: 5000 -description: "Learn more about how to configure our Profiling integration and start profiling your code." ---- - -By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. - - - -If you're adopting Profiling in a high-throughput environment, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations. - - - -## Installation - - - -Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/node` (minimum version `7.44.1`) package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/node @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/node @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/node @sentry/profiling-node -``` - -## Enabling Profiling - -To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`. - - -```javascript -const Sentry = require("@sentry/node"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, -}); - -// Profiling happens automatically after setting it up with `Sentry.init()`. -// All spans captured in your application will have profiling data attached to them. -// You can also manually capture spans with `startSpan`, as shown below: -Sentry.startSpan( - { - op: "rootSpan", - name: "My root span", - }, - () => { - // Any code in this callback will be profiled. - } -); -``` - -## How Does It Work? - -Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. - - - -## Precompiled Binaries - -Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: - -- macOS x64: Node v16, v18, v20 -- Linux ARM64 (musl): Node v16, v18, v20 -- Linux x64 (glibc): Node v16, v18, v20 -- Windows x64: Node v16, v18, v20 - -The set of common architectures should cover a wide variety of use cases, but if you have feedback or experience different behavior, please open an issue in the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript) repository. diff --git a/docs/platforms/javascript/guides/koa/profiling/index.mdx b/docs/platforms/javascript/guides/koa/profiling/index.mdx deleted file mode 100644 index 16308479c44ef..0000000000000 --- a/docs/platforms/javascript/guides/koa/profiling/index.mdx +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: Set Up Profiling -sidebar_order: 5000 -description: "Learn more about how to configure our Profiling integration and start profiling your code." ---- - -By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. - - - -If you're adopting Profiling in a high-throughput environment, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations. - - - -## Installation - - - -Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/node` (minimum version `7.44.1`) package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/node @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/node @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/node @sentry/profiling-node -``` - -## Enabling Profiling - -To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`. - - -```javascript -const Sentry = require("@sentry/node"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - // Set sampling rate for profiling - this is relative to tracesSampleRate - profilesSampleRate: 1.0, -}); - -// Profiling happens automatically after setting it up with `Sentry.init()`. -// All spans captured in your application will have profiling data attached to them. -// You can also manually capture spans with `startSpan`, as shown below: -Sentry.startSpan( - { - op: "rootSpan", - name: "My root span", - }, - () => { - // Any code in this callback will be profiled. - } -); -``` - -## How Does It Work? - -Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. - - - -## Precompiled Binaries - -Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: - -- macOS x64: Node v16, v18, v20 -- Linux ARM64 (musl): Node v16, v18, v20 -- Linux x64 (glibc): Node v16, v18, v20 -- Windows x64: Node v16, v18, v20 - -The set of common architectures should cover a wide variety of use cases, but if you have feedback or experience different behavior, please open an issue in the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript) repository. diff --git a/docs/platforms/javascript/guides/node/profiling/index.mdx b/docs/platforms/javascript/guides/node/profiling/index.mdx deleted file mode 100644 index 6fb57a956ccc8..0000000000000 --- a/docs/platforms/javascript/guides/node/profiling/index.mdx +++ /dev/null @@ -1,146 +0,0 @@ ---- -title: Set Up Profiling -description: "Learn more about how to configure our Profiling integration and start profiling your code." -sidebar_order: 5000 ---- - -By default, Sentry error events will not get trace context unless you configure the scope with the transaction, as illustrated in the example below. - - - -If you're adopting Profiling in a high-throughput environment, we recommend testing prior to deployment to ensure that your service's performance characteristics maintain expectations. - - - -## Installation - - - -Node profiling is available starting in `@sentry/profiling-node` version `0.3.0`. -You have to have the `@sentry/node` (minimum version `7.44.1`) package installed. - - - -```bash {tabTitle:npm} -npm install @sentry/node @sentry/profiling-node --save -``` - -```bash {tabTitle:yarn} -yarn add @sentry/node @sentry/profiling-node -``` - -```bash {tabTitle:pnpm} -pnpm add @sentry/node @sentry/profiling-node -``` - -## Enabling Profiling - -To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`. - -```javascript -const Sentry = require("@sentry/node"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - - // Set profilesSampleRate to 1.0 to profile every transaction. - // Since profilesSampleRate is relative to tracesSampleRate, - // the final profiling rate can be computed as tracesSampleRate * profilesSampleRate - // For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would - // result in 25% of transactions being profiled (0.5*0.5=0.25) - profilesSampleRate: 1.0, -}); - -// Profiling happens automatically after setting it up with `Sentry.init()`. -// All spans captured in your application will have profiling data attached to them. -// You can also manually capture spans with `startSpan`, as shown below: -Sentry.startSpan( - { - op: "rootSpan", - name: "My root span", - }, - () => { - // Any code in this callback will be profiled. - } -); -``` - -Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: - -```javascript -const Sentry = require("@sentry/node"); -const { nodeProfilingIntegration } = require("@sentry/profiling-node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: [ - // Add our Profiling integration - nodeProfilingIntegration(), - ], - tracesSampleRate: 1.0, - - // This function will be called for every sampled span - // to determine if it should be profiled - profilesSampler: (samplingContext) => { - return 1.0; - }, -}); -``` - -## Enable Continuous Profiling - - - -_(New in version 8.28.0)_ - -The current profiling implementation stops the profiler automatically after 30 seconds (unless you manually stop it earlier). Naturally, this limitation makes it difficult to get full coverage of your app's execution. We now offer an experimental continuous mode, where profiling data is periodically uploaded while running, with no limit on how long the profiler may run. - -To get started with continuous profiling, you can start and stop the profiler directly with `Sentry.profiler.startProfiler` and `Sentry.profiler.stopProfiler`. - - - -If you previously set `profilesSampleRate` or `profilesSampler` to use transaction-based profiling, you must remove those lines of code from your configuration in order to use continuous profiling. - - - -```js -const Sentry = require("@sentry/node"); - -Sentry.init({ - dsn: "___PUBLIC_DSN___", -}); - -Sentry.profiler.startProfiler(); - -// run some code here - -Sentry.profiler.stopProfiler(); -``` - -These new APIs do not offer any sampling functionality—every call to start the profiler will run and start sending profiling data. If you are interested in reducing the amount of profiles that run, you must take care to do it at the callsites. - -Continuous profiling has implications for your org's billing structure. This feature is only available for subscription plans that enrolled after June 5, 2024. - -## How Does It Work? - -Under the hood, the Sentry profiler uses V8's [CpuProfiler](https://v8docs.nodesource.com/node-18.2/d2/d34/classv8_1_1_cpu_profiler.html) to collect stack samples. This means that `sentry/profiling-node` is written as a [native add-on](https://nodejs.org/docs/latest-v18.x/api/addons.html) for Node and won't run in environments like Deno or Bun. Profiling enhances tracing by providing profiles for individual transactions. This allows you to look at higher level performance information like transaction and span durations before diving deeper and looking at profiles. - - - -## Precompiled Binaries - -Starting from version `0.1.0`, the `@sentry/profiling-node` package precompiles binaries for a number of common architectures. This minimizes the tooling required to run the package and avoids compiling the package from source in most cases, which speeds up installation. Currently, we ship prebuilt binaries for the following architectures and Node versions: - -- macOS arm64: Node v16, v18, v20, v22 -- macOS x64: Node v16, v18, v20, v22 -- Linux arm64 (musl): Node v16, v18, v20, v22 -- Linux x64 (glibc): Node v16, v18, v20, v22 -- Windows x64: Node v16, v18, v20, v22 - -The set of common architectures should cover a wide variety of use cases, but if you have feedback or experience different behavior, please open an issue in the [Sentry JavaScript SDK](https://github.com/getsentry/sentry-javascript) repository. diff --git a/platform-includes/configuration/integrations/javascript.capacitor.mdx b/platform-includes/configuration/integrations/javascript.capacitor.mdx new file mode 100644 index 0000000000000..c14ee21aa1f06 --- /dev/null +++ b/platform-includes/configuration/integrations/javascript.capacitor.mdx @@ -0,0 +1,25 @@ +### Integrations + +| | **Auto Enabled** | **Errors** | **Tracing** | **Replay** | **Additional Context** | +| ----------------------------------------------------- | :--------------: | :--------: | :---------: | :--------: | :--------------------: | +| [`breadcrumbsIntegration`](./breadcrumbs) | ✓ | | | | ✓ | +| [`browserApiErrorsIntegration`](./browserapierrors) | ✓ | ✓ | | | | +| [`dedupeIntegration`](./dedupe) | ✓ | ✓ | | | | +| [`functionToStringIntegration`](./functiontostring) | ✓ | | | | | +| [`globalHandlersIntegration`](./globalhandlers) | ✓ | ✓ | | | | +| [`httpContextIntegration`](./httpcontext) | ✓ | | | | ✓ | +| [`inboundFiltersIntegration`](./inboundfilters) | ✓ | ✓ | | | | +| [`linkedErrorsIntegration`](./linkederrors) | ✓ | ✓ | | | | +| [`browserSessionIntegration`](./browsersession) | ✓ | | | | ✓ | +| [`browserTracingIntegration`](./browsertracing) | | | ✓ | | ✓ | +| [`captureConsoleIntegration`](./captureconsole) | | | | | ✓ | +| [`contextLinesIntegration`](./contextlines) | | ✓ | | | | +| [`debugIntegration`](./debug) | | | | | | +| [`extraErrorDataIntegration`](./extraerrordata) | | | | | ✓ | +| [`httpClientIntegration`](./httpclient) | | ✓ | | | | +| [`moduleMetadataIntegration`](./modulemetadata) | | | | | ✓ | +| [`rewriteFramesIntegration`](./rewriteframes) | | ✓ | | | | +| [`replayIntegration`](./replay) | | | | ✓ | ✓ | +| [`replayCanvasIntegration`](./replaycanvas) | | | | ✓ | | +| [`reportingObserverIntegration`](./reportingobserver) | | ✓ | | | | +| [`sessionTimingIntegration`](./sessiontiming) | | | | | ✓ | diff --git a/platform-includes/profiling/automatic-instrumentation-intro/javascript.astro.mdx b/platform-includes/profiling/automatic-instrumentation-intro/javascript.astro.mdx new file mode 100644 index 0000000000000..ec0315bb01261 --- /dev/null +++ b/platform-includes/profiling/automatic-instrumentation-intro/javascript.astro.mdx @@ -0,0 +1,11 @@ +```bash {tabTitle:npm} +npm install @sentry/astro --save +``` + +```bash {tabTitle:yarn} +yarn add @sentry/astro +``` + +```bash {tabTitle:pnpm} +pnpm add @sentry/astro +``` diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.angular.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.angular.mdx index 33675f59acf56..da1878f10e2f9 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.angular.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.angular.mdx @@ -28,7 +28,7 @@ Sentry.init({ Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: ```javascript -const Sentry = require("@sentry/angular"); +import * as Sentry from "@sentry/angular"; Sentry.init({ dsn: "___PUBLIC_DSN___", diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.astro.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.astro.mdx index 765584e78b63d..39e0b082933d0 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.astro.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.astro.mdx @@ -27,7 +27,7 @@ Sentry.init({ Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: ```javascript -const Sentry = require("@sentry/astro"); +import * as Sentry from "@sentry/astro"; Sentry.init({ dsn: "___PUBLIC_DSN___", diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.nextjs.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.nextjs.mdx index b6e9c7c9b75a2..b972ffb57a6fb 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.nextjs.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.nextjs.mdx @@ -27,7 +27,7 @@ Sentry.init({ Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: ```javascript {filename:sentry.client.config.js|ts} -const Sentry = require("@sentry/nextjs"); +import * as Sentry from "@sentry/nextjs"; Sentry.init({ dsn: "___PUBLIC_DSN___", diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.nuxt.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.nuxt.mdx index c70291ae63913..8179d0de65365 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.nuxt.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.nuxt.mdx @@ -27,7 +27,7 @@ Sentry.init({ Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: ```javascript {filename:sentry.client.config.js|ts} -const Sentry = require("@sentry/nuxt"); +import * as Sentry from "@sentry/nuxt"; Sentry.init({ dsn: "___PUBLIC_DSN___", diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.react.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.react.mdx index 6a671c306eaa7..b3200aa853763 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.react.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.react.mdx @@ -28,7 +28,7 @@ Sentry.init({ Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: ```javascript -const Sentry = require("@sentry/react"); +import * as Sentry from "@sentry/react"; Sentry.init({ dsn: "___PUBLIC_DSN___", diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.remix.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.remix.mdx index a91255da1e74e..c4bbd438fd13c 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.remix.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.remix.mdx @@ -28,7 +28,7 @@ Sentry.init({ Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: ```javascript {filename:entry.client.tsx} -const Sentry = require("@sentry/remix"); +import * as Sentry from "@sentry/remix"; Sentry.init({ dsn: "___PUBLIC_DSN___", diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.svelte.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.svelte.mdx index fd2796680747d..7267845d4b678 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.svelte.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.svelte.mdx @@ -28,7 +28,7 @@ Sentry.init({ Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: ```javascript -const Sentry = require("@sentry/svelte"); +import * as Sentry from "@sentry/svelte"; Sentry.init({ dsn: "___PUBLIC_DSN___", diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.sveltekit.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.sveltekit.mdx index 550bbc8c6d8df..5e15252624bc0 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.sveltekit.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.sveltekit.mdx @@ -27,7 +27,7 @@ Sentry.init({ Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: ```javascript {filename:hooks.client.js} -const Sentry = require("@sentry/sveltekit"); +import * as Sentry from "@sentry/sveltekit"; Sentry.init({ dsn: "___PUBLIC_DSN___", diff --git a/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx b/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx index 6e711ef27b032..86dcfb47d9dcc 100644 --- a/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx +++ b/platform-includes/profiling/automatic-instrumentation-setup/javascript.vue.mdx @@ -28,7 +28,7 @@ Sentry.init({ Alternatively, instead of a `profilesSampleRate` your can also provide a `profilesSampler` function: ```javascript -const Sentry = require("@sentry/vue"); +import * as Sentry from "@sentry/vue"; Sentry.init({ dsn: "___PUBLIC_DSN___",