Monitoring Parameters

Parameters about monitoring system

Pigsty’s monitoring system contains three components.

  • Node Exporter
  • PG Exporter
  • Pgbouncer Exporter

In addition, Haproxy will expose monitoring metrics to the public directly through the management port.

All monitoring Exporter will be registered to Consul, and Prometheus will manage these tasks by way of service discovery.

Overview

#------------------------------------------------------------------------------
# MONITOR PROVISION
#------------------------------------------------------------------------------
pg_exporter_config
node_exporter_port
pg_exporter_port
pgbouncer_exporter_port
exporter_metrics_path
pg_localhost

Defaults

#------------------------------------------------------------------------------
# MONITOR PROVISION
#------------------------------------------------------------------------------
# - monitor options -
pg_exporter_config: pg_exporter-demo.yaml     # default config files for pg_exporter
node_exporter_port: 9100                      # default port for node exporter
pg_exporter_port: 9630                        # default port for pg exporter
pgbouncer_exporter_port: 9631                 # default port for pgbouncer exporter
exporter_metrics_path: /metrics               # default metric path for pg related exporter
pg_localhost: /var/run/postgresql             # localhost unix socket path

Reference

pg_exporter_config

pg_exporter使用的默认配置文件,定义了Pigsty中的指标。

Pigsty默认提供了两个配置文件:

  • pg_exporter-demo.yaml 用于沙箱演示环境,缓存TTL更低(1s),监控实时性更好。

  • pg_exporter.yaml,用于生产环境,有着正常的缓存TTL(10s),显著降低多个Prometheus同时抓取的负载。

如果您采用了不同的Prometheus架构,建议对pg_exporter的配置文件进行检查与调整。

node_exporter_port

node_exporter监听的端口

默认端口9100

pg_exporter_port

pg_exporter监听的端口

默认端口9630

pgbouncer_exporter_port

pgbouncer_exporter监听的端口

默认端口9631

exporter_metrics_path

所有Exporter对外暴露指标的URL PATH

pg_localhost

PG Exporter连接postgres与pgbouncer时,会尝试访问pg_localhost定义的本地目录,尝试使用UNIX Socket连接数据库与连接池。

默认为/var/run/postgresql

Last modified 2021-02-08: update en deploy doc (c50b13b)