Discourse Prometheus 插件在使用 bitnami/discourse:2.6.7 时抛出错误

你好,

我进行了彻底的搜索,但未能找到解决此问题的方法。
我一直使用 discourse-prometheus 插件配合 bitnami/discourse 镜像(部署在 AKS 集群上)有一段时间了。
在近期升级到 bitnami/discourse:2.6.7 后,我发现 discourse-prometheus 插件无法正常工作,日志显示如下:

App 539 output: Prometheus Exporter, failed to send message Connection refused - connect(2) for "localhost" port 9405 App 539 output: [ 2021-06-26 13:05:24.3855 539/0x00005605c6d15b38(Worker 1) utils.rb ]: *** Exception Errno::ECONNREFUSED in Rack application object (Failed to open TCP connection to localhost:9405 (Connection refused - connect(2) for "localhost" port 9405)) (process 539, thread 0x00005605c6d15b38(Worker 1)): App 539 output: from /opt/bitnami/ruby/lib/ruby/2.6.0/net/http.rb:949:in `rescue in block in connect'

Prometheus 显示目标已下线,并出现 502 Bad Gateway 错误。
如果在浏览器中访问 /metrics,会显示“从应用程序接收到的响应不完整”。

2 个赞

我在 Kubernetes 集群上遇到了相同的错误信息。我的个人 Discourse 实例使用了该插件最新的 main 分支,以及(截至发帖时)最新的 2.8.0.beta4 版本标签。如果有人感兴趣,我可以提供本地复现步骤。

如果我使用 stable 标签或 stable-branch,则会看到类似以下的一系列错误:

检测到死掉的 worker 926,正在重启...
尝试终止进程 927
Prometheus Exporter,发送消息失败:Connection refused - connect(2) for "localhost" port 9405
检测到死掉的 worker 927,正在重启...
1 个赞