|
5 | 5 | # PostgreSQL Server Exporter
|
6 | 6 |
|
7 | 7 | Prometheus exporter for PostgreSQL server metrics.
|
8 |
| -Supported Postgres versions: 9.1 and up. |
| 8 | + |
| 9 | +CI Tested PostgreSQL versions: `9.1`, `9.2`, `9.3`, `9.4`, `9.5`, `9.6`, `10`, `11` |
9 | 10 |
|
10 | 11 | ## Quick Start
|
11 | 12 | This package is available for Docker:
|
@@ -105,7 +106,7 @@ The following environment variables configure the exporter:
|
105 | 106 | Path to a YAML file containing custom queries to run. Check out [`queries.yaml`](queries.yaml)
|
106 | 107 | for examples of the format.
|
107 | 108 |
|
108 |
| -* `PG_EXPORTER_CONTANT_LABELS` |
| 109 | +* `PG_EXPORTER_CONSTANT_LABELS` |
109 | 110 | Labels to set in all metrics. A list of `label=value` pairs, separated by commas.
|
110 | 111 |
|
111 | 112 | Settings set by environment variables starting with `PG_` will be overwritten by the corresponding CLI flag if given.
|
@@ -149,14 +150,20 @@ flag. This removes all built-in metrics, and uses only metrics defined by querie
|
149 | 150 |
|
150 | 151 | ### Running as non-superuser
|
151 | 152 |
|
152 |
| -To be able to collect metrics from pg_stat_activity and pg_stat_replication as non-superuser you have to create views as a superuser, and assign permissions separately to those. In PostgreSQL, views run with the permissions of the user that created them so they can act as security barriers. |
| 153 | +To be able to collect metrics from `pg_stat_activity` and `pg_stat_replication` |
| 154 | +as non-superuser you have to create views as a superuser, and assign permissions |
| 155 | +separately to those. |
| 156 | + |
| 157 | +In PostgreSQL, views run with the permissions of the user that created them so |
| 158 | +they can act as security barriers. |
153 | 159 |
|
154 | 160 | ```sql
|
155 | 161 | CREATE USER postgres_exporter PASSWORD 'password';
|
156 | 162 | ALTER USER postgres_exporter SET SEARCH_PATH TO postgres_exporter,pg_catalog;
|
157 | 163 |
|
158 |
| --- If deploying as non-superuser (for example in AWS RDS) |
159 |
| --- GRANT postgres_exporter TO :MASTER_USER; |
| 164 | +-- If deploying as non-superuser (for example in AWS RDS), uncomment the GRANT |
| 165 | +-- line below and replace <MASTER_USER> with your root user. |
| 166 | +-- GRANT postgres_exporter TO <MASTER_USER> |
160 | 167 | CREATE SCHEMA postgres_exporter AUTHORIZATION postgres_exporter;
|
161 | 168 |
|
162 | 169 | CREATE VIEW postgres_exporter.pg_stat_activity
|
|
0 commit comments