# Prisma | Sentry for Google Cloud Functions

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

*Import name: `Sentry.prismaIntegration`*

Sentry supports tracing [Prisma ORM](https://www.prisma.io/) queries with the Prisma integration.

The Prisma Integrations creates a spans for each query and reports to Sentry with relevant details inside the`description` if available.

This integration is enabled by default when using Prisma version 6 or higher. When using Prisma version 5 this integration requires additional setup, which you can read about below. If you'd like to learn how to modify your default integrations, visit the docs on [Modifying Default Integrations](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/integrations.md#modifying-default-integrations).

## [Prisma Version >=6](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/integrations/prisma.md#prisma-version-6)

To use the integration with Prisma version >=6, add the `prismaIntegration` to your Sentry initialization as follows:

```javascript
Sentry.init({
  tracesSampleRate: 1.0,

  integrations: [Sentry.prismaIntegration()],

});
```

## [Prisma Version 5](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/integrations/prisma.md#prisma-version-5)

To configure the integration for Prisma version 5, first add the `tracing` feature flag to the `generator` block of your Prisma schema:

`schema.prisma`

```txt
generator client {
  provider        = "prisma-client-js"

  previewFeatures = ["tracing"]

}
```

For Prisma version 5 compatibility you must pass a specific version of the Prisma instrumentation to the Sentry Prisma integration. Add the `prismaIntegration` to your Sentry initialization as follows:

```javascript
import { PrismaInstrumentation } from "@prisma/instrumentation";


Sentry.init({
  tracesSampleRate: 1.0,
  integrations: [

    Sentry.prismaIntegration({
      // Override the default instrumentation that Sentry uses
      prismaInstrumentation: new PrismaInstrumentation(),
    }),

  ],
});
```

## [Options](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/integrations/prisma.md#options)

### [`prismaInstrumentation`](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/integrations/prisma.md#prismainstrumentation)

*Type: `Instrumentation`* (An OpenTelemetry type)

Overrides the instrumentation used by the Sentry SDK with the passed in instrumentation instance.

## [Supported Versions](https://docs.sentry.io/platforms/javascript/guides/gcp-functions/configuration/integrations/prisma.md#supported-versions)

* `prisma`: `>=5`
