2020-06-01 12:46:37 +02:00
|
|
|
groups:
|
|
|
|
- name: TestGroup
|
|
|
|
interval: 2s
|
2020-06-09 14:21:20 +02:00
|
|
|
concurrency: 2
|
2020-06-01 12:46:37 +02:00
|
|
|
rules:
|
|
|
|
- alert: Conns
|
|
|
|
expr: sum(vm_tcplistener_conns) by(instance) > 1
|
|
|
|
for: 3m
|
|
|
|
annotations:
|
2020-12-14 19:11:45 +01:00
|
|
|
summary: Too high connection number for {{$labels.instance}}
|
|
|
|
{{ with printf "sum(vm_tcplistener_conns{instance=%q})" .Labels.instance | query }}
|
|
|
|
{{ . | first | value }}
|
|
|
|
{{ end }}
|
2020-06-01 12:46:37 +02:00
|
|
|
description: "It is {{ $value }} connections for {{$labels.instance}}"
|
|
|
|
- alert: ExampleAlertAlwaysFiring
|
|
|
|
expr: sum by(job)
|
|
|
|
(up == 1)
|
2020-12-19 13:10:59 +01:00
|
|
|
labels:
|
|
|
|
job: '{{ $labels.job }}'
|
2020-12-14 19:11:45 +01:00
|
|
|
annotations:
|
2020-12-19 13:10:59 +01:00
|
|
|
description: Job {{ $labels.job }} is up!
|
|
|
|
summary: All instances up {{ range query "up" }}
|
2020-12-14 19:11:45 +01:00
|
|
|
{{ . | label "instance" }}
|
|
|
|
{{ end }}
|
2020-06-01 12:46:37 +02:00
|
|
|
- record: handler:requests:rate5m
|
|
|
|
expr: sum(rate(prometheus_http_requests_total[5m])) by (handler)
|
|
|
|
labels:
|
|
|
|
recording: true
|
|
|
|
- record: code:requests:rate5m
|
|
|
|
expr: sum(rate(promhttp_metric_handler_requests_total[5m])) by (code)
|
|
|
|
labels:
|
2020-06-15 21:15:47 +02:00
|
|
|
env: dev
|
|
|
|
recording: true
|
|
|
|
- record: code:requests:rate5m
|
|
|
|
expr: sum(rate(promhttp_metric_handler_requests_total[5m])) by (code)
|
|
|
|
labels:
|
|
|
|
env: staging
|
2020-06-01 12:46:37 +02:00
|
|
|
recording: true
|
|
|
|
- record: successful_requests:ratio_rate5m
|
|
|
|
labels:
|
|
|
|
recording: true
|
|
|
|
expr: |2
|
|
|
|
sum(code:requests:rate5m{code="200"})
|
|
|
|
/
|
|
|
|
sum(code:requests:rate5m)
|