Restructure for packaging
This commit is contained in:
45
sample-config/pgmon-metrics.yml
Normal file
45
sample-config/pgmon-metrics.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
metrics:
|
||||
# Discovery metrics
|
||||
discover_dbs:
|
||||
type: set
|
||||
query:
|
||||
0: SELECT datname AS dbname FROM pg_database
|
||||
discover_rep:
|
||||
type: set
|
||||
query:
|
||||
0: SELECT client_addr || '_' || regexp_replace(application_name, '[ ,]', '_', 'g') AS repid, client_addr, state FROM pg_stat_replication
|
||||
|
||||
# cluster-wide metrics
|
||||
version:
|
||||
type: value
|
||||
query:
|
||||
0: SHOW server_version_num
|
||||
max_frozen_age:
|
||||
type: value
|
||||
query:
|
||||
0: SELECT max(age(datfrozenxid)) FROM pg_database
|
||||
|
||||
# Per-database metrics
|
||||
db_stats:
|
||||
type: row
|
||||
query:
|
||||
0: SELECT numbackends, xact_commit, xact_rollback, blks_read, blks_hit, tup_returned, tup_fetched, tup_inserted, tup_updated, tup_deleted, conflicts, temp_files, temp_bytes, deadlocks, blk_read_time, blk_write_time, extract('epoch' from stats_reset)::float FROM pg_stat_database WHERE datname = %(dbname)s
|
||||
140000: SELECT numbackends, xact_commit, xact_rollback, blks_read, blks_hit, tup_returned, tup_fetched, tup_inserted, tup_updated, tup_deleted, conflicts, temp_files, temp_bytes, deadlocks, COALESCE(checksum_failures, 0) AS checksum_failures, blk_read_time, blk_write_time, session_time, active_time, idle_in_transaction_time, sessions, sessions_abandoned, sessions_fatal, sessions_killed, extract('epoch' from stats_reset)::float FROM pg_stat_database WHERE datname = %(dbname)s
|
||||
|
||||
# Debugging
|
||||
ntables:
|
||||
type: value
|
||||
query:
|
||||
0: SELECT count(*) AS ntables FROM pg_stat_user_tables
|
||||
|
||||
# Per-replication metrics
|
||||
rep_stats:
|
||||
type: row
|
||||
query:
|
||||
0: SELECT * FROM pg_stat_database WHERE client_addr || '_' || regexp_replace(application_name, '[ ,]', '_', 'g') = '{repid}'
|
||||
|
||||
# Debugging
|
||||
sleep:
|
||||
type: value
|
||||
query:
|
||||
0: SELECT now(), pg_sleep(5);
|
||||
43
sample-config/pgmon.yml
Normal file
43
sample-config/pgmon.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
# Min PostgreSQL connection pool size (per database)
|
||||
#min_pool_size: 0
|
||||
|
||||
# Max PostgreSQL connection pool size (per database)
|
||||
#max_pool_size: 4
|
||||
|
||||
# How long a connection can sit idle in the pool before it's removed (seconds)
|
||||
#max_idle_time: 30
|
||||
|
||||
# Log level for stderr logging (see https://docs.python.org/3/library/logging.html#logging-levels)
|
||||
# Possible values are: debug, info, warning, error, critical
|
||||
#log_level: 'error'
|
||||
|
||||
# Database user to connect as
|
||||
#dbuser: 'postgres'
|
||||
|
||||
# Database host
|
||||
#dbhost: '/var/run/postgresql'
|
||||
|
||||
# Database port
|
||||
#dbport: 5432
|
||||
|
||||
# Default database to connect to when none is specified for a metric
|
||||
#dbname: 'postgres'
|
||||
|
||||
# Timeout for getting a connection slot from a pool
|
||||
#pool_slot_timeout: 5
|
||||
|
||||
# PostgreSQL connection timeout (seconds)
|
||||
# Note: It can actually be double this because of retries
|
||||
#connect_timeout: 5
|
||||
|
||||
# Time to wait before trying to reconnect again after a reconnect failure (seconds)
|
||||
#reconnect_cooldown: 30
|
||||
|
||||
# How often to check the version of PostgreSQL (seconds)
|
||||
#version_check_period: 300
|
||||
|
||||
# Metrics
|
||||
#metrics: {}
|
||||
|
||||
include:
|
||||
- pgmon-metrics.yml
|
||||
Reference in New Issue
Block a user