diff --git a/src/platforms/node/common/performance/database/opt-in.mdx b/src/platforms/node/common/performance/database/opt-in.mdx index 2267fe64f54d5..ba82e4d6fae2a 100644 --- a/src/platforms/node/common/performance/database/opt-in.mdx +++ b/src/platforms/node/common/performance/database/opt-in.mdx @@ -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`)_ @@ -39,8 +39,8 @@ 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, @@ -48,7 +48,7 @@ Sentry.init({ }); ``` -## Apollo Server Integration +## Apollo Server Integration _(Available from `7.2.0`)_ @@ -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 }); +```