Skip to content

Commit

Permalink
feat(js): Re-org js integrations and add missing node integrations (#…
Browse files Browse the repository at this point in the history
…11799)

1. Add Sentry.init snippets to all relevant node integrations
2. Add supported versions where missing in node integrations
3. Add node integration entries for dataloader, knex, and lrumemorizer integrations
4. Make sure dataloader is not marked as default
5. Alpha-order and add missing entries to js integrations table
  • Loading branch information
AbhiPrasad authored Nov 13, 2024
1 parent bbeba13 commit e303818
Show file tree
Hide file tree
Showing 69 changed files with 1,245 additions and 687 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ supported:

<Alert level="info">

This integration only works inside server environments (Node.js, Bun, Deno). Requires SDK version `8.32.0` or higher.
This integration only works in the Node.js and Bun runtimes. Requires SDK version `8.32.0` or higher.

</Alert>

Expand All @@ -35,3 +35,13 @@ _Import name: `Sentry.amqplibIntegration`_
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 `amqplibIntegration` adds instrumentation for the `amqplib` library to capture spans using [`@opentelemetry/instrumentation-amqplib`](https://www.npmjs.com/package/@opentelemetry/instrumentation-amqplib).

```JavaScript
Sentry.init({
integrations: [new Sentry.amqplibIntegration()],
});
```

## Supported Versions

- `amqplib`: `>=0.5.5 <1`
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ This integration only works in the Node.js runtime.
_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).

```JavaScript
Sentry.init({
integrations: [Sentry.anrIntegration({ captureStackTrace: true })],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ _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).

```JavaScript
import * as Sentry from '@sentry/aws-serverless';

