Skip to content

Commit 54b2596

Browse files
author
Bob Furu
authored
Merge pull request #22879 from rh-max/enterprise-4.5-user-workload-monitoring
Updates to the "Monitoring your own services" section
2 parents f75da6b + 25ed7e3 commit 54b2596

16 files changed

+282
-113
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * monitoring/monitoring-your-own-services.adoc
4+
5+
[id="accessing-alerting-rules-for-all-namespaces_{context}"]
6+
= Accessing alerting rules for all namespaces
7+
8+
As a cluster administrator, you can access alerting rules from all namespaces together in a single view.
9+
10+
[NOTE]
11+
====
12+
In a future release, the route to the Thanos Ruler UI will be deprecated in favor of the web console.
13+
====
14+
15+
.Prerequisites
16+
17+
* Have the `oc` command installed.
18+
* Log in as a cluster administrator.
19+
20+
.Procedure
21+
22+
. List routes for the `openshift-user-workload-monitoring` namespace:
23+
+
24+
----
25+
$ oc -n openshift-user-workload-monitoring get routes
26+
----
27+
+
28+
The output shows the URL for the Thanos Ruler UI:
29+
+
30+
----
31+
NAME HOST/PORT
32+
...
33+
thanos-ruler thanos-ruler-openshift-user-workload-monitoring.apps.example.devcluster.openshift.com
34+
----
35+
36+
. Navigate to the listed URL. Here you can see user alerting rules from all namespaces.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * monitoring/monitoring-your-own-services.adoc
4+
5+
[id="accessing-alerting-rules-for-your-project_{context}"]
6+
= Accessing alerting rules for your project
7+
8+
You can list existing alerting rules for your project.
9+
10+
.Prerequisites
11+
12+
* Log in as a user with the `monitoring-rules-view` role against your project.
13+
14+
.Procedure
15+
16+
. To list alerting rules in <project>, run:
17+
+
18+
----
19+
$ oc -n <project> get prometheusrule
20+
----
21+
22+
. To list the configuration of an alerting rule, run:
23+
+
24+
----
25+
$ oc -n <project> get prometheusrule <rule> -oyaml
26+
----
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * monitoring/monitoring-your-own-services.adoc
4+
5+
[id="accessing-metrics-of-all-services-as-a-cluster-administrator_{context}"]
6+
= Accessing metrics of all services as a cluster administrator
7+
8+
If you are a cluster administrator or a user with view permissions for all namespaces, you can access metrics of all services from all namespaces together in a single view.
9+
10+
.Prerequisites
11+
12+
* Log in to the web console as a cluster administrator or a user with view permissions for all namespaces.
13+
* Optionally, log in with the `oc` command as well.
14+
15+
.Procedure
16+
17+
* Using the Metrics web interface:
18+
+
19+
--
20+
. Go to the {product-title} web console, switch to the Administrator Perspective, and click *Monitoring* -> *Metrics*.
21+
+
22+
[NOTE]
23+
====
24+
Cluster administrators, when using the Administrator Perspective, have access to all cluster metrics and to custom service metrics from all projects.
25+
====
26+
+
27+
[NOTE]
28+
====
29+
Only cluster administrators have access to the third-party UIs provided with {product-title} Monitoring.
30+
====
31+
32+
. Use the PromQL interface to run queries for your services.
33+
--
34+
35+
* Using the Thanos Querier UI:
36+
+
37+
[NOTE]
38+
====
39+
In a future release, the route to the Thanos Querier UI will be deprecated in favor of the web console.
40+
====
41+
+
42+
--
43+
. List routes for the `openshift-monitoring` namespace:
44+
+
45+
----
46+
$ oc -n openshift-monitoring get routes
47+
----
48+
+
49+
The output shows the URL for the Thanos Querier UI:
50+
+
51+
----
52+
NAME HOST/PORT
53+
...
54+
thanos-querier thanos-querier-openshift-monitoring.apps.example.devcluster.openshift.com
55+
----
56+
57+
. Navigate to the listed URL. Here you can see all metrics from all namespaces.
58+
--
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * monitoring/monitoring-your-own-services.adoc
4+
5+
[id="accessing-the-metrics-of-your-service-as-a-developer_{context}"]
6+
= Accessing the metrics of your service as a developer
7+
8+
After you have enabled monitoring your own services, deployed a service, and set up metrics collection for the service, you can access the metrics of the service as a developer or as a user with view permissions for the project.
9+
10+
[NOTE]
11+
====
12+
The Grafana instance shipped within {product-title} Monitoring is read-only and displays only infrastructure-related dashboards.
13+
====
14+
15+
.Prerequisites
16+
17+
* Deploy the service that you want to monitor.
18+
* Enable monitoring of your own services.
19+
* Have metrics scraping set up for the service.
20+
* Log in as a developer or as a user with view permissions for the project.
21+
22+
.Procedure
23+
24+
. Go to the {product-title} web console, switch to the Developer Perspective, then click *Advanced* -> *Metrics*. Select the project you want to see the metrics for.
25+
+
26+
[NOTE]
27+
====
28+
Developers can only use the Developer Perspective and not the Administrator Perspective. They can only query metrics from a single project. They cannot access the third-party UIs provided with {product-title} Monitoring.
29+
====
30+
. Use the PromQL interface to run queries for your services.

modules/monitoring-accessing-the-metrics-of-your-service.adoc

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

modules/monitoring-creating-alerting-rules.adoc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
[id="creating-alerting-rules_{context}"]
66
= Creating alerting rules
77

8-
You can create alerting rules, which will fire alerts based on values of chosen metrics of the service.
8+
You can create alerting rules, which will fire alerts based on values of chosen metrics.
99

1010
[NOTE]
1111
====
12-
In the current version of the Technology Preview, only administrators can access alerting rules using the Prometheus UI and the Web Console.
12+
Viewing and managing your rules and alerts is not yet integrated into the web console. A cluster administrator can instead use the Alertmanager UI or the Thanos Ruler. See the respective sections for instructions.
1313
====
1414

15+
.Prerequisites
16+
17+
* Log in as a user that has the `monitoring-rules-edit` role for the namespace where you want to create the alerting rule.
18+
1519
.Procedure
1620

1721
. Create a YAML file for alerting rules. In this example, it is called `example-app-alerting-rule.yaml`.
@@ -20,7 +24,7 @@ In the current version of the Technology Preview, only administrators can access
2024
+
2125
[NOTE]
2226
====
23-
The expression can only reference metrics exposed by your own services. Currently it is not possible to correlate existing cluster metrics.
27+
When you create an alerting rule, a namespace label is enforced on it if a rule with the same name exists in another namespace.
2428
====
2529
+
2630
[source,yaml]
@@ -39,6 +43,15 @@ spec:
3943
----
4044
+
4145
This configuration creates an alerting rule named `example-alert`, which fires an alert when the `version` metric exposed by the sample service becomes `0`.
46+
+
47+
[IMPORTANT]
48+
====
49+
For every namespace, you can use metrics of that namespace and cluster metrics, but not metrics of another namespace.
50+
51+
For example, an alerting rule for `ns1` can have metrics from `ns1` and cluster metrics, such as the CPU and memory metrics. However, the rule cannot include metrics from `ns2`.
52+
53+
Additionally, you cannot create alerting rules for the `openshift-*` core OpenShift namespaces. {product-title} Monitoring by default provides a set of alerting rules for these namespaces.
54+
====
4255

4356
. Apply the configuration file to the cluster:
4457
+

modules/monitoring-enabling-monitoring-of-your-own-services.adoc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ data:
3535

3636
. Save the file to apply the changes. Monitoring your own services is enabled automatically.
3737

38-
. Optional: You can check that the `prometheus-user-workload` pods were created:
38+
. Optional: You can check that the `prometheus-user-workload` Pods were created:
3939
+
4040
----
4141
$ oc -n openshift-user-workload-monitoring get pod
42-
NAME READY STATUS RESTARTS AGE
43-
prometheus-operator-85bbb7b64d-7jwjd 1/1 Running 0 3m24s
44-
prometheus-user-workload-0 5/5 Running 1 3m13s
45-
prometheus-user-workload-1 5/5 Running 1 3m13s
42+
NAME READY STATUS RESTARTS AGE
43+
prometheus-operator-6f7b748d5b-t7nbg 2/2 Running 0 3h
44+
prometheus-user-workload-0 5/5 Running 1 3h
45+
prometheus-user-workload-1 5/5 Running 1 3h
46+
thanos-ruler-user-workload-0 3/3 Running 0 3h
47+
thanos-ruler-user-workload-1 3/3 Running 0 3h
4648
----

modules/monitoring-examining-metrics-as-a-developer.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
[id="non-administrator-access-to-metrics_{context}"]
66
= Non-administrator access to metrics
77

8-
As a developer, one can enable user workload monitoring for an application or service in a project. As an administrator, you use the same feature to enable monitoring for infrastructure workloads. In that case, a developer or administrator of that project can examine the exposed metrics using the Developer Perspective in the Web console.
8+
As a developer, one can enable user workload monitoring for an application or service in a project. As an administrator, you use the same feature to enable monitoring for infrastructure workloads. In that case, a developer or administrator of that project can examine the exposed metrics using the Developer Perspective in the web console.

modules/monitoring-giving-view-access-to-a-user.adoc

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

modules/monitoring-granting-the-role-to-a-user.adoc

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

0 commit comments

Comments
 (0)