Skip to content

Commit 1104e73

Browse files
committed
OBSDOCS-447-improve-content-for-leaf-prometheus-label-uwm
1 parent 8750440 commit 1104e73

5 files changed

+27
-74
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * monitoring/managing-alerts.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="about-creating-alerting-rules-for-user-defined-projects_{context}"]
7+
= About creating alerting rules for user-defined projects
8+
9+
If you create alerting rules for a user-defined project, consider the following key behaviors and important limitations when you define the new rules:
10+
11+
* A user-defined alerting rule can include metrics exposed by its own project in addition to the default metrics from core platform monitoring.
12+
You cannot include metrics from another user-defined project.
13+
+
14+
For example, an alerting rule for the `ns1` user-defined project can use metrics exposed by the `ns1` project in addition to core platform metrics, such as CPU and memory metrics.
15+
However, the rule cannot include metrics from a different `ns2` user-defined project.
16+
17+
* To reduce latency and to minimize the load on core platform monitoring components, you can add the `openshift.io/prometheus-rule-evaluation-scope: leaf-prometheus` label to a rule.
18+
This label forces only the Prometheus instance deployed in the `openshift-user-workload-monitoring` project to evaluate the alerting rule and prevents the Thanos Ruler instance from doing so.
19+
+
20+
[IMPORTANT]
21+
====
22+
If an alerting rule has this label, your alerting rule can use only those metrics exposed by your user-defined project.
23+
Alerting rules you create based on default platform metrics might not trigger alerts.
24+
====

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="creating-alerting-rules-for-user-defined-projects_{context}"]
77
= Creating alerting rules for user-defined projects
88

9-
You can create alerting rules for user-defined projects. Those alerting rules will fire alerts based on the values of chosen metrics.
9+
You can create alerting rules for user-defined projects. Those alerting rules will trigger alerts based on the values of the chosen metrics.
1010

1111
.Prerequisites
1212

@@ -41,21 +41,10 @@ spec:
4141
----
4242
+
4343
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`.
44-
+
45-
[IMPORTANT]
46-
====
47-
A user-defined alerting rule can include metrics for its own project and cluster metrics. You cannot include metrics for another user-defined project.
48-
49-
For example, an alerting rule for the user-defined project `ns1` can have metrics from `ns1` and cluster metrics, such as the CPU and memory metrics. However, the rule cannot include metrics from `ns2`.
50-
51-
Additionally, you cannot create alerting rules for the `openshift-*` core {product-title} projects. {product-title} monitoring by default provides a set of alerting rules for these projects.
52-
====
5344

5445
. Apply the configuration file to the cluster:
5546
+
5647
[source,terminal]
5748
----
5849
$ oc apply -f example-app-alerting-rule.yaml
5950
----
60-
+
61-
It takes some time to create the alerting rule.

modules/monitoring-optimizing-alerting-for-user-defined-projects.adoc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,3 @@ You can optimize alerting for your own projects by considering the following rec
1717
* *Provide clear alert messaging*. State the symptom and recommended actions in the alert message.
1818
1919
* *Include severity levels in your alerting rules*. The severity of an alert depends on how you need to react if the reported symptom occurs. For example, a critical alert should be triggered if a symptom requires immediate attention by an individual or a critical response team.
20-
21-
* *Optimize alert routing*. Deploy an alerting rule directly on the Prometheus instance in the `openshift-user-workload-monitoring` project if the rule does not query default {product-title} metrics. This reduces latency for alerting rules and minimizes the load on monitoring components.
22-
+
23-
[WARNING]
24-
====
25-
Default {product-title} metrics for user-defined projects provide information about CPU and memory usage, bandwidth statistics, and packet rate information. Those metrics cannot be included in an alerting rule if you route the rule directly to the Prometheus instance in the `openshift-user-workload-monitoring` project. Alerting rule optimization should be used only if you have read the documentation and have a comprehensive understanding of the monitoring architecture.
26-
====

modules/monitoring-reducing-latency-for-alerting-rules-that-do-not-query-platform-metrics.adoc

Lines changed: 0 additions & 54 deletions
This file was deleted.

monitoring/managing-alerts.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ ifndef::openshift-rosa,openshift-dedicated[]
6969
* See xref:../monitoring/monitoring-overview.adoc#monitoring-overview[Monitoring overview] for details about {product-title} {product-version} monitoring architecture
7070
endif::[]
7171
72+
// creating alerting rules for user defined projects
73+
include::modules/monitoring-about-creating-alerting-rules-for-user-defined-projects.adoc[leveloffset=+2]
7274
include::modules/monitoring-creating-alerting-rules-for-user-defined-projects.adoc[leveloffset=+2]
73-
include::modules/monitoring-reducing-latency-for-alerting-rules-that-do-not-query-platform-metrics.adoc[leveloffset=+2]
7475

7576
[role="_additional-resources"]
7677
.Additional resources

0 commit comments

Comments
 (0)