【问题标题】:postgresql_exporter is not working. how to configure it?postgresql_exporter 不工作。如何配置它?
【发布时间】:2021-10-05 04:10:42
【问题描述】:

我正在尝试运行 postgres_exporter(根据此链接:https://github.com/prometheus-community/postgres_exporter),我想从 prometheus 服务器读取这些指标。我的 postgresql 数据库在端口:5432 上的 docker 容器中运行 数据库名称:praxin 用户名:testuser 密码:passuser

这是命令,我尝试运行 postgresql_exporter: docker run --net=host -e DATA_SOURCE_NAME="postgresql://testuser:passuser@localhost:5432/praxin?sslmode=disable" -p 9187: 9187 quay.io/prometheuscommunity/postgres-exporter

它显示 postgresql_exporter 正在端口 9187 上运行,当我进入浏览器时,它没有显示任何指标并且没有连接。我可能哪里出错了?

【问题讨论】:

    标签: postgresql docker prometheus grafana


    【解决方案1】:

    testuser 没有对数据库指标表的 SELECT 访问权限

    将 SELECT ON pg_stat_database 授予 testuser;

    使用此命令并授予对度量表的访问权限是 postgres

    否则使用默认用户 postgres

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-20
      • 2020-05-23
      • 2011-06-07
      相关资源
      最近更新 更多