Skip to content

Conversation

@mhartington
Copy link
Contributor

@mhartington mhartington commented Nov 11, 2025

Summary by CodeRabbit

  • Documentation
    • Removed deprecation notice and comprehensive guidance for Prisma Client metrics (unavailable in v6.14+)
    • Updated connection pool documentation to reference logging and built-in APIs instead of metrics
    • Removed metrics from API reference and preview features list
    • Simplified observability documentation references and FAQ guidance on operation estimation

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 11, 2025

Walkthrough

This pull request removes Prisma Client's metrics feature documentation across multiple pages. The metrics documentation page is deleted entirely, references to the metrics API are removed from reference and guide pages, code examples are updated to use counter patterns instead of metrics implementations, and related feature entries are removed from preview feature listings.

Changes

Cohort / File(s) Summary
Metrics documentation removal
content/200-orm/200-prisma-client/600-observability-and-logging/240-metrics.mdx
Entire documentation page for Prisma Client metrics removed, including deprecation notice (v6.14.0), metric types (counters, gauges, histograms), setup instructions, JSON/Prometheus format examples, and StatsD/OpenTelemetry integration guidance.
API reference cleanup
content/200-orm/500-reference/050-prisma-client-reference.mdx
Removed $metrics section from Prisma Client API reference, including $metrics.json() and $metrics.prometheus() method documentation.
Observability documentation updates
content/200-orm/200-prisma-client/600-observability-and-logging/250-opentelemetry-tracing.mdx
Removed reference to aggregated metrics from information block; adjusted formatting around code fence.
Feature matrix updates
content/200-orm/500-reference/500-preview-features/050-client-preview-features.mdx
Removed metrics preview feature row from table; reordered remaining preview feature rows.
Client implementation examples
content/200-orm/200-prisma-client/300-client-extensions/110-client.mdx, content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx
Updated code examples to replace metric-based implementations with counter pattern; changed "logging and metrics" reference to "logging and built-in APIs provided by the Prisma Postgres Driver."
Comparison and guidance simplification
content/200-orm/800-more/400-comparisons/04-prisma-and-drizzle.mdx, content/250-postgres/1200-more/1000-faq.mdx
Removed descriptive paragraph about Prisma's built-in metrics features in Observability section; simplified Prometheus metrics guidance in FAQ.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

The changes follow a consistent pattern of removing or replacing deprecated metrics references across documentation files. The primary effort involves verifying:

  • Complete removal of metrics mentions across all affected files
  • Code example updates correctly reflect the counter-based alternative pattern
  • No broken cross-references remain after metrics documentation removal

Possibly related PRs

  • feat: add deprecation warning for metrics #7151: Adds deprecation warning and compatibility notes to the metrics documentation page, while this PR removes the entire metrics documentation—representing different approaches to handling the metrics feature deprecation (v6.14.0+).

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs(metrics): remove metrics API' directly and clearly summarizes the main objective of the changeset: removing documentation and references to the Prisma metrics API across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@github-actions
Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

/orm/prisma-client/observability-and-logging/metrics /docs/##( TODO: Path of page that replaces deleted page )##

@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes to avoid unnecessary requests, and speed up consecutive runs.

📊 Results Overview

Status Count
🔍 Total 2384
✅ Successful 2109
⏳ Timeouts 0
🔀 Redirected 253
👻 Excluded 21
❓ Unknown 0
🚫 Errors 0
⛔ Unsupported 1

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx (1)

89-89: Hyphenate compound adjective.

Change "built in APIs" to "built-in APIs" to follow standard English grammar for compound adjectives. As per coding guidelines, hyphens join compound modifiers that precede a noun.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3bf085d and 1b1cf8a.

📒 Files selected for processing (8)
  • content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx (1 hunks)
  • content/200-orm/200-prisma-client/300-client-extensions/110-client.mdx (1 hunks)
  • content/200-orm/200-prisma-client/600-observability-and-logging/240-metrics.mdx (0 hunks)
  • content/200-orm/200-prisma-client/600-observability-and-logging/250-opentelemetry-tracing.mdx (2 hunks)
  • content/200-orm/500-reference/050-prisma-client-reference.mdx (0 hunks)
  • content/200-orm/500-reference/500-preview-features/050-client-preview-features.mdx (1 hunks)
  • content/200-orm/800-more/400-comparisons/04-prisma-and-drizzle.mdx (0 hunks)
  • content/250-postgres/1200-more/1000-faq.mdx (1 hunks)
