Verify OpenShift Dev Spaces Server metrics collection with Prometheus
Verify that OpenShift Dev Spaces Server JVM metrics are available in Prometheus. The OpenShift Dev Spaces Operator automatically creates and reconciles the required Prometheus resources (ServiceMonitor, Role, and RoleBinding) and configures namespace labeling.
Before you begin
- You have an active
ocsession with administrative permissions to the OpenShift cluster. See This page is not included, but the link has been rewritten to point to the nearest parent document.Getting started with the CLI. - OpenShift Dev Spaces is installed and running on the OpenShift cluster.
Procedure
- In the Administrator view of the OpenShift web console, go to Observe → Metrics.
- Run a PromQL query to confirm that the metrics are available. For example, enter
process_uptime_seconds{job="che-host"}and click Run queries.
Results
- The query returns data points from the OpenShift Dev Spaces Server JVM.
If the query returns no data, view the Prometheus container logs for possible RBAC-related errors:
- Get the name of the Prometheus pod:
$ oc get pods -l app.kubernetes.io/name=prometheus -n openshift-monitoring -o=jsonpath='{.items[*].metadata.name}' - Print the last 20 lines of the Prometheus container logs from the Prometheus pod from the previous step:
$ oc logs --tail=20 <prometheus_pod_name> -c prometheus -n openshift-monitoring