Skip to content
Merged
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
27 changes: 19 additions & 8 deletions modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,34 @@ Currently, the {product} Operator does not support creating a `ServiceMonitor` c
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: <custom_resource_name> # <1>
namespace: {my-product-namespace} # <2>
name: _<developer_hub_service_monitor_name>_ <1>
namespace: _<rhdh_namespace_name>_ <2>
labels:
app.kubernetes.io/instance: <custom_resource_name>
app.kubernetes.io/name: backstage
app.kubernetes.io/instance: _<rhdh_cr_name>_ <3>
app.kubernetes.io/name: {product-custom-resource-type}
spec:
namespaceSelector:
matchNames:
- {my-product-namespace}
- _<rhdh_namespace_name>_ <4>
selector:
matchLabels:
rhdh.redhat.com/app: backstage-<custom_resource_name>
app.kubernetes.io/instance: _<deployment_name>_ <5>
app.kubernetes.io/name: _<rhdh_cr_type>_ <6>
endpoints:
- port: http-metrics
path: '/metrics'
----
<1> Replace `<custom_resource_name>` with the name of your `{product-custom-resource-type}` custom resource.
<2> Replace `<project_name>` with the name of the {ocp-short} project where your {product} instance is running.
<1> The name of your `ServiceMonitor` resource, for example, `developer_hub_service_monitor`.
<2> The namespace where your `ServiceMonitor` will live, for example, `{my-product-namespace}`.
<3> The label name identifying the `ServiceMonitor` CR instance, for example, `{my-product-cr-name}`.
<4> The namespace where your {product-very-short} instance is installed, for example, `{my-product-namespace}`.
<5> The name of your {product-very-short} deployment, for example, `developer-hub`.
<6> The name of your {product-very-short} application, for example, `backstage`.
+
[NOTE]
====
`spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation.
====

. Apply the `ServiceMonitor` CR by running the following command:
+
Expand All @@ -55,3 +65,4 @@ oc apply -f <filename>

. From the *Developer* perspective in the {ocp-short} web console, select the *Observe* view.
. Click the *Metrics* tab to view metrics for {product} pods.
. From the Developer perspective in the {ocp-short} web console, click **Project > Services** and verify the labels for `backstage-developer-hub`.