我试图使用PushGateway来推送度量标准,在推送度量时,我得到了以下错误:
java.io.IOException: Response code from http://169.41.73.106:30000/metrics/job/pushgateway was 404, response body: 404 page not found
at io.prometheus.client.exporter.PushGateway.doRequest(PushGateway.java:325)
at io.prometheus.client.exporter.PushGateway.pushAdd(PushGateway.java:160)
at com.test.promtheus.App.main(App.java:37)到http://169.41.73.106:30000/metrics的URL工作正常,但是当我尝试使用上面提到的任意一个刮掉的作业名时,我得到了404。有人能帮忙吗。
发布于 2020-09-16 08:42:28
https://github.com/Prometheus/pushgateway我认为您首先需要设置推网关,然后将推网关的address+port (localhost:9091)添加到prometheus配置文件中,然后再运行pushgateway客户端发送度量,它适合我。
发布于 2021-07-13 12:26:50
如果在构建POC或配置新环境期间看到404响应,您可能会犯与我相同的错误。我使用Prometheus web服务器URL而不是push网关web服务器URL。这是两台不同的web服务器。它们可以在同一台主机上运行,但在不同的端口上运行,或者位于完全不同的服务器上。在可能的情况下,这是两个不同的域,类似于:https://prometheus.company.com和https://prometheus-pushgateway.company.com
直到http://169.41.73.106:30000/metrics的URL工作得很好
打开push网关时,启动/mertics端点不应该工作得很好,而应该在prometheus服务器上工作。使用/mertics端点查找您使用的服务器。
发布于 2022-02-05 01:20:26
把我的答案贴出来以防万一。如果有人犯了同样的错误,而超过2个答案,那就没有帮助了。
如果您正在发布的Pushgateway URL没有“作业”字(关键字将在Prometheus擦伤时使用),您可能会收到相同的404错误。
我得到了404错误,因为我的url是这样的:
http://<pushgatewayip_other_than_prometheus_ip>:9091/metrics/custom_label/label_value我能够通过使用url来解决这个问题:
http://<pushgatewayip_other_than_prometheus_ip>:9091/metrics/job/pushgateway/custom_label/label_valuehttps://stackoverflow.com/questions/63524436
复制相似问题