@@ -25,24 +25,34 @@ Currently, the {product} Operator does not support creating a `ServiceMonitor` c
2525apiVersion: monitoring.coreos.com/v1
2626kind: ServiceMonitor
2727metadata:
28- name: < custom _resource_name > # <1>
29- namespace: {my-product-namespace} # <2>
28+ name: _<developer_hub_service_monitor_name>_ <1>
29+ namespace: _<rhdh_namespace_name>_ <2>
3030 labels:
31- app.kubernetes.io/instance: < custom _resource_name >
32- app.kubernetes.io/name: backstage
31+ app.kubernetes.io/instance: _<rhdh_cr_name>_ <3 >
32+ app.kubernetes.io/name: {product-custom-resource-type}
3333spec:
3434 namespaceSelector:
3535 matchNames:
36- - {my-product-namespace}
36+ - _<rhdh_namespace_name>_ <4>
3737 selector:
3838 matchLabels:
39- rhdh.redhat.com/app: backstage-<custom _resource_name >
39+ app.kubernetes.io/instance: _<deployment_name>_ <5>
40+ app.kubernetes.io/name: _<rhdh_cr_type>_ <6>
4041 endpoints:
4142 - port: http-metrics
4243 path: '/metrics'
4344----
44- <1> Replace `<custom_resource_name>` with the name of your `{product-custom-resource-type}` custom resource.
45- <2> Replace `<project_name>` with the name of the {ocp-short} project where your {product} instance is running.
45+ <1> The name of your `ServiceMonitor` resource, for example, `developer_hub_service_monitor` .
46+ <2> The namespace where your `ServiceMonitor` will live, for example, `{my-product-namespace}` .
47+ <3> The label name identifying the `ServiceMonitor` CR instance, for example, `{my-product-cr-name}` .
48+ <4> The namespace where your {product-very-short} instance is installed, for example, `{my-product-namespace}` .
49+ <5> The name of your {product-very-short} deployment, for example, `developer-hub` .
50+ <6> The name of your {product-very-short} application, for example, `backstage` .
51+ +
52+ [NOTE]
53+ ====
54+ `spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation.
55+ ====
4656
4757. Apply the `ServiceMonitor` CR by running the following command:
4858+
@@ -55,3 +65,4 @@ oc apply -f <filename>
5565
5666. From the *Developer* perspective in the {ocp-short} web console, select the *Observe* view.
5767. Click the *Metrics* tab to view metrics for {product} pods.
68+ . From the Developer perspective in the {ocp-short} web console, click **Project > Services** and verify the labels for `backstage-developer-hub` .
0 commit comments