Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions src/platforms/node/common/performance/database/opt-in.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ Prisma integration creates a `db.prisma` span for each query and reports to Sent
For example:

```javascript
import { PrismaClient } from '@prisma/client';
import * as Sentry from '@sentry/node';
import * as Tracing from '@sentry/tracing';
import { PrismaClient } from "@prisma/client";
import * as Sentry from "@sentry/node";
import * as Tracing from "@sentry/tracing";

const client = new PrismaClient();

Sentry.init({
dsn: ___PUBLIC_DSN___,
release: '1.0',
release: "1.0",
tracesSampleRate: 1.0,
integrations: [new Tracing.Integrations.Prisma({ client })],
});
```

## GraphQL Integration
## GraphQL Integration

_(Available from `7.2.0`)_

Expand All @@ -39,16 +39,16 @@ If you use Apollo Server to define your GraphQL resolvers, Sentry's Apollo Serve
For example:

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

Sentry.init({
tracesSampleRate: 1.0,
integrations: [new Tracing.Integrations.GraphQL()],
});
```

## Apollo Server Integration
## Apollo Server Integration

_(Available from `7.2.0`)_

Expand All @@ -57,11 +57,17 @@ Sentry provides an opt-in tracing integration for [Apollo resolvers](https://www
The Apollo integration creates `db.graphql.apollo` spans for each resolver and reports to Sentry with a `description` containing the resolver's name and group:

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

Sentry.init({
tracesSampleRate: 1.0,
integrations: [new Tracing.Integrations.Apollo()],
});
```

If you use `NestJs`, initialize the integration with the `useNestjs` option

```javascript
new Tracing.Integrations.Apollo({ useNestjs: true });
```