mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 08:23:34 +01:00
1a01fe2cf2
Uniqueness of rule is now defined by combination of its name, expression and labels. The hash of the combination is now used as rule ID and identifies rule within the group. Set of rules from coreos/kube-prometheus was added for testing purposes to verify compatibility. The check also showed that `vmalert` doesn't support `query` template function that was mentioned as limitation in README.
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
groups:
|
|
- name: TestGroup
|
|
interval: 2s
|
|
concurrency: 2
|
|
rules:
|
|
- alert: Conns
|
|
expr: sum(vm_tcplistener_conns) by(instance) > 1
|
|
for: 3m
|
|
annotations:
|
|
summary: "Too high connection number for {{$labels.instance}}"
|
|
description: "It is {{ $value }} connections for {{$labels.instance}}"
|
|
- alert: ExampleAlertAlwaysFiring
|
|
expr: sum by(job)
|
|
(up == 1)
|
|
- 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:
|
|
env: dev
|
|
recording: true
|
|
- record: code:requests:rate5m
|
|
expr: sum(rate(promhttp_metric_handler_requests_total[5m])) by (code)
|
|
labels:
|
|
env: staging
|
|
recording: true
|
|
- record: successful_requests:ratio_rate5m
|
|
labels:
|
|
recording: true
|
|
expr: |2
|
|
sum(code:requests:rate5m{code="200"})
|
|
/
|
|
sum(code:requests:rate5m) |