Sentry.init({
integrations: [Sentry.awsIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ _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).

```JavaScript
import * as Sentry from '@sentry/aws-serverless';

Sentry.init({
integrations: [Sentry.awsIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ _Import name: `Sentry.browserProfilingIntegration`_
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 [setting up BrowserProfiling](./../../../profiling/).

```JavaScript
Sentry.init({
integrations: [new Sentry.browserProfilingIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ With [tracing](/product/performance/), Sentry tracks your software performance,
The BrowserTracing integration sets up automatic tracing for your frontend applications. It captures transactions and spans from the browser and sends them to Sentry.

Read more about [setting up BrowserTracing](./../../../tracing/).

```JavaScript
Sentry.init({
integrations: [new Sentry.browserTracingIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ _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.

```JavaScript
import * as Sentry from '@sentry/bun';

Sentry.init({
integrations: [new Sentry.bunServerIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ This integration is enabled by default when performance monitoring is enabled. I

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

```JavaScript
Sentry.init({
integrations: [new Sentry.connectIntegration()],
});
```

## Supported Versions

- Connect `^3.0.0`
- `connect`: `^3.0.0`
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ _Import name: `Sentry.consoleIntegration`_
This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

The `consoleIntegration` generates breadcrumbs for console logs.

```JavaScript
Sentry.init({
integrations: [Sentry.consoleIntegration()],
});
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Dataloader
description: "Adds instrumentation for Dataloader. (default)"
description: "Adds instrumentation for Dataloader."
supported:
- javascript.node
- javascript.aws-lambda
Expand Down Expand Up @@ -29,10 +29,14 @@ This integration only works in the Node.js and Bun runtimes. Requires SDK versio

_Import name: `Sentry.dataloaderIntegration`_

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 `dataloaderIntegration` adds instrumentation for the `dataloader` library to capture spans using [`@opentelemetry/instrumentation-dataloader`](https://www.npmjs.com/package/@opentelemetry/instrumentation-dataloader).

```javascript
Sentry.init({
integrations: [new Sentry.dataloaderIntegration()],
});
```

## Supported Versions

- `dataloader`: `>=2.0.0 <3`
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ _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`.

```JavaScript
Sentry.init({
integrations: [Sentry.denoContextIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ _Import name: `Sentry.denoCronIntegration`_
The DenoCron integration sets up automatic monitoring for your cron jobs created by [`Deno.cron`](https://docs.deno.com/deploy/kv/manual/cron). It captures check-ins and sends them to Sentry.

Read more about [setting up Cron Monitoring for Deno](./../../../crons/).

```JavaScript
Sentry.init({
integrations: [Sentry.denoCronIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ This integration is enabled by default when performance monitoring is enabled. I

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

```JavaScript
Sentry.init({
integrations: [new Sentry.fastifyIntegration()],
});
```

## Supported Versions

- `fastify`: `^3.0.0 || ^4.0.0`
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ The `fsIntegration` creates spans for `fs` API operations, like reading and writ
down your application.
</Alert>

```JavaScript
Sentry.init({
integrations: [Sentry.fsIntegration()],
});
```

## Options

### `recordFilePaths`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ _Import name: `Sentry.functionToStringIntegration`_
This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

This integration allows the SDK to provide original functions and method names, even when those functions or methods are wrapped by our error or breadcrumb handlers.

```JavaScript
Sentry.init({
integrations: [Sentry.functionToStringIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ This integration is enabled by default when performance monitoring is enabled. I

The `genericPoolIntegration` adds instrumentation for the `generic-pool` library to capture spans using [`@opentelemetry/instrumentation-generic-pool`](https://www.npmjs.com/package/@opentelemetry/instrumentation-generic-pool).

```JavaScript
Sentry.init({
integrations: [Sentry.genericPoolIntegration()],
});
```

## Supported Versions

- `generic-pool`: `>=2.0.0 <4`
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ This integration is enabled by default. If you'd like to modify your default int

This integration attaches global handlers to capture uncaught exceptions and unhandled rejections. It captures errors and unhandled promise rejections by default.

```JavaScript
Sentry.init({
integrations: [Sentry.globalHandlersIntegration({ onerror: true, onunhandledrejection: true })],
});
```

## Options

### `onerror`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ _Import name: `Sentry.googleCloudGrpcIntegration`_
This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

Adds instrumentation for GRPC APIs on Google Cloud to automatically create spans.

```JavaScript
Sentry.init({
integrations: [Sentry.googleCloudGrpcIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ _Import name: `Sentry.googleCloudHttpIntegration`_
This integration is enabled by default. If you'd like to modify your default integrations, read [this](./../#modifying-default-integrations).

Adds instrumentation for RESTful APIs on Google Cloud to automatically create spans.

```JavaScript
Sentry.init({
integrations: [Sentry.googleCloudHttpIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ This integration is enabled by default when performance monitoring is enabled. I

The `graphqlIntegration` adds instrumentation for the `graphql` library to capture spans using [`@opentelemetry/instrumentation-graphql`](https://www.npmjs.com/package/@opentelemetry/instrumentation-graphql).

```JavaScript
Sentry.init({
integrations: [Sentry.graphqlIntegration()],
});
```

## Supported Versions

- `graphql`: `>=14.0.0 <17`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ This integration is enabled by default when performance monitoring is enabled. I

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

```JavaScript
Sentry.init({
integrations: [new Sentry.hapiIntegration()],
});
```

## Supported Versions

- Hapi: `>=17.0.0 <22`
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ The `httpIntegration` does two things:
1. It captures breadcrumbs for HTTP requests.
2. It captures spans for outgoing HTTP requests.

```JavaScript
Sentry.init({
integrations: [Sentry.httpIntegration()],
});
```

## Options

### `breadcrumbs`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ This integration is enabled by default. If you'd like to modify your default int

This integration attaches HTTP request information, such as URL, user-agent, referrer, and other headers, to the event.
It allows us to correctly catalog and tag events with specific OS, browser, and version information.

```JavaScript
Sentry.init({
integrations: [Sentry.httpContextIntegration()],
});
```
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ This integration is enabled by default when performance monitoring is enabled. I

The `kafkaIntegration` adds instrumentation for the `kafkajs` library to capture spans using [`@opentelemetry/instrumentation-kafkajs`](https://www.npmjs.com/package/@opentelemetry/instrumentation-kafkajs).

```JavaScript
Sentry.init({
integrations: [Sentry.kafkaIntegration()],
});
```

## Supported Versions

- `kafkajs`: `>=0.1.0 <3`
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Knex
description: "Adds instrumentation for Knex."
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.nuxt
- javascript.sveltekit
- javascript.remix
- javascript.astro
- javascript.bun
---

<Alert level="info">

This integration only works in the Node.js and Bun runtimes. Requires SDK version `8.38.0` or higher.

</Alert>

_Import name: `Sentry.knexIntegration`_

The `knexIntegration` adds instrumentation for the `knex` library to capture spans using [`@opentelemetry/instrumentation-knex`](https://www.npmjs.com/package/@opentelemetry/instrumentation-knex).

```javascript
Sentry.init({
integrations: [new Sentry.knexIntegration()],
});
```

## Supported Versions

- `dataloader`: `>=0.10.0 <4`
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ This integration is enabled by default when performance monitoring is enabled. I

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

```JavaScript
Sentry.init({
integrations: [new Sentry.koaIntegration()],
});
```

## Supported Versions

- `koa`: `^2.0.0`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ This integration is enabled by default. If you'd like to modify your default int

This integration allows you to configure linked errors. They'll be recursively read up to a specified limit, then lookup will be performed by a specific key. By default, the Sentry SDK sets the limit to five and the key used is `"cause"`.

```JavaScript
Sentry.init({
integrations: [Sentry.linkedErrorsIntegration()],
});
```

## Options

### `key`
Expand Down
Loading

0 comments on commit e303818

Please sign in to comment.