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