You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
= Enabling metrics monitoring in a Helm chart installation on an {ocp-short} cluster
5
5
6
-
You can enable and view metrics for a {product} Helm deployment from the *Developer* perspective of the {ocp-short} web console.
6
+
You can enable and view metrics for a {product} Helm deployment from the {ocp-short} web console. Metrics monitoring is enabled through configuration during a chart upgrade. After the upgrade, the Helm release generates the necessary `ServiceMonitor` resource.
7
7
8
8
.Prerequisites
9
9
@@ -12,7 +12,7 @@ You can enable and view metrics for a {product} Helm deployment from the *Develo
12
12
13
13
.Procedure
14
14
15
-
. From the *Developer* perspective in the {ocp-short} web console, select the *Topology* view.
15
+
. From the {ocp-short} web console, select the *Topology* view.
16
16
. Click the overflow menu of the {product} Helm chart, and select *Upgrade*.
= Enabling metrics monitoring in a {product} Operator installation on an {ocp-short} cluster
5
5
6
-
You can enable and view metrics for an Operator-installed {product} instance from the *Developer* perspective of the {ocp-short} web console.
6
+
You can enable and view metrics for an Operator-installed {product} instance from the {ocp-short} web console. Metrics are exposed through an HTTP service endpoint under the `/metrics` canonical name.
7
+
8
+
By setting the `spec.monitoring.enabled` field to `true` in your {product} custom resource (CR), you instruct the Operator to automatically create and manage the necessary `ServiceMonitor` to scrape metrics from the service endpoint.
7
9
8
10
.Prerequisites
9
11
@@ -13,53 +15,29 @@ You can enable and view metrics for an Operator-installed {product} instance fro
13
15
14
16
.Procedure
15
17
16
-
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.
17
-
18
-
. Create the `ServiceMonitor` CR as a YAML file:
18
+
. Use the *OpenShift CLI* (`oc`) to edit your existing {product} CR.
19
+
+
20
+
[source,bash]
21
+
----
22
+
oc edit Backstage <instance-name>
23
+
----
24
+
. In the CR, locate the `spec` field and add the `monitoring` configuration block.
<1> The name of your `ServiceMonitor` resource, for example, `developer_hub_service_monitor`.
43
-
<2> The namespace where your `ServiceMonitor` will live, for example, `{my-product-namespace}`.
44
-
<3> The label name identifying the `ServiceMonitor` CR instance, for example, `{my-product-cr-name}`.
45
-
<4> The namespace where your {product-very-short} instance is installed, for example, `{my-product-namespace}`.
46
-
<5> The name of your {product-very-short} deployment, for example, `developer-hub`.
47
-
<6> The name of your {product-very-short} application, for example, `backstage`.
32
+
. Save the {product-very-short} CR. The {product-very-short} Operator detects the configuration and automatically creates the corresponding `ServiceMonitor` custom resource (CR).
48
33
+
49
34
[NOTE]
50
35
====
51
-
`spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation.
36
+
The Operator automatically configures the `ServiceMonitor` with the correct labels (`app.kubernetes.io/instance` and `app.kubernetes.io/name`) that match your Backstage CR. The `ServiceMonitor` will be named `metrics-<cr-name>`. No additional label configuration is required.
52
37
====
53
38
54
-
. Apply the `ServiceMonitor` CR by running the following command:
55
-
+
56
-
[source,terminal]
57
-
----
58
-
oc apply -f <filename>
59
-
----
60
-
61
39
.Verification
62
40
63
-
. From the *Developer* perspective in the {ocp-short} web console, select the *Observe* view.
41
+
. From the {ocp-short} web console, select the *Observe* view.
64
42
. Click the *Metrics* tab to view metrics for {product} pods.
65
-
. From the Developer perspective in the {ocp-short} web console, click **Project > Services** and verify the labels for `backstage-developer-hub`.
43
+
. From the {ocp-short} web console, click **Project > Services** and verify the labels for `backstage-developer-hub`.
0 commit comments