Monitoring Che Server
You can configure Che to expose JVM metrics such as JVM memory and class loading for Che Server.
Enabling and exposing Che Server metrics
Che exposes the JVM metrics on port 8087 of the che-host Service.
You can configure this behaviour.
-
Configure the
CheClusterCustom Resource. See Using the CLI to configure the CheCluster Custom Resource.spec: components: metrics: enable: <boolean> (1)1 trueto enable,falseto disable.
When metrics are enabled, the Che Operator automatically creates the necessary Prometheus resources (ServiceMonitor, Role, and RoleBinding) and adds the openshift.io/cluster-monitoring=true label to the Che namespace to enable metrics collection by the in-cluster Prometheus instance.
|
Collecting Che Server metrics with Prometheus
The Che Operator automatically manages the Prometheus resources required to collect Che Server metrics when metrics are enabled.
-
Your organization’s instance of Che is installed and running in Red Hat OpenShift.
-
Che metrics are enabled. See Enabling and exposing Che server JVM metrics.
The Che Operator automatically creates and manages the following resources when spec.components.metrics.enable is set to true:
-
A
ServiceMonitorobject namedche-hostto scrape metrics from the Che Server -
A
RoleandRoleBindingto grant theprometheus-k8sservice account permission to scrape metrics -
The
openshift.io/cluster-monitoring=truelabel on the Che namespace to enable discovery by the in-cluster Prometheus instance
No manual configuration is required.
-
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.
|
To troubleshoot missing metrics, view the Prometheus container logs for possible RBAC-related errors:
|
Viewing Che Server from an OpenShift web console dashboard
After configuring the in-cluster Prometheus instance to collect Che Server JVM metrics, you can view the metrics on a custom dashboard in the Administrator perspective of the OpenShift web console.
-
Your organization’s instance of Che is installed and running in Red Hat OpenShift.
-
An active
ocsession with administrative permissions to the destination OpenShift cluster. See Getting started with the CLI. -
The in-cluster Prometheus instance is collecting metrics. See Collecting Che Server metrics with Prometheus.
-
Create a ConfigMap for the dashboard definition in the
openshift-config-managednamespace and apply the necessary label.-
$ oc create configmap grafana-dashboard-devspaces-server \ --from-literal=devspaces-server-dashboard.json="$(curl https://raw.githubusercontent.com/eclipse-che/che-server/main/docs/grafana/openshift-console-dashboard.json)" \ -n openshift-config-managed -
$ oc label configmap grafana-dashboard-devspaces-server console.openshift.io/dashboard=true -n openshift-config-managedThe dashboard definition is based on Grafana 6.x dashboards. Not all Grafana 6.x dashboard features are supported in the OpenShift web console.
-
-
In the Administrator view of the OpenShift web console, go to Observe → Dashboards.
-
Go to Dashboard → Che Server JVM and verify that the dashboard panels contain data.







