> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-postgresql-tls-support.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Postgres time-series metrics

> **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future. <br /><br /> Returns bucketed time-series metrics for a PostgreSQL service over the requested window (CPU, memory, disk, network, connections, cache hit ratio, throughput, transactions, and more). Use this to chart or analyze how a service behaved over time.

<span data-endpoint-badge="Beta"><Badge color="blue">Beta</Badge></span>

**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future. <br /><br /> Returns bucketed time-series metrics for a PostgreSQL service over the requested window (CPU, memory, disk, network, connections, cache hit ratio, throughput, transactions, and more). Use this to chart or analyze how a service behaved over time.


## OpenAPI

````yaml _specs/cloud-openapi.json GET /v1/organizations/{organizationId}/postgres/{postgresId}/metrics
openapi: 3.1.2
info:
  title: OpenAPI spec for ClickHouse Cloud
  version: '1.0'
  contact:
    name: ClickHouse Support
    url: >-
      https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-910487
    email: support@clickhouse.com
servers:
  - url: https://api.clickhouse.cloud
security:
  - basicAuth: []
tags:
  - name: Organization
  - name: User management
  - name: Billing
  - name: Role Management
  - name: Service
  - name: Backup
  - name: OpenAPI
  - name: Prometheus
  - name: ClickPipes
  - name: ClickStack
  - name: Postgres
paths:
  /v1/organizations/{organizationId}/postgres/{postgresId}/metrics:
    get:
      tags:
        - Postgres
      summary: Get Postgres time-series metrics
      description: >-
        **This endpoint is in beta.** API contract is stable, and no breaking
        changes are expected in the future. <br /><br /> Returns bucketed
        time-series metrics for a PostgreSQL service over the requested window
        (CPU, memory, disk, network, connections, cache hit ratio, throughput,
        transactions, and more). Use this to chart or analyze how a service
        behaved over time.
      operationId: postgresInstanceMetricsGet
      parameters:
        - in: path
          name: organizationId
          description: ID of the organization that owns the Postgres service.
          required: true
          schema:
            type: string
            format: uuid
        - in: path
          name: postgresId
          description: ID of the Postgres service.
          required: true
          schema:
            type: string
            format: uuid
        - in: query
          name: from_date
          description: Inclusive start of the time window (RFC 3339 date-time).
          schema:
            type: string
            format: date-time
          required: true
        - in: query
          name: to_date
          description: Exclusive end of the time window (RFC 3339 date-time).
          schema:
            type: string
            format: date-time
          required: true
        - in: query
          name: bucket_size_seconds
          description: >-
            Time-series bucket size in seconds. When omitted, a bucket size is
            derived from the requested window. Requests are capped at 250 data
            points.
          schema:
            type: integer
            minimum: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 200
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
                  result:
                    $ref: '#/components/schemas/PostgresMetrics'
        '400':
          description: >-
            The request cannot be processed due to a client error. Please verify
            your request parameters and try again.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 400
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
        '500':
          description: >-
            An internal server error has occurred. If this issue persists,
            please contact ClickHouse Cloud support for assistance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 500
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
components:
  schemas:
    PostgresMetrics:
      properties:
        metrics:
          type: array
          description: Available metrics, each with its bucketed time series.
          items:
            $ref: '#/components/schemas/PostgresMetric'
      required:
        - metrics
    PostgresMetric:
      properties:
        key:
          description: >-
            Stable metric identifier (for example cpu_usage, connection_count,
            cache_hit_ratio).
          type: string
        name:
          description: Human-readable metric name.
          type: string
        unit:
          description: Unit of the metric values (for example %, IOPS, bytes/s, count).
          type: string
        description:
          description: Human-readable description of what the metric measures.
          type: string
        series:
          type: array
          description: One series per label dimension of the metric.
          items:
            $ref: '#/components/schemas/PostgresMetricSeries'
      required:
        - key
        - name
        - unit
        - description
        - series
    PostgresMetricSeries:
      properties:
        label:
          description: >-
            Distinguishing label for this series within the metric (for example
            a CPU mode, a database name, or "Reads").
          type: string
        dataPoints:
          type: array
          description: Time-ordered data points, one per bucket.
          items:
            $ref: '#/components/schemas/PostgresMetricDataPoint'
      required:
        - label
        - dataPoints
    PostgresMetricDataPoint:
      properties:
        timestamp:
          description: Bucket start time as a Unix timestamp in seconds.
          type: integer
        value:
          description: Metric value for the bucket.
          type: number
      required:
        - timestamp
        - value
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Use key ID and key secret obtained in ClickHouse Cloud console:
        https://clickhouse.com/docs/cloud/manage/openapi

````