Skip to content

Commit db236eb

Browse files
committed
OBSDOCS-574: Add duration to YAML alert examples
1 parent 6f287a9 commit db236eb

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

modules/monitoring-creating-alerting-rules-for-user-defined-projects.adoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@ spec:
4040
- name: example
4141
rules:
4242
- 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>
4445
labels:
45-
severity: warning # <3>
46+
severity: warning # <4>
4647
annotations:
47-
message: This is an example alert. # <4>
48+
message: This is an example alert. # <5>
4849
----
4950
<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.
5355

5456
. Apply the configuration file to the cluster:
5557
+

modules/monitoring-creating-new-alerting-rules.adoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,18 @@ spec:
4040
- name: example-rules
4141
rules:
4242
- alert: ExampleAlert # <1>
43-
expr: vector(1) # <2>
43+
for: 1m # <2>
44+
expr: vector(1) # <3>
4445
labels:
45-
severity: warning # <3>
46+
severity: warning # <4>
4647
annotations:
47-
message: This is an example alert. # <4>
48+
message: This is an example alert. # <5>
4849
----
4950
<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.
5355

5456
. Apply the configuration file to the cluster:
5557
+

0 commit comments

Comments
 (0)