2020-06-01 12:46:37 +02:00
|
|
|
groups:
|
|
|
|
- name: TestGroup
|
2022-09-13 15:25:43 +02:00
|
|
|
interval: 5s
|
2020-06-09 14:21:20 +02:00
|
|
|
concurrency: 2
|
2022-06-09 08:58:25 +02:00
|
|
|
limit: 1000
|
2022-07-21 15:59:55 +02:00
|
|
|
headers:
|
|
|
|
- "MyHeader: foo"
|
2023-04-27 13:02:21 +02:00
|
|
|
notifier_headers:
|
|
|
|
- "MyHeader: foo"
|
2021-12-02 13:45:08 +01:00
|
|
|
params:
|
|
|
|
denyPartialResponse: ["true"]
|
2020-06-01 12:46:37 +02:00
|
|
|
rules:
|
|
|
|
- alert: Conns
|
2022-09-29 18:22:50 +02:00
|
|
|
expr: vm_tcplistener_conns > 0
|
2020-06-01 12:46:37 +02:00
|
|
|
for: 3m
|
2022-09-13 15:25:43 +02:00
|
|
|
debug: true
|
2022-12-29 12:36:44 +01:00
|
|
|
update_entries_limit: 40
|
2020-06-01 12:46:37 +02:00
|
|
|
annotations:
|
2022-09-29 18:22:50 +02:00
|
|
|
labels: "Available labels: {{ $labels }}"
|
|
|
|
summary: Too high connection number for {{ $labels.instance }}
|
2020-12-14 19:11:45 +01:00
|
|
|
{{ 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
|
2022-12-29 12:36:44 +01:00
|
|
|
update_entries_limit: -1
|
2020-06-01 12:46:37 +02:00
|
|
|
expr: sum by(job)
|
|
|
|
(up == 1)
|
2020-12-19 13:10:59 +01:00
|
|
|
labels:
|
|
|
|
job: '{{ $labels.job }}'
|
2021-01-10 00:56:11 +01:00
|
|
|
dynamic: '{{ $x := query "up" | first | value }}{{ if eq 1.0 $x }}one{{ else }}unknown{{ end }}'
|
2020-12-14 19:11:45 +01:00
|
|
|
annotations:
|
2020-12-19 13:10:59 +01:00
|
|
|
description: Job {{ $labels.job }} is up!
|
2022-02-15 14:59:45 +01:00
|
|
|
external: cluster-{{ $externalLabels.cluster }}; replica-{{ $externalLabels.replica }}
|
2020-12-19 13:10:59 +01:00
|
|
|
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"})
|
|
|
|
/
|
2022-05-18 09:50:46 +02:00
|
|
|
sum(code:requests:rate5m)
|
|
|
|
- record: code:requests:slo
|
|
|
|
labels:
|
|
|
|
recording: true
|
|
|
|
expr: 0.95
|
|
|
|
- record: time:current
|
|
|
|
labels:
|
|
|
|
recording: true
|
|
|
|
expr: time()
|