---
title: "Get Postgres time-series metrics"
method: GET
path: "/v1/organizations/{organizationId}/postgres/{postgresId}/metrics"
tags: ["Postgres"]
---

# Get Postgres time-series metrics

`GET /v1/organizations/{organizationId}/postgres/{postgresId}/metrics`

## Request

- Base URL: `https://api.clickhouse.cloud`
- URL: `https://api.clickhouse.cloud/v1/organizations/{organizationId}/postgres/{postgresId}/metrics`
- Auth: HTTP basic

Returns bucketed time-series metrics for a PostgreSQL service over the requested window (CPU, memory, disk, network, connections, cache hit ratio, throughput, transactions, wait events, lock waits, and more). Use this to chart or analyze how a service behaved over time.

## Path parameters

- `organizationId` string, uuid, required
- `postgresId` string, uuid, required

## Query parameters

- `from_date` string, date-time, required
- `to_date` string, date-time, required
- `bucket_size_seconds` integer

## Response `200`

Successful response

- object
  - `status` number: HTTP status code.
  - `requestId` string, uuid: Unique id assigned to every request. UUIDv4
  - `result` PostgresMetrics
    - `metrics` PostgresMetric[], required: Available metrics, each with its bucketed time series.
      - `key` string, required: Stable metric identifier (for example cpu_usage, connection_count, cache_hit_ratio, active_sessions_by_wait).
      - `name` string, required: Human-readable metric name.
      - `unit` string, required: Unit of the metric values (for example %, IOPS, bytes/s, count).
      - `description` string, required: Human-readable description of what the metric measures.
      - `series` PostgresMetricSeries[], required: One series per label dimension of the metric.
        - `label` string, required: Distinguishing label for this series within the metric (for example a CPU mode, a database name, a wait event such as "Lock:relation", or "Reads").
        - `dataPoints` PostgresMetricDataPoint[], required: Time-ordered data points, one per bucket.
          - `timestamp` integer, required: Bucket start time as a Unix timestamp in seconds.
          - `value` number, required: Metric value for the bucket.

## Other responses

- `400`: The request cannot be processed due to a client error. Please verify your request parameters and try again.
- `500`: An internal server error has occurred. If this issue persists, please contact ClickHouse Cloud support for assistance.

---

[API](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud.md) - [All operations](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/clickhouse/apis/openapi-spec-for-clickhouse-cloud/revisions/eac345053548?raw)
