prometheusprometheus-java

Prometheus: Error: 404, response body: 404 page not found when trying to push metrics using PushGateway


I am trying to push metrics using PushGateway, and i get the below error while pushing the metrics:

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)

The URL up to http://169.41.73.106:30000/metrics works fine, however when I try /metrics/job with any of the scrape job names mentioned I get 404. Can someone help.


Solution

  • https://github.com/Prometheus/pushgateway I think you need to set up pushgateway at first ,then add pushgateway's address+port (localhost:9091) to prometheus config file, then run you pushgateway client to send metrics again, it works for me