-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(js): Update profiling docs (#12161)
- Loading branch information
Showing
24 changed files
with
154 additions
and
922 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
docs/platforms/javascript/common/profiling/browser-profiling.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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." | ||
--- | ||
|
||
<Note> | ||
|
||
Browser Profiling is currently in beta. Beta features are still in progress and may have bugs. We recognize the irony. | ||
|
||
</Note> | ||
|
||
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. | ||
|
||
<PlatformContent includePath="profiling/index/why-profiling" /> | ||
|
||
## Prerequisites | ||
|
||
To get started with JavaScript browser profiling, you'll need to: | ||
|
||
- Install the <PlatformSdkPackageName fallback="@sentry/browser"/> 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 <PlatformOrGuideName/> SDK | ||
|
||
<PlatformSection notSupported={["javascript.electron"]}> | ||
|
||
Install our <PlatformOrGuideName/> SDK using either `yarn` or `npm`, the minimum version that supports profiling is **7.60.0**. | ||
|
||
</PlatformSection> | ||
|
||
<PlatformSection supported={["javascript.electron"]}> | ||
|
||
Install our Electron SDK using either `yarn` or `npm`, the minimum version that supports profiling is **4.16.0**. | ||
|
||
</PlatformSection> | ||
|
||
<PlatformContent includePath="profiling/automatic-instrumentation-intro" /> | ||
|
||
## 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. | ||
|
||
<PlatformContent includePath="profiling/automatic-instrumentation-headers" /> | ||
|
||
## Step 3: Configure the <PlatformOrGuideName/> 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. | ||
|
||
<PlatformContent includePath="profiling/automatic-instrumentation-setup" /> | ||
|
||
## 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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." | ||
--- | ||
|
||
<Note> | ||
|
||
Browser Profiling is currently in beta. Beta features are still in progress and may have bugs. We recognize the irony. | ||
|
||
</Note> | ||
|
||
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. | ||
|
||
<PlatformContent includePath="profiling/index/why-profiling" /> | ||
|
||
## Prerequisites | ||
|
||
To get started with JavaScript browser profiling, you'll need to: | ||
|
||
- Install the <PlatformSdkPackageName fallback="@sentry/browser"/> 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 <PlatformOrGuideName/> SDK | ||
|
||
<PlatformSection notSupported={["javascript.electron"]}> | ||
|
||
Install our <PlatformOrGuideName/> SDK using either `yarn` or `npm`, the minimum version that supports profiling is **7.60.0**. | ||
|
||
</PlatformSection> | ||
|
||
<PlatformSection supported={["javascript.electron"]}> | ||
|
||
Install our Electron SDK using either `yarn` or `npm`, the minimum version that supports profiling is **4.16.0**. | ||
|
||
</PlatformSection> | ||
|
||
<PlatformContent includePath="profiling/automatic-instrumentation-intro" /> | ||
|
||
## 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. | ||
|
||
<PlatformContent includePath="profiling/automatic-instrumentation-headers" /> | ||
|
||
## 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. | ||
|
||
<PlatformContent includePath="profiling/automatic-instrumentation-setup" /> | ||
|
||
## 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. | ||
<PageGrid /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 0 additions & 85 deletions
85
docs/platforms/javascript/guides/aws-lambda/profiling/index.mdx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.