Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
====
Expand All @@ -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
====
Expand All @@ -68,7 +67,6 @@ rules:
----
<1> The {prod-short} namespace. The default is `{prod-namespace}`.
====

+
.RoleBinding
====
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
====
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[].
Expand Down
Loading