Skip to content

Commit 0b64248

Browse files
authored
Merge pull request #91395 from eromanova97/manual-cp-91118-to-4.16
[enterprise-4.16] OBSDOCS-1324: Improve 'troubleshooting monitoring issues: Investigati…
2 parents 38d8911 + f0aa260 commit 0b64248

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

modules/monitoring-investigating-why-user-defined-metrics-are-unavailable.adoc

+35-7
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,42 @@ endif::openshift-rosa,openshift-dedicated[]
1717
ifdef::openshift-rosa,openshift-dedicated[]
1818
* You have access to the cluster as a user with the `dedicated-admin` role.
1919
endif::openshift-rosa,openshift-dedicated[]
20-
* You have installed the OpenShift CLI (`oc`).
20+
* You have installed the {oc-first}.
2121
* You have enabled and configured monitoring for user-defined projects.
2222
* You have created a `ServiceMonitor` resource.
2323

2424
.Procedure
2525

26-
. *Check that the corresponding labels match* in the service and `ServiceMonitor` resource configurations.
27-
.. Obtain the label defined in the service. The following example queries the `prometheus-example-app` service in the `ns1` project:
26+
. Ensure that your project is not excluded from user workload monitoring. The following examples use the `ns1` project.
27+
28+
.. Verify that the project _does not_ have the `openshift.io/user-monitoring=false` label attached:
29+
+
30+
[source,terminal]
31+
----
32+
$ oc get namespace ns1 --show-labels | grep 'openshift.io/user-monitoring=false'
33+
----
34+
+
35+
[NOTE]
36+
====
37+
The default label set for user workload projects is `openshift.io/user-monitoring=true`. However, the label is not visible unless you manually apply it.
38+
====
39+
40+
.. If the label is attached, remove the label:
41+
+
42+
.Example of removing the label from the project
43+
[source,terminal]
44+
----
45+
$ oc label namespace ns1 'openshift.io/user-monitoring-'
46+
----
47+
+
48+
.Example output
49+
[source,terminal]
50+
----
51+
namespace/ns1 unlabeled
52+
----
53+
54+
. Check that the corresponding labels match in the service and `ServiceMonitor` resource configurations. The following examples use the `prometheus-example-app` service, the `prometheus-example-monitor` service monitor, and the `ns1` project.
55+
.. Obtain the label defined in the service.
2856
+
2957
[source,terminal]
3058
----
@@ -38,7 +66,7 @@ $ oc -n ns1 get service prometheus-example-app -o yaml
3866
app: prometheus-example-app
3967
----
4068
+
41-
.. Check that the `matchLabels` definition in the `ServiceMonitor` resource configuration matches the label output in the preceding step. The following example queries the `prometheus-example-monitor` service monitor in the `ns1` project:
69+
.. Check that the `matchLabels` definition in the `ServiceMonitor` resource configuration matches the label output in the preceding step.
4270
+
4371
[source,terminal]
4472
----
@@ -68,7 +96,7 @@ spec:
6896
You can check service and `ServiceMonitor` resource labels as a developer with view permissions for the project.
6997
====
7098

71-
. *Inspect the logs for the Prometheus Operator* in the `openshift-user-workload-monitoring` project.
99+
. Inspect the logs for the Prometheus Operator in the `openshift-user-workload-monitoring` project.
72100
.. List the pods in the `openshift-user-workload-monitoring` project:
73101
+
74102
[source,terminal]
@@ -101,14 +129,14 @@ If there is a issue with the service monitor, the logs might include an error si
101129
level=warn ts=2020-08-10T11:48:20.906739623Z caller=operator.go:1829 component=prometheusoperator msg="skipping servicemonitor" error="it accesses file system via bearer token file which Prometheus specification prohibits" servicemonitor=eagle/eagle namespace=openshift-user-workload-monitoring prometheus=user-workload
102130
----
103131

104-
. *Review the target status for your endpoint* on the *Metrics targets* page in the {product-title} web console UI.
132+
. Review the target status for your endpoint on the *Metrics targets* page in the {product-title} web console UI.
105133
.. Log in to the {product-title} web console and navigate to *Observe**Targets* in the *Administrator* perspective.
106134

107135
.. Locate the metrics endpoint in the list, and review the status of the target in the *Status* column.
108136

109137
.. If the *Status* is *Down*, click the URL for the endpoint to view more information on the *Target Details* page for that metrics target.
110138

111-
. *Configure debug level logging for the Prometheus Operator* in the `openshift-user-workload-monitoring` project.
139+
. Configure debug level logging for the Prometheus Operator in the `openshift-user-workload-monitoring` project.
112140
.. Edit the `user-workload-monitoring-config` `ConfigMap` object in the `openshift-user-workload-monitoring` project:
113141
+
114142
[source,terminal]

0 commit comments

Comments
 (0)