Pushgateway - page not found when using GET method

28 views
Skip to first unread message

Michał Rudko

unread,
May 18, 2020, 12:34:51 PM5/18/20
to Prometheus Users
Hello,

I am trying to use API GET method to return simple things from Pushgateway like:

curl -X GET localhost:9091/api/status


but I am getting: 

404 page not found 


POST method works without any issue - example below.

I'd appreciate any ideas what could be wrong. 


Thanks!

Michal


echo "my_metric 333" | curl --data-binary @- localhost:9091/metrics/job/my_job/my_label/my_label_value

Brian Candler

unread,
May 18, 2020, 1:14:11 PM5/18/20
to Prometheus Users
The pushgateway API is described here: https://github.com/prometheus/pushgateway#api

I don't see "/api/status" listed in that page.

However there is "/api/v1/status": https://github.com/prometheus/pushgateway#url-2

Michał Rudko

unread,
May 18, 2020, 2:41:23 PM5/18/20
to Prometheus Users
Thanks for the reply and sorry for the typo - I meant /api/v1/status
These are my tries without any luck:

[myhost~ curl -X GET localhost:9091/api/v1/metrics

404 page not found


[myhost ~ curl -X GET http://localhost:9091/api/v1/metrics

404 page not found


[myhost ~ curl -X PUT http://localhost:9091/api/v1/status

404 page not found


web.enable-admin-api is set to true, is there anything else I should do to enable the Query API? - it seems that only GET method does not work

Bjoern Rabenstein

unread,
May 22, 2020, 11:34:23 AM5/22/20
to Michał Rudko, Prometheus Users
On 18.05.20 11:41, Michał Rudko wrote:
> Thanks for the reply and sorry for the typo - I meant /api/v1/status
> These are my tries without any luck:
>
>
> [myhost~ curl -X GET localhost:9091/api/v1/metrics
>
> 404 page not found
>
>
> [myhost ~ curl -X GET http://localhost:9091/api/v1/metrics
>
> 404 page not found
>
>
> [myhost ~ curl -X PUT http://localhost:9091/api/v1/status
>
> 404 page not found

Which version of the PGW are you using? The API was only added in
the most recent version, i.e. v1.2.0.

--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email] bjo...@rabenste.in
Reply all
Reply to author
Forward
0 new messages