File: test.yaml

package info (click to toggle)
prometheus 2.7.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,912 kB
  • sloc: lex: 171; sh: 155; makefile: 78
file content (64 lines) | stat: -rw-r--r-- 1,625 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
groups:
- name: my-group-name
  interval: 30s   # defaults to global interval
  rules:
  - alert: HighErrors
    expr: |
      sum without(instance) (rate(errors_total[5m]))
      / 
      sum without(instance) (rate(requests_total[5m]))
    for: 5m
    labels:
      severity: critical
    annotations:
      description: "stuff's happening with {{ $.labels.service }}"

  # Mix recording rules in the same list
  - record: "new_metric"
    expr: |
      sum without(instance) (rate(errors_total[5m]))
      / 
      sum without(instance) (rate(requests_total[5m]))
    labels:
      abc: edf
      uvw: xyz

  - alert: HighErrors
    expr: | 
      sum without(instance) (rate(errors_total[5m]))
      / 
      sum without(instance) (rate(requests_total[5m]))
    for: 5m
    labels:
      severity: critical
    annotations:
      description: "stuff's happening with {{ $.labels.service }}"
      
- name: my-another-name
  interval: 30s   # defaults to global interval
  rules:
  - alert: HighErrors
    expr: | 
      sum without(instance) (rate(errors_total[5m]))
      / 
      sum without(instance) (rate(requests_total[5m]))
    for: 5m
    labels:
      severity: critical

  - record: "new_metric"
    expr: |
      sum without(instance) (rate(errors_total[5m]))
      / 
      sum without(instance) (rate(requests_total[5m]))

  - alert: HighErrors
    expr: | 
      sum without(instance) (rate(errors_total[5m]))
      / 
      sum without(instance) (rate(requests_total[5m]))
    for: 5m
    labels:
      severity: critical
    annotations:
      description: "stuff's happening with {{ $.labels.service }}"