Skip to content

Commit 26772e2

Browse files
authored
Merge pull request #90615 from eromanova97/OBSDOCS-1725
OBSDOCS-1725: More Transparent statement about how the label namespac…
2 parents 53ab59d + f45e3a8 commit 26772e2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

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

9-
You can create alerting rules for user-defined projects that are not bound to their project of origin by configuring a project in the `user-workload-monitoring-config` config map. This allows you to create generic alerting rules that get applied to multiple user-defined projects instead of having individual `PrometheusRule` objects in each user project.
9+
You can create alerting rules that are not bound to their project of origin by configuring a project in the `user-workload-monitoring-config` config map. The `PrometheusRule` objects created in these projects are then applicable to all projects.
10+
11+
Therefore, you can have generic alerting rules that apply to multiple user-defined projects instead of having individual `PrometheusRule` objects in each user project. You can filter which projects are included or excluded from the alerting rule by using PromQL queries in the `PrometheusRule` object.
1012

1113
.Prerequisites
1214

@@ -48,10 +50,10 @@ metadata:
4850
namespace: openshift-user-workload-monitoring
4951
data:
5052
config.yaml: |
51-
namespacesWithoutLabelEnforcement: [ <namespace> ] # <1>
53+
namespacesWithoutLabelEnforcement: [ <namespace1>, <namespace2> ] # <1>
5254
# ...
5355
----
54-
<1> Specify one or more projects in which you want to create cross-project alerting rules. Prometheus and Thanos Ruler for user-defined monitoring do not enforce the `namespace` label in `PrometheusRule` objects created in these projects.
56+
<1> Specify one or more projects in which you want to create cross-project alerting rules. Prometheus and Thanos Ruler for user-defined monitoring do not enforce the `namespace` label in `PrometheusRule` objects created in these projects, making the `PrometheusRule` objects applicable to all projects.
5557

5658
. Create a YAML file for alerting rules. In this example, it is called `example-cross-project-alerting-rule.yaml`.
5759

@@ -81,7 +83,7 @@ spec:
8183
<1> Ensure that you specify the project that you defined in the `namespacesWithoutLabelEnforcement` field.
8284
<2> The name of the alerting rule you want to create.
8385
<3> The duration for which the condition should be true before an alert is fired.
84-
<4> The PromQL query expression that defines the new rule.
86+
<4> The PromQL query expression that defines the new rule. You can use label matchers on the `namespace` label to filter which projects are included or excluded from the alerting rule.
8587
<5> The message associated with the alert.
8688
<6> The severity that alerting rule assigns to the alert.
8789
+

0 commit comments

Comments
 (0)