From e4707322afe3f5b3cc69e745e01e624198b42f9c Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Thu, 14 May 2026 14:50:50 +0000 Subject: [PATCH] docs: Update Prometheus monitoring to reflect automated resource management The Che Operator now automatically creates and manages Prometheus resources (ServiceMonitor, RBAC, namespace labels) when metrics are enabled. Updated the documentation to reflect this automated behavior instead of manual setup procedures. Related PR: https://github.com/eclipse-che/che-operator/pull/2117 Co-Authored-By: Claude Sonnet 4.5 --- ...c_collecting-che-metrics-with-prometheus.adoc | 16 +++++++--------- ...rkspace-operator-metrics-with-prometheus.adoc | 15 +++++++++------ .../proc_enabling-and-exposing-che-metrics.adoc | 2 ++ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/modules/administration-guide/partials/proc_collecting-che-metrics-with-prometheus.adoc b/modules/administration-guide/partials/proc_collecting-che-metrics-with-prometheus.adoc index b86014256a..16798cb99a 100644 --- a/modules/administration-guide/partials/proc_collecting-che-metrics-with-prometheus.adoc +++ b/modules/administration-guide/partials/proc_collecting-che-metrics-with-prometheus.adoc @@ -3,7 +3,7 @@ [id="collecting-{prod-id-short}-metrics-with-prometheus"] = Collecting {prod-short} Server metrics with Prometheus -To use the in-cluster Prometheus instance to collect, store, and query JVM metrics for {prod-short} Server: +The {prod-short} Operator automatically configures the in-cluster Prometheus instance to collect, store, and query JVM metrics for {prod-short} Server. .Prerequisites @@ -13,9 +13,9 @@ To use the in-cluster Prometheus instance to collect, store, and query JVM metri * {prod-short} is exposing metrics on port `8087`. See xref:enabling-and-exposing-{prod-id-short}-metrics[Enabling and exposing {prod-short} server JVM metrics]. -.Procedure +The {prod-short} Operator automatically creates the following resources when metrics are enabled: -. Create the ServiceMonitor for detecting the {prod-short} JVM metrics Service. +* *ServiceMonitor* for detecting the {prod-short} JVM metrics Service + .ServiceMonitor ==== @@ -42,8 +42,7 @@ spec: <2> The rate at which a target is scraped. ==== -. Create a Role and RoleBinding to allow Prometheus to view the metrics. - +* *Role and RoleBinding* to allow Prometheus to view the metrics + .Role ==== @@ -68,7 +67,6 @@ rules: ---- <1> The {prod-short} namespace. The default is `{prod-namespace}`. ==== - + .RoleBinding ==== @@ -91,11 +89,11 @@ roleRef: <1> The {prod-short} namespace. The default is `{prod-namespace}`. ==== -. Allow the in-cluster Prometheus instance to detect the ServiceMonitor in the {prod-short} namespace. The default {prod-short} namespace is `{prod-namespace}`. +* *Namespace label* to allow the in-cluster Prometheus instance to detect the ServiceMonitor + -[source,terminal,subs="+attributes,quotes"] +[source,yaml,subs="+attributes,quotes"] ---- -$ oc label namespace {prod-namespace} openshift.io/cluster-monitoring=true +openshift.io/cluster-monitoring: "true" ---- .Verification diff --git a/modules/administration-guide/partials/proc_collecting-dev-workspace-operator-metrics-with-prometheus.adoc b/modules/administration-guide/partials/proc_collecting-dev-workspace-operator-metrics-with-prometheus.adoc index b198f24bd1..a092ae8177 100644 --- a/modules/administration-guide/partials/proc_collecting-dev-workspace-operator-metrics-with-prometheus.adoc +++ b/modules/administration-guide/partials/proc_collecting-dev-workspace-operator-metrics-with-prometheus.adoc @@ -2,7 +2,7 @@ = Collecting {devworkspace} Operator metrics [role="_abstract"] -To use the in-cluster Prometheus instance to collect, store, and query metrics about the {devworkspace} Operator: +The {prod-short} Operator automatically configures the in-cluster Prometheus instance to collect, store, and query metrics about the {devworkspace} Operator. .Prerequisites @@ -12,9 +12,9 @@ To use the in-cluster Prometheus instance to collect, store, and query metrics a * The `devworkspace-controller-metrics` Service is exposing metrics on port `8443`. This is preconfigured by default. -.Procedure +The {prod-short} Operator automatically creates the following resources: -. Create the ServiceMonitor for detecting the Dev Workspace Operator metrics Service. +* *ServiceMonitor* for detecting the {devworkspace} Operator metrics Service + .ServiceMonitor ==== @@ -44,13 +44,16 @@ spec: <2> The rate at which a target is scraped. ==== +* *Role and RoleBinding* to allow Prometheus to view the metrics + ++ include::example$snip_{project-context}-create-a-role-and-rolebinding-for-prometheus-to-view-metrics.adoc[] -. Allow the in-cluster Prometheus instance to detect the ServiceMonitor in the {prod-short} namespace. The default {prod-short} namespace is `{prod-namespace}`. +* *Namespace label* to allow the in-cluster Prometheus instance to detect the ServiceMonitor + -[source,subs="+attributes"] +[source,yaml,subs="+attributes,quotes"] ---- -$ oc label namespace {prod-namespace} openshift.io/cluster-monitoring=true +openshift.io/cluster-monitoring: "true" ---- .Verification diff --git a/modules/administration-guide/partials/proc_enabling-and-exposing-che-metrics.adoc b/modules/administration-guide/partials/proc_enabling-and-exposing-che-metrics.adoc index ae1669ce81..fcf57a6723 100644 --- a/modules/administration-guide/partials/proc_enabling-and-exposing-che-metrics.adoc +++ b/modules/administration-guide/partials/proc_enabling-and-exposing-che-metrics.adoc @@ -6,6 +6,8 @@ {prod-short} exposes the JVM metrics on port `8087` of the `che-host` Service. You can configure this behaviour. +When metrics are enabled, the {prod-short} Operator automatically creates the Prometheus ServiceMonitor and RBAC resources required for the in-cluster Prometheus instance to collect metrics. + .Procedure * Configure the `CheCluster` Custom Resource. See xref:using-the-cli-to-configure-the-checluster-custom-resource.adoc[].