我对 postgres 9.6 的 datadog 的配置设置有疑问。
(1) 如何在 datadog 中监控所有数据库?(2) 如何从每个数据库/模式中获取所有表级指标?
这是conf文件。
init_config:
instances:
- host: host_name_goes_here
port: port_number_goes_here
username: datadog
password: password_goes_here
dbname: db_name1
relations:
- relation_name: table_1 --This will only give you metrics for table specified here.
- relation_regex: '.*' --This will give you metrics for all the tables in the database.
Datadog 文档并没有真正的帮助。我想要所有数据库,而不是列出所有数据库,所以如果我们添加一个新数据库,我们不必更改 conf 文件,table_name 也是如此。
根据 datadog 文档,表级指标是使用 pg_stat_user_tables、pg_statio_user_tables 等收集的。这些 postgres 表是特定于数据库的,与 pg_stat_activity 或 pg_stat_statements 不同。