Monitoring Cloud Managed Databases - CHERTS/pgscv GitHub Wiki

Starting with pgSCV 0.10.0, it has become possible to discovery and monitoring Cloud Managed Databases.

Since version 0.13.0 you can add custom labels using target_labels parameter

Currently supported Cloud:

Yandex Managed Service for PostgreSQL

To automatically detect Yandex Managed Service for PostgreSQL clusters, you need to create a service account and create an authorized key in json format, save it to a file, for example /etc/pgscv_yandex.json:

{
  "id": "XXXXXXXX",
  "service_account_id": "XXXXXXXX",
  "created_at": "2024-XX-XXTXX:XX:XX.XXXXXXXZ",
  "key_algorithm": "RSA_2048",
  "public_key": "-----BEGIN PUBLIC KEY-----\nXXXXXXXX\n-----END PUBLIC KEY-----\n",
  "private_key": "PLEASE DO NOT REMOVE THIS LINE! Yandex.Cloud SA Key ID <XXXXX>\n-----BEGIN PRIVATE KEY-----\nXXXXXXXXXXXXX==\n-----END PRIVATE KEY-----\n"
}

Next you need to edit the pgSCV configuration, for example /etc/pgscv.yaml:

listen_address: 0.0.0.0:9890
skip_conn_error_mode: false
conn_timeout: 3
discovery:
  yandex_mdb:
    type: yandex-mdb
    config:
      - authorized_key: /etc/pgscv_yandex.json
        folder_id: "ZZZZZZ"
        user: "pgscv"
        password: "YYYYYY"
        #password_from_env: DB_PASSWORD
        refresh_interval: 5
        target_labels:
          - name: folder_id
            value: "ZZZZZZ"
          - name: __scrape_interval__
            value: 1m
        clusters:
          - name: ".*"
            db:
            exclude_name:
            exclude_db:
  • folder_id: specifies the identifier of the folder in which pgSCV will search for the PostgreSQL cluster;

  • user: specifies the PostgreSQL user login who has rights for monitoring;

  • password: specifies the PostgreSQL user password;

  • password_from_env: specifies the PostgreSQL password via the environment variable (DB_PASSWORD);

  • refresh_interval: specifies the interval for refreshing the cluster list information (in minutes);

  • target_labels: specifies the custom labels, since version 0.13.0

  • clusters: cluster discovery parameters:

    • name: regular expression to find clusters by name;
    • db: regular expression to search database in cluster;
    • exclude_name: regular expression to exclude cluster search by name;
    • exclude_db: regular expression to exclude a database from cluster search;
⚠️ **GitHub.com Fallback** ⚠️