【发布时间】:2022-01-17 13:34:54
【问题描述】:
为了在 prometheus 中收集 Postgres 指标,使用了 postgres_exporter。不使用容器化,一切都在本地完成。硬件指标通过作业收集在 prometheus 中。要收集数据库指标,我需要将 prometheus_exporter 连接到数据库。告诉我如何配置与数据库的连接。 postgres_exporter 没有配置文件。 Ш可以通过环境变量来实现吗?
prometheus.yml:
scrape_configs:
- job_name: postgresql
static_configs:
- targets: ['xx.xx.xx.xx:9187']
labels:
alias: postgres
【问题讨论】:
标签: postgresql environment-variables prometheus grafana