A GOV.UK PaaS application that exports Postgres metrics to Prometheus.
This is a tiny application that can be deployed into a GOV.UK PaaS space to expose metrics for Postgres databases backing other applications in that space. This includes metrics such as number of active connections and the rate of transactions. These metrics are useful to expose to developers so they can diagnose problems and understand how their backing databases cope with traffic.
- Clone this repository
- Set a name in
manifest.yml, for examplepostgres-exporter-my-app - Run
cf servicesto find the name of your postgres database - Change
rails-postgresinmanifest.ymlto your database name - Run
cf pushto deploy the exporter to your space - Visit the Postgres dashboard in Grafana
- Select your exporter's name from the dropdown menu (top-left of the screen)
It can take up to 5 minutes for your exporter to appear in the dropdown menu.
This step is optional.
This exporter supports custom queries. This lets you periodically run a query
against the database and export it as a metric that can be graphed. For example,
you might want to graph how many users are signed up to your service. Check
out the queries.yml file for some examples. After editing this file, run
cf push to deploy your changes.