💤 Files with no reviewable changes (3)
  • content/200-orm/800-more/400-comparisons/04-prisma-and-drizzle.mdx
  • content/200-orm/200-prisma-client/600-observability-and-logging/240-metrics.mdx
  • content/200-orm/500-reference/050-prisma-client-reference.mdx
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-11T09:40:55.237Z
Learnt from: ankur-arch
Repo: prisma/docs PR: 7066
File: content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx:8-22
Timestamp: 2025-08-11T09:40:55.237Z
Learning: When the queryCompiler preview feature is enabled in Prisma ORM (v6.7.0+), it does not require Rust engines for CLI tools like `prisma migrate` or `prisma db pull`. The previous understanding that CLI tools would still need Rust binaries even with queryCompiler enabled is incorrect.

Applied to files:

  • content/200-orm/500-reference/500-preview-features/050-client-preview-features.mdx
📚 Learning: 2025-10-09T21:32:50.340Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7167
File: content/900-ai/prompts/astro.mdx:84-84
Timestamp: 2025-10-09T21:32:50.340Z
Learning: The `npx prisma init` command supports the following flags: `--db` (shorthand for `--datasource-provider prisma+postgres`), `--output` (specifies output location for generated client), `--generator-provider` (defines the generator provider), `--datasource-provider`, `--url`, `--preview-feature`, and `--with-model`. These are documented valid CLI options for Prisma init command.

Applied to files:

  • content/200-orm/500-reference/500-preview-features/050-client-preview-features.mdx
🪛 LanguageTool
content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx

[grammar] ~89-~89: Use a hyphen to join words.
Context: ...rvability-and-logging/logging) and built in APIs provided by the Prisma Postgres ...

(QB_NEW_EN_HYPHEN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: runner / linkspector
  • GitHub Check: Check internal links
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (6)
content/200-orm/200-prisma-client/600-observability-and-logging/250-opentelemetry-tracing.mdx (1)

10-14: Clean refinement of the info block.

The info block now focuses exclusively on tracing's operation-level insights, removing the competing reference to aggregated metrics. This improves clarity by keeping the message laser-focused on what the page covers.

content/200-orm/200-prisma-client/000-setup-and-configuration/050-databases-connections/115-connection-pool.mdx (1)

87-89: Content update appropriately redirects users to available APIs.

Shifting the documentation focus from metrics to "built-in APIs provided by the Prisma Postgres Driver" aligns with the PR's removal of metrics and properly guides users toward the actual observability mechanisms available in the connection pool section.

content/200-orm/500-reference/500-preview-features/050-client-preview-features.mdx (1)

15-23: Clean removal of metrics from active preview features.

The metrics preview feature row is removed and the table is reordered with no gaps or broken references. The remaining features are properly aligned with their release versions and feedback channels.

content/200-orm/200-prisma-client/300-client-extensions/110-client.mdx (2)

37-37: Updated description matches implementation.

The description now accurately reflects that $totalQueries returns the number of queries executed, aligning with the new counter-based implementation.


39-56: Well-designed migration pattern from metrics to simple counter.

The example elegantly demonstrates how users can replicate operation counting without the metrics API. Using a module-level counter and a query extension hook is:

  • Straightforward and transparent
  • Follows the extension pattern already shown for $log
  • Provides a clear model for users to adapt to their own observability needs

The code is syntactically correct and the pattern is sound.

content/250-postgres/1200-more/1000-faq.mdx (1)

98-100: Appropriate simplification of operation-counting guidance.

The FAQ answer now provides general guidance on using APM tools like Prometheus, removing the metrics-specific walkthrough. This aligns with the metrics removal and respects that users have multiple observability strategies available—from the counter pattern shown in the client extensions guide to external APM integrations.

@cloudflare-workers-and-pages
Copy link

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1b1cf8a
Status: ✅  Deploy successful!
Preview URL: https://b1b9128c.docs-51g.pages.dev
Branch Preview URL: https://metrics-removal-v2.docs-51g.pages.dev

View logs

@mhartington mhartington requested a review from a team November 11, 2025 18:23
#### Viewing the connection pool size

The number of connections Prisma Client uses can be viewed using [logging](/orm/prisma-client/observability-and-logging/logging) and [metrics](/orm/prisma-client/observability-and-logging/metrics).
The number of connections Prisma Client uses can be viewed using [logging](/orm/prisma-client/observability-and-logging/logging) and built in APIs provided by the Prisma Postgres Driver.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it just the normal PG driver? Do you mean here the driver adapter, or the Prisma ?

It sounds like the former, that it's a driver just for our PPg, and perhaps that's not what you mean 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we adding redirects for deleted pages? Have you guys discussed adding mentions that the feature was removed in version 7 instead of completely removing the page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants