File: README.Debian

package info (click to toggle)
prometheus-postgres-exporter 0.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 996 kB
  • sloc: sh: 374; makefile: 54
file content (29 lines) | stat: -rw-r--r-- 1,217 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
To use the PostgreSQL exporter, you need to connect to the database with
superuser (postgres) privileges, or with an user that has been granted enough
permissions.

The recommended way to do this, is to create a `prometheus` user with no
password, and then connect using UNIX domain sockets.

To do that, set this connection string in
/etc/default/prometheus-postgres-exporter:

  DATA_SOURCE_NAME='user=prometheus host=/run/postgresql dbname=postgres'

For PostgreSQL versions >= 10, use psql (sudo -u postgres psql) to execute
the following SQL commands to create the user:

  CREATE USER prometheus;
  GRANT pg_monitor TO prometheus;

Previous instructions required you to create custom functions and views in a
prometheus schema, since certain runtime information was not visible to non-
superusers. With the advent of the pg_monitor role, these are no longer
required, and may be safely removed:

  ALTER ROLE prometheus RESET search_path;
  DROP VIEW IF EXISTS prometheus.pg_stat_activity;
  DROP VIEW IF EXISTS prometheus.pg_stat_replication;
  DROP FUNCTION IF EXISTS prometheus.f_select_pg_stat_activity;
  DROP FUNCTION IF EXISTS prometheus.f_select_pg_stat_replication;
  DROP SCHEMA IF EXISTS prometheus;