Re: [prometheus-users] Prometheus counter reset

2023-05-26 Thread Brian Candler
By sending a PromQL query that uses rate, e.g.  *rate(up[2m])*
... with suitable URL escaping.

In fact, if you go to Prometheus' built-in web interface, turn on your 
browser's developer console, and enter that expression into the PromQL 
browser, you'll see that behind the scenes the web UI sends this to the API:

/api/v1/query?query=rate%28up%5B2m%5D%29=1685087742.644

On Thursday, 25 May 2023 at 16:22:58 UTC+1 Yogita Bhardwaj wrote:

> How can I apply rate in this ?
>
> 'http://localhost:9090/api/v1/query?query=up=2015-07-01T20:10:51.781Z'
>
>
> On Thu, May 25, 2023 at 8:41 PM Stuart Clark  
> wrote:
>
>> On 25/05/2023 15:59, Yogita Bhardwaj wrote:
>> > How can i apply rate or increase while using http api.
>> You just need to include it in the query you are sending the Prometheus 
>> API.
>>
>> -- 
>> Stuart Clark
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/7340ec03-c4b1-48c7-9eae-ef51c1aa145cn%40googlegroups.com.


Re: [prometheus-users] Prometheus counter reset

2023-05-25 Thread Yogita Bhardwaj
How can I apply rate in this ?

'http://localhost:9090/api/v1/query?query=up=2015-07-01T20:10:51.781Z'


On Thu, May 25, 2023 at 8:41 PM Stuart Clark 
wrote:

> On 25/05/2023 15:59, Yogita Bhardwaj wrote:
> > How can i apply rate or increase while using http api.
> You just need to include it in the query you are sending the Prometheus
> API.
>
> --
> Stuart Clark
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CACrfAEw8TvfnbcMkP%2BZykCgnNf2DH5GdLXutd_kjiwTEKhgGWA%40mail.gmail.com.


Re: [prometheus-users] Prometheus counter reset

2023-05-25 Thread Stuart Clark

On 25/05/2023 15:59, Yogita Bhardwaj wrote:

How can i apply rate or increase while using http api.

You just need to include it in the query you are sending the Prometheus API.

--
Stuart Clark

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/1c31a201-729f-a0a9-e90d-904d42257e83%40Jahingo.com.


Re: [prometheus-users] Prometheus counter reset

2023-05-25 Thread Yogita Bhardwaj
How can i apply rate or increase while using http api.

On Thu, 25 May, 2023, 7:52 pm Stuart Clark, 
wrote:

> On 25/05/2023 06:56, Yogita Bhardwaj wrote:
> > I am using Prometheus counters in my project but the value of counter
> > reset when service restart. how can I prevent counter reset while
> > fetching data from Prometheus using http api. --
>
> It is expected that counters will reset when a service restarts, so you
> don't need to do anything. Prometheus handles counter resets
> automatically when you are using functions like rate().
>
> --
> Stuart Clark
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CACrfAEyLvDWM0UP9%2ByMe61---M8E8qTPZFrwOTTmSYX5_fPuGA%40mail.gmail.com.


Re: [prometheus-users] Prometheus counter reset

2023-05-25 Thread Stuart Clark

On 25/05/2023 06:56, Yogita Bhardwaj wrote:
I am using Prometheus counters in my project but the value of counter 
reset when service restart. how can I prevent counter reset while 
fetching data from Prometheus using http api. -- 


It is expected that counters will reset when a service restarts, so you 
don't need to do anything. Prometheus handles counter resets 
automatically when you are using functions like rate().


--
Stuart Clark

--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/0d139bb9-e5d0-0f6d-6649-fdfb5a8d8ef7%40Jahingo.com.


[prometheus-users] Prometheus counter reset

2023-05-24 Thread Yogita Bhardwaj
I am using Prometheus counters in my project but the value of counter reset 
when service restart. how can I prevent counter reset while fetching data 
from Prometheus using http api.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/67e08ac8-f02d-4631-a650-1c9bf0a631afn%40googlegroups.com.