You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/monitoring-creating-alerting-rules-for-user-defined-projects.adoc
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,13 @@
8
8
9
9
You can create alerting rules for user-defined projects. Those alerting rules will trigger alerts based on the values of the chosen metrics.
10
10
11
+
[NOTE]
12
+
====
13
+
* When you create an alerting rule, a project label is enforced on it even if a rule with the same name exists in another project.
14
+
15
+
* To help users understand the impact and cause of the alert, ensure that your alerting rule contains an alert message and severity value.
16
+
====
17
+
11
18
.Prerequisites
12
19
13
20
* You have enabled monitoring for user-defined projects.
@@ -18,12 +25,8 @@ You can create alerting rules for user-defined projects. Those alerting rules wi
18
25
19
26
. Create a YAML file for alerting rules. In this example, it is called `example-app-alerting-rule.yaml`.
20
27
21
-
. Add an alerting rule configuration to the YAML file. For example:
22
-
+
23
-
[NOTE]
24
-
====
25
-
When you create an alerting rule, a project label is enforced on it if a rule with the same name exists in another project.
26
-
====
28
+
. Add an alerting rule configuration to the YAML file.
29
+
The following example creates a new alerting rule named `example-alert`. The alerting rule fires an alert when the `version` metric exposed by the sample service becomes `0`:
This configuration creates an alerting rule named `example-alert`. The alerting rule fires an alert when the `version` metric exposed by the sample service becomes `0`.
49
+
<1> The name of the alerting rule you want to create.
50
+
<2> The PromQL query expression that defines the new rule.
Copy file name to clipboardExpand all lines: modules/monitoring-creating-new-alerting-rules.adoc
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,9 @@ These alerting rules trigger alerts based on the values of chosen metrics.
11
11
12
12
[NOTE]
13
13
====
14
-
If you create a customized `AlertingRule` resource based on an existing platform alerting rule, silence the original alert to avoid receiving conflicting alerts.
14
+
* If you create a customized `AlertingRule` resource based on an existing platform alerting rule, silence the original alert to avoid receiving conflicting alerts.
15
+
16
+
* To help users understand the impact and cause of the alert, ensure that your alerting rule contains an alert message and severity value.
15
17
====
16
18
17
19
.Prerequisites
@@ -24,7 +26,7 @@ If you create a customized `AlertingRule` resource based on an existing platform
24
26
. Create a new YAML configuration file named `example-alerting-rule.yaml` in the `openshift-monitoring` namespace.
25
27
26
28
. Add an `AlertingRule` resource to the YAML file.
27
-
The following example creates a new alerting rule named `example`, similar to the default `watchdog` alert:
29
+
The following example creates a new alerting rule named `example`, similar to the default `Watchdog` alert:
28
30
+
29
31
[source,yaml]
30
32
----
@@ -37,11 +39,17 @@ spec:
37
39
groups:
38
40
- name: example-rules
39
41
rules:
40
-
- alert: ExampleAlert <1>
41
-
expr: vector(1) <2>
42
+
- alert: ExampleAlert # <1>
43
+
expr: vector(1) # <2>
44
+
labels:
45
+
severity: warning # <3>
46
+
annotations:
47
+
message: This is an example alert. # <4>
42
48
----
43
49
<1> The name of the alerting rule you want to create.
44
50
<2> The PromQL query expression that defines the new rule.
0 commit comments