Skip to content

Commit 38f2930

Browse files
authored
Merge pull request #91401 from eromanova97/OBSDOCS-1326
OBSDOCS#1326: Improve 'troubleshooting monitoring issues, - post OCPBUGS#39126
2 parents e18e6fc + ddc1fc5 commit 38f2930

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

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

+15-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ endif::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
2323

2424
.Procedure
2525

26-
. Ensure that your project is not excluded from user workload monitoring. The following examples use the `ns1` project.
26+
. Ensure that your project and resources are not excluded from user workload monitoring. The following examples use the `ns1` project.
2727

2828
.. Verify that the project _does not_ have the `openshift.io/user-monitoring=false` label attached:
2929
+
@@ -37,6 +37,13 @@ $ oc get namespace ns1 --show-labels | grep 'openshift.io/user-monitoring=false'
3737
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.
3838
====
3939

40+
.. Verify that the `ServiceMonitor` and `PodMonitor` resources _do not_ have the `openshift.io/user-monitoring=false` label attached. The following example checks the `prometheus-example-monitor` service monitor.
41+
+
42+
[source,terminal]
43+
----
44+
$ oc -n ns1 get servicemonitor prometheus-example-monitor --show-labels | grep 'openshift.io/user-monitoring=false'
45+
----
46+
4047
.. If the label is attached, remove the label:
4148
+
4249
.Example of removing the label from the project
@@ -45,6 +52,12 @@ The default label set for user workload projects is `openshift.io/user-monitorin
4552
$ oc label namespace ns1 'openshift.io/user-monitoring-'
4653
----
4754
+
55+
.Example of removing the label from the resource
56+
[source,terminal]
57+
----
58+
$ oc -n ns1 label servicemonitor prometheus-example-monitor 'openshift.io/user-monitoring-'
59+
----
60+
+
4861
.Example output
4962
[source,terminal]
5063
----
@@ -66,7 +79,7 @@ $ oc -n ns1 get service prometheus-example-app -o yaml
6679
app: prometheus-example-app
6780
----
6881
+
69-
.. Check that the `matchLabels` definition in the `ServiceMonitor` resource configuration matches the label output in the preceding step.
82+
.. Check that the `matchLabels` definition in the `ServiceMonitor` resource configuration matches the label output in the previous step.
7083
+
7184
[source,terminal]
7285
----

0 commit comments

Comments
 (0)