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 oc session with administrative permissions to the OpenShift cluster. See Getting started with the CLI.
  • OpenShift Dev Spaces is installed and running on the OpenShift cluster.

Procedure

  1. In the Administrator view of the OpenShift web console, go to Observe Metrics.
  2. 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:

  1. Get the name of the Prometheus pod:
    $ oc get pods -l app.kubernetes.io/name=prometheus -n openshift-monitoring -o=jsonpath='{.items[*].metadata.name}'
  2. 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