Now that we have discussed how to collect operating system-level metrics using node_exporter in the previous recipe, we shall discuss how we can collect PostgreSQL metrics using postgres_exporter in this recipe. postgres_exporter has to be installed on the PostgreSQL server.
Getting ready
In order to expose PostgreSQL metrics using postgres_exporter, we should have a database user that is able to connect to the target database being used by the exporter in the connection string. Additionally, the port using which the metrics are visible should be open for the Prometheus data source to access it.
The following is the GitHub URL of postgres_exporter: https://github.com/wrouesnel/postgres_exporter.
How to do it...
The postgres_exporter installation and setup are done on the PostgreSQL database server only. Thus, all the following steps in this section, unless when explicitly specified, need to be done on the PostgreSQL server:
- Install...