IIS windows exporter alerting

30 views
Skip to first unread message

Kavan Mccanaan

unread,
Oct 20, 2020, 10:58:24 AM10/20/20
to Prometheus Developers
  # Caculates HTTP error Responses total 
  - recordwindows:windows_iis_worker_request_errors_total:irate5m
    exprirate(windows_iis_worker_request_errors_total[5m])

  - alertIIS error requests rate
    exprsum without () (rate(windows:windows_iis_worker_request_errors_total:irate5m{status_code!="401"}[5m])) > 3
    for5m
    labels:
      severitycritical
      componentWindowsOS
    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!

Tim Schwenke

unread,
Oct 20, 2020, 2:17:29 PM10/20/20
to Prometheus Developers
Please post this question / the next question you have in the **Prometheus Users** group (here) 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]))
```

Kavan Mccanaan

unread,
Oct 21, 2020, 4:30:02 AM10/21/20
to Prometheus Developers
Thanks very much, that works a treat, I have continued the discussion in the correct group, apologies.

Reply all
Reply to author
Forward
0 new messages