File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -40,16 +40,18 @@ spec:
40
40
- name: example
41
41
rules:
42
42
- alert: VersionAlert # <1>
43
- expr: version{job="prometheus-example-app"} == 0 # <2>
43
+ for: 1m # <2>
44
+ expr: version{job="prometheus-example-app"} == 0 # <3>
44
45
labels:
45
- severity: warning # <3 >
46
+ severity: warning # <4 >
46
47
annotations:
47
- message: This is an example alert. # <4 >
48
+ message: This is an example alert. # <5 >
48
49
----
49
50
<1> The name of the alerting rule you want to create.
50
- <2> The PromQL query expression that defines the new rule.
51
- <3> The severity assigned to the alert.
52
- <4> The message associated with the alert.
51
+ <2> The duration for which the condition should be true before an alert is fired.
52
+ <3> The PromQL query expression that defines the new rule.
53
+ <4> The severity that alerting rule assigns to the alert.
54
+ <5> The message associated with the alert.
53
55
54
56
. Apply the configuration file to the cluster:
55
57
+
Original file line number Diff line number Diff line change @@ -40,16 +40,18 @@ spec:
40
40
- name: example-rules
41
41
rules:
42
42
- alert: ExampleAlert # <1>
43
- expr: vector(1) # <2>
43
+ for: 1m # <2>
44
+ expr: vector(1) # <3>
44
45
labels:
45
- severity: warning # <3 >
46
+ severity: warning # <4 >
46
47
annotations:
47
- message: This is an example alert. # <4 >
48
+ message: This is an example alert. # <5 >
48
49
----
49
50
<1> The name of the alerting rule you want to create.
50
- <2> The PromQL query expression that defines the new rule.
51
- <3> The severity assigned to the alert.
52
- <4> The message associated with the alert.
51
+ <2> The duration for which the condition should be true before an alert is fired.
52
+ <3> The PromQL query expression that defines the new rule.
53
+ <4> The severity that alerting rule assigns to the alert.
54
+ <5> The message associated with the alert.
53
55
54
56
. Apply the configuration file to the cluster:
55
57
+
You can’t perform that action at this time.
0 commit comments