generated from redhat-developer/new-project-template
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RHIDP-1582: Add docs for enabling metrics collection (#311)
- Loading branch information
1 parent
3150283
commit ad29b70
Showing
7 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions
43
modules/observability/proc-admin-enabling-metrics-ocp-helm.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
57 changes: 57 additions & 0 deletions
57
modules/observability/proc-admin-enabling-metrics-ocp-operator.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: <custom_resource_name> # <1> | ||
namespace: <project_name> # <2> | ||
labels: | ||
app.kubernetes.io/instance: <custom_resource_name> | ||
app.kubernetes.io/name: backstage | ||
spec: | ||
namespaceSelector: | ||
matchNames: | ||
- <project_name> | ||
selector: | ||
matchLabels: | ||
rhdh.redhat.com/app: backstage-<custom_resource_name> | ||
endpoints: | ||
- port: backend | ||
path: '/metrics' | ||
---- | ||
<1> Replace `<custom_resource_name>` with the name of your {product} CR. | ||
<2> Replace `<project_name>` 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 <filename> | ||
---- | ||
|
||
.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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters