expression to query stats from prometheus using Curl

2,733 views
Skip to first unread message

vim...@gmail.com

unread,
Jul 25, 2017, 6:28:24 AM7/25/17
to Prometheus Users
Hi

when I give below curl query to prometheus, it returns an output


but when I add one more parameter in the expression like given below, I get 400 bad request. 


Please help
Thank You
Vial

Brian Brazil

unread,
Jul 25, 2017, 6:33:27 AM7/25/17
to vim...@gmail.com, Prometheus Users
You need to replace the spaces by %20 when using curl on the command line.

There's also no need to use sudo with curl.

Brian
 

Please help
Thank You
Vial

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/b62b55cf-5988-4ca4-a090-4d1ddcbd1333%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Brian Brazil

unread,
Jul 26, 2017, 2:48:35 AM7/26/17
to vim...@gmail.com, Prometheus Users
On 26 July 2017 at 06:36, <vim...@gmail.com> wrote:
Thanks Brian, 
That was very help full
I want to get stats for a certain label and below is what I am trying. I get parsing error. Please suggest how to get around this.
When I try same in prometheus it works fine.

{"status":"error","errorType":"bad_data","error":"parse error at char 27: could not parse remaining input \"=\\\"10.104.185.15\"

You've some form of escaping issue there, I can't see what it is offhand.

Brian
 

Regards
Vimal


On Tuesday, July 25, 2017 at 4:03:27 PM UTC+5:30, Brian Brazil wrote:
On 25 July 2017 at 11:28, <vim...@gmail.com> wrote:
Hi

when I give below curl query to prometheus, it returns an output


but when I add one more parameter in the expression like given below, I get 400 bad request. 



You need to replace the spaces by %20 when using curl on the command line.

There's also no need to use sudo with curl.

Brian
 

Please help
Thank You
Vial

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.



--



--
Reply all
Reply to author
Forward
0 new messages