Frequently Asked Questions
It’s a metrics collector and visualization solution for PostgreSQL databases.
Just so! The software falls under the BSD 3-Clause Revised License so use it however you like – privately, commercially, and/or to make modifications.
There are two ways – the simplest way is to use the public Docker image, which literally takes a minute to get metrics gathering up and running. The other option is to do a custom setup, by compiling the metrics collector written in Go, and setting up or re-using the required external components: Grafana and InfluxDB.
Simplicity, and the fact that the user is in control and can change almost everything without programming. The philosophy behind the tool could also be expressed as getting 80% of the benefits of monitoring, with only 20% of the effort.
First of all, you need to decide if you wan’t to run a central PostgreSQL configuration database storing connection strings of monitored databases (this is how it works when using the Docker image), or if you want to work with configuration files, in so called “file based” mode. In the first case you can utilize the Web UI to insert the connection string to the to-be-monitored database with a couple of clicks (or via SQL directly). In the second case, you need to change a configuration YAML file on the monitoring server(s) where pgwatch is running. In both cases changes will become effective automatically.
Adding metrics is quite easy as metrics are gathered via normal SQL queries, usually involving PostgreSQL internal statistics collector views. In the default setup, just go to the Web UI “metrics” tab and insert a new metric by modifying the template query. Then this metric’s name must also be added to some monitored databases config, or to a preset config (collection of metrics).