> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ClickHouse Managed Postgres metrics reference

> Full list of metrics exposed by the ClickHouse Managed Postgres Prometheus endpoint

export const BetaBadge = ({link, galaxyTrack, galaxyEvent}) => {
  if (link) {
    return <a href={link} target="_blank" rel="noopener noreferrer" className="betaBadge" onClick={galaxyTrack && galaxyEvent ? galaxyOnClick(galaxyEvent) : undefined}>
                <span>Beta</span>
            </a>;
  }
  return <a href="https://clickhouse.com/docs/reference/settings/beta-and-experimental-features#beta-features" className="betaBadge">
            <span>Beta feature</span>
        </a>;
};

<BetaBadge link="https://clickhouse.com/cloud/postgres" galaxyTrack={true} galaxyEvent="docs.managed-postgres.monitoring-metrics-beta" />

This page lists every metric exposed by the
[ClickHouse Managed Postgres Prometheus endpoint](/products/managed-postgres/monitoring/prometheus).
For setup and authentication, see the [Prometheus endpoint] page.

<h2 id="common-labels">
  Common labels
</h2>

Every metric carries the following labels:

| Label | Description |
| - | - |
| `clickhouse_org` | Organization ID |
| `postgres_service` | Postgres service ID |
| `postgres_service_name` | Postgres service name |

Some metrics add a label for the dimension they break out (e.g.
`mode` on CPU metrics, `state` on connections, `database` on database
size). Those are listed alongside each metric.

<h2 id="information-metric">
  Information metric
</h2>

`PostgresServiceInfo` is a gauge that always equals `1` and carries the
service's current status and version on its labels. Use it to join
status onto other metrics or to alert on a service leaving the
`running` state.

| Metric | Type | Extra labels | Description |
| - | - | - | - |
| `PostgresServiceInfo` | gauge | `postgres_status`, `postgres_version` | One series per service; value is always `1`. |

`postgres_status` reports the current lifecycle state of the service
(for example `running`, `creating`, `stopped`). `postgres_version`
reports the major Postgres version (e.g. `17`, `18`).

<h2 id="capacity">
  Capacity
</h2>

Static limits provisioned for the service. These change only when the
service is resized.

| Metric | Type | Unit | Description |
| - | - | - | - |
| `PostgresServer_CPUCores` | gauge | cores | CPU cores allocated to the service. |
| `PostgresServer_MemoryLimitBytes` | gauge | bytes | Memory allocated to the service. |
| `PostgresServer_StorageLimitBytes` | gauge | bytes | Storage allocated to the service. |

<h2 id="resource-utilization">
  Resource utilization
</h2>

| Metric | Type | Extra labels | Description |
| - | - | - | - |
| `PostgresServer_CPUSeconds_Total` | counter | `mode` | CPU time consumed, broken out by mode: `user`, `system`, `iowait`, `softirq`, `steal`, `irq`, `nice`, `idle`. |
| `PostgresServer_MemoryUsedPercent` | gauge | | Memory in use, as a percentage of `PostgresServer_MemoryLimitBytes`. |
| `PostgresServer_MemoryCachePercent` | gauge | | Memory used by cache and buffers, as a percentage of total memory. |
| `PostgresServer_FilesystemUsedPercent` | gauge | | Filesystem space used, as a percentage of total storage. |

To compute CPU usage as a percentage, take the rate of
`PostgresServer_CPUSeconds_Total` over the modes you care about and
divide by `PostgresServer_CPUCores`.

<h2 id="io">
  Disk and network I/O
</h2>

| Metric | Type | Unit | Description |
| - | - | - | - |
| `PostgresServer_DiskReads_Total` | counter | ops | Disk read operations completed. |
| `PostgresServer_DiskWrites_Total` | counter | ops | Disk write operations completed. |
| `PostgresServer_NetworkReceiveBytes_Total` | counter | bytes | Bytes received over the network. |
| `PostgresServer_NetworkTransmitBytes_Total` | counter | bytes | Bytes transmitted over the network. |

<h2 id="database-activity">
  Database activity
</h2>

Cumulative counters since service start. Use `rate()` or `irate()` to
turn them into per-second values.

| Metric | Type | Description |
| - | - | - |
| `PostgresServer_TuplesFetched_Total` | counter | Rows fetched by queries. |
| `PostgresServer_TuplesInserted_Total` | counter | Rows inserted. |
| `PostgresServer_TuplesUpdated_Total` | counter | Rows updated. |
| `PostgresServer_TuplesDeleted_Total` | counter | Rows deleted. |
| `PostgresServer_TransactionsCommitted_Total` | counter | Transactions committed. |
| `PostgresServer_TransactionsRolledBack_Total` | counter | Transactions rolled back. |
| `PostgresServer_Deadlocks_Total` | counter | Deadlocks detected. |

<h2 id="query-performance">
  Query performance
</h2>

Counters from recorded Query Insights events, excluding `UTILITY` operations.

| Metric | Type | Unit | Description |
| - | - | - | - |
| `PostgresQuery_Calls_Total` | counter | events | Recorded query events. |
| `PostgresQuery_DurationMicroseconds_Total` | counter | microseconds | Total recorded query duration. |
| `PostgresQuery_ErrorEvents_Total` | counter | events | Recorded events with nonzero error severity, including warnings. |
| `PostgresQuery_FailureEvents_Total` | counter | events | Recorded events with severity `ERROR` or higher. |
| `PostgresQuery_Rows_Total` | counter | rows | Rows returned or affected by recorded queries. |
| `PostgresQuery_SharedBlocksHit_Total` | counter | blocks | Shared blocks hit by recorded queries. |
| `PostgresQuery_SharedBlocksRead_Total` | counter | blocks | Shared blocks read by recorded queries. |
| `PostgresQuery_WALBytes_Total` | counter | bytes | WAL bytes generated by recorded queries. |
| `PostgresQuery_SelectCalls_Total` | counter | events | Recorded `SELECT` events. |
| `PostgresQuery_InsertCalls_Total` | counter | events | Recorded `INSERT` events. |
| `PostgresQuery_UpdateCalls_Total` | counter | events | Recorded `UPDATE` events. |
| `PostgresQuery_DeleteCalls_Total` | counter | events | Recorded `DELETE` events. |
| `PostgresQuery_MergeCalls_Total` | counter | events | Recorded `MERGE` events. |
| `PostgresQuery_OtherCalls_Total` | counter | events | Recorded events outside `SELECT`, `INSERT`, `UPDATE`, `DELETE`, and `MERGE`. |

<h2 id="connections-cache-size">
  Connections, cache, and database size
</h2>

| Metric | Type | Extra labels | Description |
| - | - | - | - |
| `PostgresServer_ActiveConnections` | gauge | `state` | Connections by state (e.g. `active`, `idle`). |
| `PostgresServer_CacheHitRatio` | gauge | | Buffer cache hit ratio: blocks served from cache vs. total blocks accessed, as a percentage. |
| `PostgresServer_DatabaseSizeBytes` | gauge | `database` | Disk size of each database, in bytes. Includes the `postgres` default and any user-created databases. |

<h2 id="related">
  Related pages
</h2>

* [Prometheus endpoint] — setup, authentication, and scraping
* [Dashboard](/products/managed-postgres/monitoring/dashboard) — built-in cloud console charts
* [OpenAPI guide](/products/managed-postgres/openapi) — API key creation
  and lookup of organization and service IDs

[Prometheus endpoint]: /products/managed-postgres/monitoring/prometheus
