Thanks very much, that works a treat, I have continued the discussion in 
the correct group, apologies.

https://groups.google.com/g/prometheus-users/c/DKfzDuZQs0Y

On Tuesday, 20 October 2020 at 19:17:29 UTC+1 [email protected] wrote:

> Please post this question / the next question you have in the **Prometheus 
> Users** group (here <https://groups.google.com/g/prometheus-users>) instead 
> of **Prometheus Developers**.
>
> And if you really want to "evaluate over a rolling 5 minute window the 
> number of errors", replace `rate` with `increase`. On a second look, just 
> use the following expression. There is no need for the recording rule in 
> your case.
>
> ```
> sum by (fqdn, instance, app) 
> (increase(windows_iis_worker_request_errors_total{status_code!="401"}[5m]))
> ```
>
> [email protected] schrieb am Dienstag, 20. Oktober 2020 um 16:58:24 
> UTC+2:
>
>>   # Caculates HTTP error Responses total 
>>   - record: windows:windows_iis_worker_request_errors_total:irate5m
>>     expr: irate(windows_iis_worker_request_errors_total[5m])
>>
>>   - alert: IIS error requests rate
>>     expr: 
>> sum without () 
>> (rate(windows:windows_iis_worker_request_errors_total:irate5m{status_code!="401"}[5m]))
>>  > 3
>>     for: 5m
>>     labels:
>>       severity: critical
>>       component: WindowsOS
>>     annotations:
>>       summary: "High IIS worker error rate"
>>       description: 
>> "IIS http responses on {{ if $labels.fqdn }}{{ $labels.fqdn }}{{ else }}{{ 
>> $labels.instance }}{{ end }}for {{ $labels.app }} has high rate of errors."
>>       dashboard:
>>       runbook:
>>
>> I'm trying to do something like this to alert on when people are getting 
>> errors whilst trying to connect to a webapp, the issue is the query itself '
>> windows_iis_worker_request_errors_total:irate5m' is returning non 
>> integer values
>>
>> The idea was to evaluate over a rolling 5 minute window the number of 
>> errors.
>>
>> of course in an ideal world I'd alert on the rate of errors using the 
>> total requests metrics and dividing, however the two metrics have a label 
>> mismatch and I am unsure how to perform that query.
>>
>> Would really appreciate any assistance!
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/da2a1a8d-f9a9-4d24-b698-633aedf73c12n%40googlegroups.com.

Reply via email to