Skip to content

Commit

Permalink
feat: Revamp JS integrations page for v8 (#10138)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jun 4, 2024
1 parent 20742c1 commit 6101daf
Show file tree
Hide file tree
Showing 83 changed files with 1,659 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ supported:
- javascript.hapi
- javascript.koa
- javascript.nestjs
- javascript.electron
- javascript.nextjs
- javascript.sveltekit
- javascript.remix
- javascript.astro
keywords:
[
"anr",
Expand All @@ -38,13 +43,11 @@ To enable ANR detection, add the `Anr` integration from the `@sentry/node` packa

<Alert level="info">

ANR detection requires Node 16 or higher.
ANR detection requires Node 16 or higher and can only be used in the Node.js runtime.

</Alert>

```javascript
import * as Sentry from "@sentry/node";

Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [Sentry.anrIntegration({ captureStackTrace: true })],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Anr
description: "Capture context about the environment and the device that the client is running on, and add it to events. (default)"
supported:
- javascript.node
- javascript.aws-lambda
- javascript.azure-functions
- javascript.connect
- javascript.express
- javascript.fastify
- javascript.gcp-functions
- javascript.hapi
- javascript.koa
- javascript.nestjs
- javascript.electron
- javascript.nextjs
- javascript.sveltekit
- javascript.remix
- javascript.astro
---

<Alert level="info">

This integration only works in the Node.js runtime.

</Alert>

_Import name: `Sentry.anrIntegration`_

The `anrIntegration` captures Application Not Responding (ANR)/Event Loop Stall errors and reports them as Sentry events. For more details, see the documentation on [ANR](../../application-not-responding).
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Aws
description: "Adds instrumentation for aws-sdk. (default)"
supported:
- javascript.aws-lambda
---

_Import name: `Sentry.awsIntegration`_

This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

Adds instrumentation for aws-sdk v2 and v3 to automatically create spans. Powered by [`@opentelemetry/instrumentation-aws-sdk`](https://www.npmjs.com/package/@opentelemetry/instrumentation-aws-sdk).
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: AwsLambda
description: "Adds instrumentation for AWS Lambda. (default)"
supported:
- javascript.aws-lambda
---

_Import name: `Sentry.awsLambdaIntegration`_

This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

Adds instrumentation for AWS Lambda to automatically create spans. Powered by [`@opentelemetry/instrumentation-aws-lambda`](https://www.npmjs.com/package/@opentelemetry/instrumentation-aws-lambda).
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Breadcrumbs
description: "Wraps native APIs to capture breadcrumbs. (default)"
description: "Wraps native browser APIs to capture breadcrumbs. (default)"
notSupported:
- javascript.node
- javascript.aws-lambda
Expand All @@ -13,18 +13,37 @@ notSupported:
- javascript.hapi
- javascript.koa
- javascript.nestjs
- javascript.deno
- javascript.bun
---

<Alert level="info">
This integration only works inside a browser environment.

This integration only works inside a browser environment.

</Alert>

_Import name: `Sentry.breadcrumbsIntegration`_

This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

The `breadcrumbsIntegration` wraps native APIs to capture breadcrumbs.
By default, the Sentry SDK wraps all APIs. You can opt out of capturing breadcrumbs for specific parts of your application (for example, you could say don't capture `console.log` calls as breadcrumbs) via the options below.

By default, the Sentry SDK wraps the `console`, `dom`, fetch`, `history`, and `xhr`browser APIs to add breadcrumbs. You can opt out of capturing breadcrumbs for specific parts of your application (for example, you could say don't capture `console.log` calls as breadcrumbs) via the options below.

```JavaScript
Sentry.init({
integrations: [
Sentry.breadcrumbsIntegration({
console: true,
dom: true,
fetch: true,
history: true,
xhr: true,
}),
],
});
```

## Options

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
title: BrowserApiErrors
description: "Wraps native time and events APIs (`setTimeout`, `setInterval`, `requestAnimationFrame`, `addEventListener/removeEventListener`) in `try/catch` blocks to handle async exceptions. (default)"
notSupported:
- javascript.electron
- javascript.node
- javascript.aws-lambda
- javascript.azure-functions
- javascript.connect
- javascript.express
- javascript.fastify
- javascript.gcp-functions
- javascript.hapi
- javascript.koa
- javascript.nestjs
- javascript.deno
- javascript.bun
---

<Alert level="info">

This integration only works inside a browser environment.

</Alert>

_Import name: `Sentry.browserApiErrorsIntegration`_

This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

This integration wraps native time and event APIs (`setTimeout`, `setInterval`, `requestAnimationFrame`, `addEventListener/removeEventListener`) in `try/catch` blocks to handle async exceptions.

```JavaScript
Sentry.init({
integrations: [
Sentry.browserApiErrorsIntegration({
setTimeout: true;
setInterval: true;
requestAnimationFrame: true;
XMLHttpRequest: true;
eventTarget: true;
}),
],
});
```

## Options

### `setTimeout`

_Type: `boolean`_

Instrument the `setTimeout` browser built-in method.

### `setInterval`

_Type: `boolean`_

Instrument the `setInterval` browser built-in method.

### `requestAnimationFrame`

_Type: `boolean`_

Instrument the `requestAnimationFrame` browser built-in method.

### `XMLHttpRequest`

_Type: `boolean`_

Instrument the `XMLHttpRequest` browser built-in method.

### `eventTarget`

_Type: `boolean | string[]`_

Instrument the `addEventListener` browser built-in method for a set number of default event targets. To override the default event targets, provide an array of strings with the event target names.

List of default event targets:

- `EventTarget`
- `Window`
- `Node`
- `ApplicationCache`
- `AudioTrackList`
- `BroadcastChannel`
- `ChannelMergerNode`
- `CryptoOperation`
- `EventSource`
- `FileReader`
- `HTMLUnknownElement`
- `IDBDatabase`
- `IDBRequest`
- `IDBTransaction`
- `KeyOperation`
- `MediaController`
- `MessagePort`
- `ModalWindow`
- `Notification`
- `SVGElementInstance`
- `Screen`
- `SharedWorker`
- `TextTrack`
- `TextTrackCue`
- `TextTrackList`
- `WebSocket`
- `WebSocketWorker`
- `Worker`
- `XMLHttpRequest`
- `XMLHttpRequestEventTarget`
- `XMLHttpRequestUpload`
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
---
title: BrowserProfiling
description: "Collect & view performance insights for JavaScript programs with Sentry’s JavaScript Profiling integration."
title: BrowserTracing
description: "Capture profiling data for the Browser."
notSupported:
- javascript.cordova
- javascript.wasm
- javascript.bun
- javascript.deno
- javascript.node
- javascript.aws-lambda
- javascript.azure-functions
Expand All @@ -16,14 +13,20 @@ notSupported:
- javascript.hapi
- javascript.koa
- javascript.nestjs
- javascript.deno
- javascript.bun
---

<Alert level="info">
This integration only works inside a browser environment.

This integration only works inside a browser environment.

</Alert>

_Import name: `Sentry.browserProfilingIntegration`_

[Profiling](/product/profiling/) offers a deeper level of visibility on top of traditional tracing, removing the need for custom instrumentation and enabling precise code-level visibility into your application in a production environment.
[Profiling](/product/profiling/), builds upon [Sentry Performance Monitoring](/product/performance/) to provide precise code-level visibility into browser application execution in a production environment.

The BrowserProfiling integration sets up automatic performance profiling for your frontend applications. It captures profiles via the [JS Self-Profiling API](https://wicg.github.io/js-self-profiling/) from the browser and sends them to Sentry. To use this integration, you also need to have the [BrowserTracing integration](./browsertracing) enabled.

Read more about <PlatformLink to='/profiling'>setting up Profiling</PlatformLink>.
Read more about [setting up BrowserProfiling](./../../../profiling/).
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ notSupported:
- javascript.hapi
- javascript.koa
- javascript.nestjs
- javascript.deno
- javascript.bun
---

<Alert level="info">
This integration only works inside a browser environment.

This integration only works inside a browser environment.

</Alert>

_Import name: `Sentry.browserTracingIntegration`_
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: BunServer
description: "Instruments Bun.serve to automatically create transactions and capture errors. (default)"
supported:
- javascript.bun
---

<Alert level="info">

This integration only works in the Bun runtime.

</Alert>

_Import name: `Sentry.bunServerIntegration`_

This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

The `bunServerIntegration` instruments [`Bun.serve` API](https://bun.sh/docs/api/http) to automatically create transactions and capture errors.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Connect
description: "Adds performance instrumentation for Connect. (default)"
supported:
- javascript.node
- javascript.hapi
---

For more information on setting up Sentry Connect support, see the [Connect Sentry documentation](/platforms/javascript/guides/connect/).

<Alert level="info">

This integration only works in the Node.js and Bun runtimes.

</Alert>

_Import name: `Sentry.connectIntegration`_

This integration is enabled by default when performance monitoring is enabled. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

The `connectIntegration` adds instrumentation for the Hapi framework to capture spans using [`@opentelemetry/instrumentation-connect`](https://www.npmjs.com/package/@opentelemetry/instrumentation-connect).

## Supported Versions

- Connect `^3.0.0`
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ supported:
- javascript.sveltekit
- javascript.remix
- javascript.astro
- javascript.bun
- javascript.deno
---

<Alert level="info">
This integration only works inside server environments (Node.js, Bun, Deno).

This integration only works inside server environments (Node.js, Bun, Deno).

</Alert>

_Import name: `Sentry.consoleIntegration`_
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
---
title: ContextLines
description: "Adds source code from inline JavaScript of the current page's HTML."
notSupported:
- javascript.cordova
- javascript.node
- javascript.aws-lambda
- javascript.azure-functions
- javascript.connect
- javascript.express
- javascript.fastify
- javascript.gcp-functions
- javascript.hapi
- javascript.koa
- javascript.nestjs
- javascript.deno
- javascript.bun
---

_Import name: `Sentry.contextLinesIntegration`_
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: DenoContext
description: "Capture context about the environment and the device that the client is running on, and add it to events. (default)"
supported:
- javascript.deno
---

<Alert level="info">

This integration only works in the Deno runtime.

</Alert>

_Import name: `Sentry.denoContextIntegration`_

This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

Adds Deno related context to events. This includes contexts about `app`, `device`, `os`, `v8`, and `TypeScript`.
Loading

0 comments on commit 6101daf

Please sign in to comment.