# @prisma/instrumentation

> OpenTelemetry compliant instrumentation for Prisma Client

Latest version **7.10.0** (published 2026-08-25) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @prisma/instrumentation
pnpm add @prisma/instrumentation
yarn add @prisma/instrumentation
bun add @prisma/instrumentation
```

## Health

**Score 80/100 (A)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 7.10.0 |
| Published | 2026-08-25 |
| First published | 2022-07-14 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 38.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 47674 |
| Maintainers | prismabot, aqrln, wmadden-prisma, rtbenfield |
| Keywords | prisma, instrumentation, opentelemetry, otel |

## Links

- npm: https://www.npmjs.com/package/@prisma/instrumentation
- Repository: https://github.com/prisma/prisma
- Homepage: https://www.prisma.io
- Issues: https://github.com/prisma/prisma/issues
- npm.io page: https://npm.io/package/@prisma/instrumentation

## Dependencies (1)

- [@opentelemetry/instrumentation](https://npm.io/package/@opentelemetry/instrumentation.md) ^0.207.0

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 7.10.0 (latest) — 2026-08-25
- 8.1.0-dev.7 (dev) — 2026-09-16
- 7.10.0-integration-fix-prisma-publish-token.1 (integration) — 2026-08-17
- 7.9.1-dev.1 (patch-dev) — 2026-07-27
- 6.19.3 (prev) — 2026-04-01
- 8.1.0-dev.6 — 2026-09-01
- 8.1.0-dev.5 — 2026-09-01
- 8.1.0-dev.4 — 2026-09-01
- 8.1.0-dev.3 — 2026-09-01
- 8.1.0-dev.2 — 2026-08-27
- 8.1.0-dev.1 — 2026-08-25
- 7.10.0-dev.58 — 2026-08-17
- 7.10.0-integration-prisma7-project-closeout.10 — 2026-08-17
- 7.10.0-dev.57 — 2026-08-14
- 7.10.0-integration-prisma7-project-closeout.9 — 2026-08-13
- … 6067 more at https://npm.io/package/@prisma/instrumentation/versions

## README

# @prisma/instrumentation

[![npm version](https://img.shields.io/npm/v/@prisma/instrumentation.svg?style=flat)](https://www.npmjs.com/package/@prisma/instrumentation) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/prisma/prisma/blob/main/CONTRIBUTING.md) [![GitHub license](https://img.shields.io/badge/license-Apache%202-blue)](https://github.com/prisma/prisma/blob/main/LICENSE) [![Discord](https://img.shields.io/discord/937751382725886062?label=Discord)](https://pris.ly/discord)

[OTEL - OpenTelemetry](https://opentelemetry.io/) compliant instrumentation for Prisma Client.

## Installing

```
$ npm install @prisma/instrumentation
```

## Usage

```ts
import { registerInstrumentations } from '@opentelemetry/instrumentation'
import { PrismaInstrumentation } from '@prisma/instrumentation'

registerInstrumentations({
  instrumentations: [new PrismaInstrumentation()],
})
```

## Jaeger

Exporting traces to [Jaeger Tracing](https://jaegertracing.io).

```ts
import { context, trace } from '@opentelemetry/api'
import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks'
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'
import { registerInstrumentations } from '@opentelemetry/instrumentation'
import { resourceFromAttributes } from '@opentelemetry/resources'
import { BasicTracerProvider, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base'
import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION } from '@opentelemetry/semantic-conventions'
import { PrismaInstrumentation } from '@prisma/instrumentation'

import { PrismaClient } from '.prisma/client'

const contextManager = new AsyncLocalStorageContextManager().enable()

context.setGlobalContextManager(contextManager)

const otlpTraceExporter = new OTLPTraceExporter()

const provider = new BasicTracerProvider({
  resource: resourceFromAttributes({
    [ATTR_SERVICE_NAME]: 'test-tracing-service',
    [ATTR_SERVICE_VERSION]: '1.0.0',
  }),
  spanProcessors: [new SimpleSpanProcessor(otlpTraceExporter)],
})

trace.setGlobalTracerProvider(provider)

registerInstrumentations({
  instrumentations: [new PrismaInstrumentation()],
})

async function main() {
  const prisma = new PrismaClient()

  const email = `user.${Date.now()}@prisma.io`

  await prisma.user.create({
    data: {
      email: email,
    },
  })
}

main()
```

---
_Source: https://npm.io/package/@prisma/instrumentation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
