Skip to content

Commit 69fc2ca

Browse files
committed
enhance: coderabbit comments
1 parent dae2310 commit 69fc2ca

File tree

1 file changed

+21
-4
lines changed
  • content/200-orm/200-prisma-client/600-observability-and-logging

1 file changed

+21
-4
lines changed

content/200-orm/200-prisma-client/600-observability-and-logging/240-metrics.mdx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ If you want an even more detailed insight into your Prisma Client's performance,
1919

2020
The `metrics` preview feature has been **deprecated** as of [Prisma ORM v6.14.0](https://github.com/prisma/prisma/releases/tag/6.14.0) and will be removed in Prisma ORM v7.
2121

22+
**The `metrics` preview feature is only available in Prisma ORM versions ≤6.13.x.** If you are using Prisma ORM v6.14.0 or later, the `$metrics` API is no longer available.
23+
2224
The feature is not supported when using Prisma ORM with the [query compiler architecture](/orm/prisma-client/setup-and-configuration/no-rust-engine) (setting `engineType` to 'client' in the `generator` block of your `schema.prisma` file).
2325

2426
Metrics were originally introduced to provide insights into query and connection behavior. With the changes in the new [query compiler architecture](/orm/prisma-client/setup-and-configuration/no-rust-engine), these values no longer reflect the system reliably. Because of this, we are not continuing support for this feature.
@@ -61,18 +63,33 @@ You can [add global labels to your metrics data](#global-labels) to help you gro
6163

6264
## Prerequisites
6365

66+
:::warning[Version compatibility]
67+
68+
The `metrics` preview feature is **only available in Prisma ORM versions ≤6.13.x**. It has been removed in v6.14.0 and later versions.
69+
70+
:::
71+
6472
To use Prisma Client metrics, you must do the following:
6573

66-
1. [Install the appropriate dependencies](#1-install-up-to-date-prisma-orm-dependencies).
74+
1. [Install compatible Prisma ORM dependencies](#1-install-compatible-prisma-orm-dependencies).
6775
1. [Enable the `metrics` feature flag in your Prisma schema file](#2-enable-the-feature-flag-in-the-prisma-schema-file).
6876

6977
### 1. Install up-to-date Prisma ORM dependencies
7078

71-
Use version `3.15.0` or higher of the `prisma` and `@prisma/client` npm packages.
79+
You must use a version between `3.15.0` and `6.13.x` of the `prisma` and `@prisma/client` npm packages.
80+
81+
**Install a compatible version:**
82+
83+
```terminal
84+
npm install [email protected] --save-dev
85+
npm install @prisma/[email protected]
86+
```
87+
88+
**Or use a version range that stays within the compatible range:**
7289

7390
```terminal
74-
npm install prisma@latest --save-dev
75-
npm install @prisma/client@latest
91+
npm install prisma@">=3.15.0 <6.14.0" --save-dev
92+
npm install @prisma/client@">=3.15.0 <6.14.0"
7693
```
7794

7895
### 2. Enable the feature flag in the Prisma schema file

0 commit comments

Comments
 (0)