@@ -6,10 +6,10 @@ This chapter describes how to set up pgwatch manually, giving you full control o
66
77## Overview
88
9- pgwatch consists of three main components:
9+ pgwatch consists of four main components:
1010
11111 . ** Metrics collector** - The pgwatch daemon that gathers metrics from your databases
12- 2 . ** Configuration store** : - Where you define which databases to monitor and their settings
12+ 2 . ** Configuration store** - Where you define which databases to monitor and their settings
1313 - PostgreSQL database or YAML file
14143 . ** Metrics storage** - Where collected metrics are stored
1515 - PostgreSQL, Prometheus, custom gRPC server, or JSON
@@ -26,11 +26,13 @@ pgwatch consists of three main components:
2626Choose how you want to manage your monitoring configurations:
2727
28281 . ** PostgreSQL Database**
29- - store monitored databases and metrics configs in a PostgreSQL database.
30- - Use the pgwatch web UI or REST API to manage it.
29+ - Store monitored databases and metrics configs in a PostgreSQL database.
3130
32312 . ** YAML File**
33- - store monitored databases and metrics configs in a YAML file.
32+ - Store monitored databases and metrics configs in a YAML file.
33+
34+ !!! info
35+ You can use pgwatch's built-in web UI or REST API to manage both configuration stores.
3436
3537## Installation Steps
3638
@@ -96,18 +98,18 @@ Create `/etc/pgwatch/sources.yaml`:
9698 is_enabled: true
9799 group: default
98100
99- - name: the_second_monitored_database
100- . ...
101+ # - name: the_second_monitored_database
102+ # ...
101103` ` `
102104
103- ** sources configuration options** :
105+ ** Sources configuration options** :
104106
105107| Option | Description | Example |
106108| --------| -------------| ---------|
107109| ` name` | Unique name for this source | ` mydb` |
108- | ` kind` | Database type: ` postgres` , ` postgres-continuous-discovery` , ` pgbouncer` , ` pgpool` , ` patroni` | ` postgres` |
109- | ` conn_str` | PostgreSQL connection string | ` postgresql://user:pass@host/db` |
110- | ` preset_metrics` | Preset to use: ` minimal` , ` basic` , ` exhaustive` , ` unprivileged` | ` exhaustive` |
110+ | ` kind` | Source type: ` postgres` , ` postgres-continuous-discovery` , ` pgbouncer` , ` pgpool` , ` patroni` | ` postgres` |
111+ | ` conn_str` | PostgreSQL, etcd, Consul, or ZooKeepr connection string | ` postgresql://user:pass@host/db` or ` etcd://host1:1234,host2:1344/scope/member ` |
112+ | ` preset_metrics` | Preset to use: ` minimal` , ` basic` , ` exhaustive` , ` unprivileged` , etc. | ` exhaustive` |
111113| ` custom_metrics` | Custom metrics with intervals (seconds) | ` { backends: 300 }` |
112114| ` include_pattern` | Regex to filter databases (for continuous discovery) | ` ^mydb_` |
113115| ` exclude_pattern` | Regex to exclude databases (for continuous discovery) | ` ^test_` |
@@ -147,8 +149,8 @@ GRANT pg_monitor TO pgwatch;
147149` ` ` bash
148150pgwatch \
149151 --sources=postgresql://pgwatch:your_password@localhost:5432/pgwatch \
150- # or --sources=/etc/pgwatch/sources.yaml \
151152 --sink=postgresql://pgwatch:your_password@localhost:5432/pgwatch_metrics
153+ # or use --sources=/etc/pgwatch/sources.yaml
152154` ` `
153155
154156Wait a few seconds to see the success of initial metrics fetches.
@@ -199,7 +201,7 @@ VALUES ('mydb', 'postgresql://pgwatch:your_password@localhost:5432/mydb', 'exhau
1992012. Import the default postgres and/or prometheus dashboards from the [` grafana/` ](https://github.com/cybertec-postgresql/pgwatch/tree/master/grafana) folder into your Grafana instance.
200202
201203!!! note
202- The default builtin dashboards expect ` postgres/prometheus` data sources with uids ` pgwatch-metrics/pgwatch-prometheus` by default.
204+ The default built-in dashboards expect ` postgres/prometheus` data sources with uids ` pgwatch-metrics/pgwatch-prometheus` by default.
203205
204206# # Next Steps
205207
0 commit comments