From 0ddd59e85ffc722069c2044cab76b5137f6a5885 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 15 May 2026 11:17:11 +0000 Subject: [PATCH] procedures: Update monitoring procedures for automated Prometheus resources The Che Operator now automatically manages Prometheus monitoring resources (ServiceMonitor, Role, RoleBinding) when metrics are enabled. Updated the monitoring procedures to reflect this automation and removed manual configuration steps. Related PR: https://github.com/eclipse-che/che-operator/pull/2117 Co-Authored-By: Claude Sonnet 4.5 --- .../pages/monitoring-che.adoc | 6 +- ...monitoring-the-dev-workspace-operator.adoc | 6 +- ...ollecting-che-metrics-with-prometheus.adoc | 86 ++----------------- ...pace-operator-metrics-with-prometheus.adoc | 42 ++------- 4 files changed, 18 insertions(+), 122 deletions(-) diff --git a/modules/administration-guide/pages/monitoring-che.adoc b/modules/administration-guide/pages/monitoring-che.adoc index bb2e75effb..a31868cb44 100644 --- a/modules/administration-guide/pages/monitoring-che.adoc +++ b/modules/administration-guide/pages/monitoring-che.adoc @@ -1,13 +1,13 @@ :_content-type: ASSEMBLY -:description: Monitoring {prod-short} Server -:keywords: administration-guide, monitoring-che +:description: Monitoring {prod-short} Server with Prometheus +:keywords: administration-guide, monitoring-che, prometheus, metrics :navtitle: Monitoring {prod-short} Server :page-aliases: .:monitoring-che.adoc, .:tracing-che.adoc, tracing-che.adoc [id="monitoring-{prod-id-short}"] = Monitoring {prod-short} Server -You can configure {prod-short} to expose JVM metrics such as JVM memory and class loading for {prod-short} Server. +You can configure {prod-short} to expose JVM metrics such as JVM memory and class loading for {prod-short} Server. The {prod-short} Operator automatically configures Prometheus integration when metrics are enabled. include::partial$proc_enabling-and-exposing-che-metrics.adoc[leveloffset=+1] diff --git a/modules/administration-guide/pages/monitoring-the-dev-workspace-operator.adoc b/modules/administration-guide/pages/monitoring-the-dev-workspace-operator.adoc index ca14505223..1556ba4fe7 100644 --- a/modules/administration-guide/pages/monitoring-the-dev-workspace-operator.adoc +++ b/modules/administration-guide/pages/monitoring-the-dev-workspace-operator.adoc @@ -1,6 +1,6 @@ :_content-type: ASSEMBLY -:description: Monitoring the {devworkspace} Operator -:keywords: administration-guide, monitoring-the-dev-workspace-operator +:description: Monitoring the {devworkspace} Operator with Prometheus +:keywords: administration-guide, monitoring-the-dev-workspace-operator, prometheus, metrics :navtitle: Monitoring the {devworkspace} Operator :page-aliases: .:monitoring-the-dev-workspace-operator.adoc @@ -8,7 +8,7 @@ [id="monitoring-the-dev-workspace-operator"] = Monitoring the {devworkspace} Operator -You can configure the OpenShift in-cluster monitoring stack to scrape metrics exposed by the {devworkspace} Operator. +You can configure the OpenShift in-cluster monitoring stack to scrape metrics exposed by the {devworkspace} Operator. The {prod-short} Operator automatically configures Prometheus integration when metrics are enabled. include::partial$proc_collecting-dev-workspace-operator-metrics-with-prometheus.adoc[leveloffset=+1] 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..076a1cab50 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 @@ -15,88 +15,14 @@ To use the in-cluster Prometheus instance to collect, store, and query JVM metri .Procedure -. Create the ServiceMonitor for detecting the {prod-short} JVM metrics Service. -+ -.ServiceMonitor -==== -[source,yaml,subs="+quotes,+attributes,+macros"] ----- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: che-host - namespace: {prod-namespace} <1> -spec: - endpoints: - - interval: 10s <2> - port: metrics - scheme: http - namespaceSelector: - matchNames: - - {prod-namespace} <1> - selector: - matchLabels: - app.kubernetes.io/name: {prod-deployment} ----- -<1> The {prod-short} namespace. The default is `{prod-namespace}`. -<2> The rate at which a target is scraped. -==== - -. Create a Role and RoleBinding to allow Prometheus to view the metrics. - -+ -.Role -==== -[source,yaml,subs="+quotes,+attributes,+macros"] ----- -kind: Role -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: prometheus-k8s - namespace: {prod-namespace} <1> -rules: - - verbs: - - get - - list - - watch - apiGroups: - - '' - resources: - - services - - endpoints - - pods ----- -<1> The {prod-short} namespace. The default is `{prod-namespace}`. -==== +The {prod-short} Operator automatically creates the following resources when metrics are enabled: -+ -.RoleBinding -==== -[source,yaml,subs="+quotes,+attributes,+macros"] ----- -kind: RoleBinding -apiVersion: rbac.authorization.k8s.io/v1 -metadata: - name: view-{prod-id-short}-openshift-monitoring-prometheus-k8s - namespace: {prod-namespace} <1> -subjects: - - kind: ServiceAccount - name: prometheus-k8s - namespace: openshift-monitoring -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: prometheus-k8s ----- -<1> The {prod-short} namespace. The default is `{prod-namespace}`. -==== +* A `ServiceMonitor` named `{prod-host}` that detects the {prod-short} JVM metrics Service +* A `Role` named `{prod-id-short}-prometheus` that grants permissions to access services, endpoints, and pods +* A `RoleBinding` named `{prod-id-short}-prometheus` that binds the `prometheus-k8s` ServiceAccount from the `openshift-monitoring` namespace to the Role +* The `openshift.io/cluster-monitoring: "true"` label on the {prod-short} namespace to enable the in-cluster Prometheus instance to detect the ServiceMonitor -. Allow the in-cluster Prometheus instance to detect the ServiceMonitor in the {prod-short} namespace. The default {prod-short} namespace is `{prod-namespace}`. -+ -[source,terminal,subs="+attributes,quotes"] ----- -$ oc label namespace {prod-namespace} openshift.io/cluster-monitoring=true ----- +No manual configuration is required. The Prometheus resources are managed automatically by the {prod-short} Operator and will be removed when the `CheCluster` is deleted. .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..9d2b7da830 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 @@ -14,44 +14,14 @@ To use the in-cluster Prometheus instance to collect, store, and query metrics a .Procedure -. Create the ServiceMonitor for detecting the Dev Workspace Operator metrics Service. -+ -.ServiceMonitor -==== -[source,yaml,subs="+quotes,+attributes,+macros"] ----- -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - name: devworkspace-controller - namespace: {prod-namespace} <1> -spec: - endpoints: - - bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token - interval: 10s <2> - port: metrics - scheme: https - tlsConfig: - insecureSkipVerify: true - namespaceSelector: - matchNames: - - openshift-operators - selector: - matchLabels: - app.kubernetes.io/name: devworkspace-controller ----- -<1> The {prod-short} namespace. The default is `{prod-namespace}`. -<2> The rate at which a target is scraped. -==== +The {prod-short} Operator automatically creates the following resources when metrics are enabled: -include::example$snip_{project-context}-create-a-role-and-rolebinding-for-prometheus-to-view-metrics.adoc[] +* A `ServiceMonitor` named `devworkspace-controller` that detects the {devworkspace} Operator metrics Service +* A `Role` named `{prod-id-short}-prometheus` that grants permissions to access services, endpoints, and pods in the `openshift-operators` namespace +* A `RoleBinding` named `{prod-id-short}-prometheus` that binds the `prometheus-k8s` ServiceAccount from the `openshift-monitoring` namespace to the Role +* The `openshift.io/cluster-monitoring: "true"` label on the {prod-short} namespace to enable the in-cluster Prometheus instance to detect the ServiceMonitor -. Allow the in-cluster Prometheus instance to detect the ServiceMonitor in the {prod-short} namespace. The default {prod-short} namespace is `{prod-namespace}`. -+ -[source,subs="+attributes"] ----- -$ oc label namespace {prod-namespace} openshift.io/cluster-monitoring=true ----- +No manual configuration is required. The Prometheus resources are managed automatically by the {prod-short} Operator and will be removed when the `CheCluster` is deleted. .Verification