diff --git a/artifacts/attributes.adoc b/artifacts/attributes.adoc index 0659a975e9..10ac4d3b34 100644 --- a/artifacts/attributes.adoc +++ b/artifacts/attributes.adoc @@ -25,6 +25,7 @@ // minimum and current latest supported versions :ocp-version-min: 4.12 :ocp-version: 4.15 +:oc-first: pass:quotes[OpenShift CLI (`oc`)] // Partner Platforms :aws-brand-name: Amazon Web Services diff --git a/assemblies/assembly-rhdh-observability.adoc b/assemblies/assembly-rhdh-observability.adoc new file mode 100644 index 0000000000..a954ee8de9 --- /dev/null +++ b/assemblies/assembly-rhdh-observability.adoc @@ -0,0 +1,17 @@ +:_mod-docs-content-type: ASSEMBLY +[id="assembly-rhdh-observability"] += Enabling observability for {product} on {ocp-short} +:context: assembly-rhdh-observability + +toc::[] + +// Metrics +In {ocp-short}, metrics are exposed through an HTTP service endpoint under the `/metrics` canonical name. You can create a `ServiceMonitor` custom resource (CR) to scrape metrics from a service endpoint in a user-defined project. + +include::modules/observability/proc-admin-enabling-metrics-ocp-helm.adoc[leveloffset=+1] +include::modules/observability/proc-admin-enabling-metrics-ocp-operator.adoc[leveloffset=+1] + +[role="_additional-resources"] +[id="additional-resources_{context}"] +== Additional resources +* link:https://docs.openshift.com/container-platform/latest/observability/monitoring/managing-metrics.html[{ocp-short} - Managing metrics] diff --git a/images/rhdh/helm-upgrade.png b/images/rhdh/helm-upgrade.png new file mode 100644 index 0000000000..c2568814ee Binary files /dev/null and b/images/rhdh/helm-upgrade.png differ diff --git a/images/rhdh/upgrade-helm-metrics.png b/images/rhdh/upgrade-helm-metrics.png new file mode 100644 index 0000000000..2bffa0c7f6 Binary files /dev/null and b/images/rhdh/upgrade-helm-metrics.png differ diff --git a/modules/observability/proc-admin-enabling-metrics-ocp-helm.adoc b/modules/observability/proc-admin-enabling-metrics-ocp-helm.adoc new file mode 100644 index 0000000000..91d572b74c --- /dev/null +++ b/modules/observability/proc-admin-enabling-metrics-ocp-helm.adoc @@ -0,0 +1,43 @@ +// Module included in the following assemblies: +// +// * assemblies/assembly-rhdh-observability.adoc + +:_mod-docs-content-type: PROCEDURE +[id="proc-admin-enabling-metrics-ocp-helm_{context}"] += Enabling metrics monitoring in a Helm chart installation on an {ocp-short} cluster + +You can enable and view metrics for a {product} Helm deployment from the *Developer* perspective of the {ocp-short} web console. + +.Prerequisites + +* Your {ocp-short} cluster has link:https://docs.openshift.com/container-platform/latest/observability/monitoring/enabling-monitoring-for-user-defined-projects.html[monitoring for user-defined projects] enabled. +* You have installed {product} on {ocp-short} using the Helm chart. + +.Procedure + +. From the *Developer* perspective in the {ocp-short} web console, select the *Topology* view. +. Click the overflow menu of the {product} Helm chart, and select *Upgrade*. ++ +image::rhdh/helm-upgrade.png[] + +. On the *Upgrade Helm Release* page, select the *YAML view* option in *Configure via*, then configure the `metrics` section in the YAML, as shown in the following example: ++ +[source,yaml] +---- +upstream: +# ... + metrics: + serviceMonitor: + enabled: true + path: /metrics +# ... +---- ++ +image::rhdh/upgrade-helm-metrics.png[] + +. Click *Upgrade*. + +.Verification + +. From the *Developer* perspective in the {ocp-short} web console, select the *Observe* view. +. Click the *Metrics* tab to view metrics for {product} pods. diff --git a/modules/observability/proc-admin-enabling-metrics-ocp-operator.adoc b/modules/observability/proc-admin-enabling-metrics-ocp-operator.adoc new file mode 100644 index 0000000000..c1b247fc5d --- /dev/null +++ b/modules/observability/proc-admin-enabling-metrics-ocp-operator.adoc @@ -0,0 +1,57 @@ +// Module included in the following assemblies: +// +// * assemblies/assembly-rhdh-observability.adoc + +:_mod-docs-content-type: PROCEDURE +[id="proc-admin-enabling-metrics-ocp-operator_{context}"] += Enabling metrics monitoring in a {product} Operator installation on an {ocp-short} cluster + +You can enable and view metrics for an Operator-installed {product} instance from the *Developer* perspective of the {ocp-short} web console. + +.Prerequisites + +* Your {ocp-short} cluster has link:https://docs.openshift.com/container-platform/latest/observability/monitoring/enabling-monitoring-for-user-defined-projects.html[monitoring for user-defined projects] enabled. +* You have installed {product} on {ocp-short} using the {product} Operator. +* You have installed the {oc-first}. + +.Procedure + +Currently, the {product} Operator does not support creating a `ServiceMonitor` custom resource (CR) by default. You must complete the following steps to create a `ServiceMonitor` CR to scrape metrics from the endpoint. + +. Create the `ServiceMonitor` CR as a YAML file: ++ +[source,yaml] +---- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: # <1> + namespace: # <2> + labels: + app.kubernetes.io/instance: + app.kubernetes.io/name: backstage +spec: + namespaceSelector: + matchNames: + - + selector: + matchLabels: + rhdh.redhat.com/app: backstage- + endpoints: + - port: backend + path: '/metrics' +---- +<1> Replace `` with the name of your {product} CR. +<2> Replace `` with the name of the {ocp-short} project where your {product} instance is running. + +. Apply the `ServiceMonitor` CR by running the following command: ++ +[source,terminal] +---- +oc apply -f +---- + +.Verification + +. From the *Developer* perspective in the {ocp-short} web console, select the *Observe* view. +. Click the *Metrics* tab to view metrics for {product} pods. diff --git a/titles/admin-rhdh/title-admin.adoc b/titles/admin-rhdh/title-admin.adoc index 87929077b6..fd00f250a7 100644 --- a/titles/admin-rhdh/title-admin.adoc +++ b/titles/admin-rhdh/title-admin.adoc @@ -1,4 +1,4 @@ -[id='title-admin'] +[id="title-admin"] include::artifacts/attributes.adoc[] = Administration guide for {product} :context: admin-rhdh