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.


Re: [prometheus-users] exporter crashes, multiple up-metric-related alerts fire

2023-05-25 Thread Brian Candler
Of course, you don't get that problem if you turn off the sending of 
"resolved" notifications completely.

https://www.robustperception.io/running-into-burning-buildings-because-the-fire-alarm-stopped
https://docs.google.com/document/d/199PqyG3UsyXlwieHaqbGiWVa8eMWi8zzAn0YfcApr8Q/edit

On Thursday, 25 May 2023 at 08:24:39 UTC+1 Mario Cornaccini wrote:

> of course !
> thank you;
>
> totally overlooked that, because at some point we went for group_by: 
> [...], because we didn't like how when 1 alert of a group resolves, that we 
> then get a new notification, that just the remaining firing one is active;
> (a matter of taste somehow, i'd say); 'guess we cannot have the cake and 
> eat the cake,so to say ;-)
>
> cheers,fil
>
>
>
>
> On Wednesday, May 24, 2023 at 11:51:39 AM UTC+2 Ben Kochie wrote:
>
>> This is what the `group_by` feature in the alertmanager routing is for.
>>
>> https://prometheus.io/docs/alerting/latest/configuration/#route
>>
>> On Wed, May 24, 2023 at 11:33 AM Mario Cornaccini  
>> wrote:
>>
>>> hi, we got a custom made exporter, checking for running linux processes..
>>>
>>> i got 1 scrape job with 27 targets;
>>> also there is a general alert rule:
>>> expr: up==0
>>>
>>> so, when the exporter crashed, we got 27 alerts.
>>>
>>> is there a way or best-practice to detect that the exporter crashed, and 
>>> inhibit the 27 alerts, and just have one alert, exporter crashed ?
>>>
>>> (happy to give any more info if needed)
>>> cheers, fil
>>>
>>> -- 
>>> 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 view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/prometheus-users/b6796581-dcff-4577-a725-97e9e0e23c69n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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/a8240f78-c003-42c0-9c6f-056406223ee0n%40googlegroups.com.


Re: [prometheus-users] exporter crashes, multiple up-metric-related alerts fire

2023-05-25 Thread Mario Cornaccini
of course !
thank you;

totally overlooked that, because at some point we went for group_by: [...], 
because we didn't like how when 1 alert of a group resolves, that we then 
get a new notification, that just the remaining firing one is active;
(a matter of taste somehow, i'd say); 'guess we cannot have the cake and 
eat the cake,so to say ;-)

cheers,fil




On Wednesday, May 24, 2023 at 11:51:39 AM UTC+2 Ben Kochie wrote:

> This is what the `group_by` feature in the alertmanager routing is for.
>
> https://prometheus.io/docs/alerting/latest/configuration/#route
>
> On Wed, May 24, 2023 at 11:33 AM Mario Cornaccini  
> wrote:
>
>> hi, we got a custom made exporter, checking for running linux processes..
>>
>> i got 1 scrape job with 27 targets;
>> also there is a general alert rule:
>> expr: up==0
>>
>> so, when the exporter crashed, we got 27 alerts.
>>
>> is there a way or best-practice to detect that the exporter crashed, and 
>> inhibit the 27 alerts, and just have one alert, exporter crashed ?
>>
>> (happy to give any more info if needed)
>> cheers, fil
>>
>> -- 
>> 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 view this discussion on the web visit 
>> https://groups.google.com/d/msgid/prometheus-users/b6796581-dcff-4577-a725-97e9e0e23c69n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/ec17bd8d-751f-402e-9a0e-ec220884dd06n%40googlegroups.com.