@@ -25,24 +25,34 @@ Currently, the {product} Operator does not support creating a `ServiceMonitor` c
25
25
apiVersion: monitoring.coreos.com/v1
26
26
kind: ServiceMonitor
27
27
metadata:
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>
30
30
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}
33
33
spec:
34
34
namespaceSelector:
35
35
matchNames:
36
- - {my-product-namespace}
36
+ - _<rhdh_namespace_name>_ <4>
37
37
selector:
38
38
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>
40
41
endpoints:
41
42
- port: http-metrics
42
43
path: '/metrics'
43
44
----
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
+ ====
46
56
47
57
. Apply the `ServiceMonitor` CR by running the following command:
48
58
+
@@ -55,3 +65,4 @@ oc apply -f <filename>
55
65
56
66
. From the *Developer* perspective in the {ocp-short} web console, select the *Observe* view.
57
67
. 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