Prometheus Integration
Managed Postgres exposes two Prometheus-compatible metrics endpoints on the ClickHouse Cloud API:
| Endpoint | Path | Returns |
|---|---|---|
| Org | /v1/organizations/{orgId}/postgres/prometheus | Metrics for every Managed Postgres service in the org |
| Instance | /v1/organizations/{orgId}/postgres/{pgId}/prometheus | Metrics for a single service |
The org-level endpoint returns metrics for up to 100 services. If your organization has more than 100 Managed Postgres services, contact support.
Authentication
The endpoint uses the same API keys as the rest of the OpenAPI; see the OpenAPI guide for how to create them and look up your organization and service IDs.
Scraping all services in an organization
Scraping a single service
Sample response
For the full list of metrics and their meanings, see the metrics reference.
Configuring Prometheus
This config scrapes the org-level endpoint every 60 seconds:
The endpoint refreshes metrics once per minute. Scraping faster than
60s duplicates samples and produces a stair-step pattern on gauge
panels.
Set honor_labels: true so the postgres_service and
postgres_service_name labels from the endpoint are preserved instead
of being overwritten by Prometheus.
To scrape a single service, append /<PG_ID> to the metrics_path.
Pre-built Grafana dashboard
A ready-made Grafana dashboard visualizes every metric the endpoint exposes — a sortable services table, CPU and memory utilization, disk usage with threshold alerts, connections by state, transactions and rollback ratio, tuple activity, I/O, per-database storage, and deadlocks.
Importing the dashboard
Download the dashboard JSON
Open the import flow in Grafana
Go to Dashboards → New → Import. Upload the JSON file or paste its contents.
Pick your Prometheus datasource
When prompted for the DS_PROMETHEUS input, select the Prometheus datasource scraping the endpoint configured in the previous section.
For provisioned Grafana deployments, drop the JSON into your
dashboards provisioning path. Grafana matches the ${DS_PROMETHEUS}
reference to a Prometheus datasource available in the instance.
Template variables
The dashboard exposes three variables:
- Data source — the Prometheus datasource backing the dashboard.
- Service — multi-select filter over
postgres_service_name. Defaults to All; pick one or more services to scope every panel. - Scrape interval — hidden constant, defaults to
60s. Drives Grafana's$__rate_intervalcalculation. Change this value in the JSON if your scrape interval differs.
Filter to a single service for drill-in
Several panels are designed for drill-in once you filter to a single
service via the Service variable. The CPU by mode panel, for
example, stacks user, system, iowait, steal, and other CPU
modes so you can tell whether a spike is application code, kernel
work, disk waits, or hypervisor contention.
Integrating with Grafana and Datadog
The endpoint follows the same shape as the ClickHouse Prometheus
endpoint, so the Grafana Cloud, Grafana
Alloy, and Datadog OpenMetrics agent configurations described there
apply here too. Point metrics_path at the Managed Postgres org or
instance path instead of the ClickHouse one.