Enabling user workload monitoring
Enable user workload monitoring to track metrics for your user-defined projects. Configuring this feature allows you to observe application performance and helps you maintain the health of your services.
Prerequisites
-
You have access to the cluster as a user with the
cluster-admincluster role.
Procedure
-
Create the
cluster-monitoring-config.yamlfile to define and configure theConfigMap:apiVersion: v1 kind: ConfigMap metadata: name: cluster-monitoring-config namespace: openshift-monitoring data: config.yaml: | enableUserWorkload: true -
Apply the
ConfigMapby running the following command:$ oc apply -f cluster-monitoring-config.yaml
Verification
-
Verify that the monitoring components for user workloads are running in the
openshift-user-workload-monitoringnamespace:$ oc -n openshift-user-workload-monitoring get podExample outputNAME READY STATUS RESTARTS AGE prometheus-operator-6cb6bd9588-dtzxq 2/2 Running 0 50s prometheus-user-workload-0 6/6 Running 0 48s prometheus-user-workload-1 6/6 Running 0 48s thanos-ruler-user-workload-0 4/4 Running 0 42s thanos-ruler-user-workload-1 4/4 Running 0 42s
The status of the pods such as prometheus-operator, prometheus-user-workload, and thanos-ruler-user-workload must be Running.