2020-06-01 10:46:37 +00:00
|
|
|
groups:
|
|
|
|
- name: TestGroup
|
|
|
|
interval: 2s
|
2020-06-09 12:21:20 +00:00
|
|
|
concurrency: 2
|
2022-06-09 06:58:25 +00:00
|
|
|
limit: 1000
|
2022-07-21 13:59:55 +00:00
|
|
|
headers:
|
|
|
|
- "MyHeader: foo"
|
2021-12-02 12:45:08 +00:00
|
|
|
params:
|
|
|
|
denyPartialResponse: ["true"]
|
2020-06-01 10:46:37 +00:00
|
|
|
rules:
|
|
|
|
- alert: Conns
|
|
|
|
expr: sum(vm_tcplistener_conns) by(instance) > 1
|
|
|
|
for: 3m
|
|
|
|
annotations:
|
2020-12-14 18:11:45 +00: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 10:46:37 +00:00
|
|
|
description: "It is {{ $value }} connections for {{$labels.instance}}"
|
|
|
|
- alert: ExampleAlertAlwaysFiring
|
|
|
|
expr: sum by(job)
|
|
|
|
(up == 1)
|
2020-12-19 12:10:59 +00:00
|
|
|
labels:
|
|
|
|
job: '{{ $labels.job }}'
|
2021-01-09 23:56:11 +00:00
|
|
|
dynamic: '{{ $x := query "up" | first | value }}{{ if eq 1.0 $x }}one{{ else }}unknown{{ end }}'
|
2020-12-14 18:11:45 +00:00
|
|
|
annotations:
|
2020-12-19 12:10:59 +00:00
|
|
|
description: Job {{ $labels.job }} is up!
|
2022-02-15 13:59:45 +00:00
|
|
|
external: cluster-{{ $externalLabels.cluster }}; replica-{{ $externalLabels.replica }}
|
2020-12-19 12:10:59 +00:00
|
|
|
summary: All instances up {{ range query "up" }}
|
2020-12-14 18:11:45 +00:00
|
|
|
{{ . | label "instance" }}
|
|
|
|
{{ end }}
|
2020-06-01 10:46:37 +00: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 19:15:47 +00: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 10:46:37 +00:00
|
|
|
recording: true
|
|
|
|
- record: successful_requests:ratio_rate5m
|
|
|
|
labels:
|
|
|
|
recording: true
|
|
|
|
expr: |2
|
|
|
|
sum(code:requests:rate5m{code="200"})
|
|
|
|
/
|
2022-05-18 07:50:46 +00:00
|
|
|
sum(code:requests:rate5m)
|
|
|
|
- record: code:requests:slo
|
|
|
|
labels:
|
|
|
|
recording: true
|
|
|
|
expr: 0.95
|
|
|
|
- record: time:current
|
|
|
|
labels:
|
|
|
|
recording: true
|
|
|
|
expr: time()
|