Configuring multiple databases Innovation Release

To leverage full observability capabilities, we recommend deploying one agent per host machine with self-managed database clusters. Then, you can configure this single agent to connect to multiple database clusters on the same host.

Configuring multiple clusters and nodes

The agent uses the clusters section to define all monitored database clusters on the host.

  • Cluster entries: Each item in the clusters list represents a single database cluster (for example, a primary database and its replicas, or a single-node instance).

  • Nodes entries: Within each cluster, the nodes list specifies the individual database instances that belong to that cluster.

    For a single-instance database, the nodes list will contain one entry.

    For multi-node clusters (like a primary/replica setup), the nodes list can contain an entry for every instance.

clusters:
  - resource_id: selfmanaged_postgres_1
    name: "<instance_name1>"
    manager: "other"
    nodes:
      - resource_id: <node_resource_id_1.1>
        disable_host_association: false
        dsn: "$DSN1.1"
        ...
      - resource_id: <node_resource_id_1.2>
        disable_host_association: false
        dsn: "$DSN1.2"
        ...
  - resource_id: selfmanaged_postgres_2
    name: "<instance_name2>"
    manager: "other"
    nodes:
      - resource_id: <node_resource_id_2.1>
        disable_host_association: true
        dsn: "$DSN2.1"
    ...

While a single agent instance can track databases across different host machines, that setup provides limited host-level metrics for databases not on the same machine as the agent.

Note

Currently, monitoring data is collected only from the database specified in the DSN. For example, if you specify the postgres database, then the database size reflects only the size of this database. To monitor other databases in the same Postgres instance, you must specify them individually the same way you specify multiple instances.