-
Notifications
You must be signed in to change notification settings - Fork 52
/
postgresql-metrics.yml
64 lines (58 loc) · 2.34 KB
/
postgresql-metrics.yml
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
# Postgres database cluster to connect for gathering metrics
postgres:
host: "127.0.0.1"
port: 5432
user: "postgres"
password: "postgres"
# List all the databases in your cluster you want to get stats from
databases: []
# If datadir is empty, checking PGDATA env variable also
data_dir:
log:
# Notice that simple CLI calls will always log only to stderr independent
# of these configuration values.
log_to_stderr: false
log_to_syslog: false
log_to_file: true
# Log levels one of: critical, error, warning, notice, info, debug
log_level: info
rotate_file_log: true
# Default file rotate size is is 10 MB.
file_rotate_max_size: 10485760
filename: /var/log/postgresql-metrics/postgresql-metrics.log
# Syslog facility to use, if syslog logging enabled.
syslog_facility: user
# FFWD is used for pushing metrics out for the long running process
ffwd:
host: "127.0.0.1"
port: 19000
# You need to have a matchingly named metrics function in metrics_gatherer.py,
# to include it in any of the DB function sections here below.
#
# Each entry must be a tuple with the function name, and a time interval in seconds
# to call that metrics function.
#
# db_functions: Functions called once per each database in cluster.
db_functions:
- ["get_stats_disk_usage_for_database", 180]
- ["get_stats_tx_rate_for_database", 60]
- ["get_stats_seconds_since_last_vacuum_per_table", 60]
- ["get_stats_oldest_transaction_timestamp", 180]
- ["get_stats_index_hit_rates", 60]
# table bloat is a heavy query, which might take many minutes to execute for huge tables
# 43200 seconds = 12*60*60 seconds = 12 hours
- ["get_stats_table_bloat", 43200]
# replication status relies on `pg_stat_wal_receiver`, which is only available on postgres 9.6+
# - ["get_stats_incoming_replication_status", 30]
# global_db_functions: Functions called once per the whole database cluster.
global_db_functions:
- ["get_stats_client_connections", 60]
- ["get_stats_lock_statistics", 60]
- ["get_stats_heap_hit_statistics", 60]
- ["get_stats_replication_delays", 60]
- ["get_stats_wal_file_amount", 180]
- ["get_multixact_members_per_mxid", 60]
- ["get_multixact_members_remaining_ratio", 60]
- ["get_multixact_remaining_ratio", 60]
- ["get_xid_remaining_ratio", 60]