From 1650d9dde781a8e279c33ba91fc7a869b782bdf2 Mon Sep 17 00:00:00 2001 From: Priyanka Abel Date: Mon, 27 Jan 2025 22:27:26 +0530 Subject: [PATCH 1/8] fixed merge conflicts --- ...c-admin-enabling-metrics-ocp-operator.adoc | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc index f169e2f3a0..407edbdf2c 100644 --- a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc +++ b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc @@ -25,24 +25,34 @@ Currently, the {product} Operator does not support creating a `ServiceMonitor` c apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: # <1> - namespace: {my-product-namespace} # <2> + name: <1> + namespace: <2> labels: - app.kubernetes.io/instance: - app.kubernetes.io/name: backstage + app.kubernetes.io/instance: <3> + app.kubernetes.io/name: {product-custom-resource-type} spec: namespaceSelector: matchNames: - - {my-product-namespace} + - <4> selector: matchLabels: - rhdh.redhat.com/app: backstage- + app.kubernetes.io/instance: <5> + app.kubernetes.io/name: <6> endpoints: - port: http-metrics path: '/metrics' ---- -<1> Replace `` with the name of your `{product-custom-resource-type}` custom resource. -<2> Replace `` 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: + @@ -55,3 +65,4 @@ oc apply -f . 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 OpenShift Console in the Developer view, click **Project > Services** and verify the labels for `backstage-developer-hub`. \ No newline at end of file From f77f5df9fab6d278cc441eb412ed5906a5028388 Mon Sep 17 00:00:00 2001 From: Priyanka Abel Date: Tue, 28 Jan 2025 09:59:39 +0530 Subject: [PATCH 2/8] Incorporated Jessica's comments --- ...c-admin-enabling-metrics-ocp-operator.adoc | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc index 407edbdf2c..50902b85af 100644 --- a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc +++ b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc @@ -25,8 +25,8 @@ Currently, the {product} Operator does not support creating a `ServiceMonitor` c apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: <1> - namespace: <2> + name: developer-hub-service-monitor <1> + namespace: {my-product-namespace} <2> labels: app.kubernetes.io/instance: <3> app.kubernetes.io/name: {product-custom-resource-type} @@ -36,22 +36,20 @@ spec: - <4> selector: matchLabels: - app.kubernetes.io/instance: <5> - app.kubernetes.io/name: <6> + app.kubernetes.io/instance: developer-hub <4> + app.kubernetes.io/name: {product-custom-resource-type} endpoints: - port: http-metrics path: '/metrics' ---- -<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`. -+ +<1> The name of your ServiceMonitor resource, for example, `developer-hub-service-monitor`. +<2> The namespace where your ServiceMonitor lives and where your {product-very-short} instance is installed. +<3> The name of the {ocp-short} project where your {product} instance is running. +<4> The name of your {product-very-short} deployment. [NOTE] ++ ==== -`spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation. +`spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation. To confirm the label names, go to Project > Services and get the labels for `backstage-developer-hub`. ==== . Apply the `ServiceMonitor` CR by running the following command: From b0fa750ae67072eceb23a6a7b492e55f685f1869 Mon Sep 17 00:00:00 2001 From: Priyanka Abel Date: Tue, 28 Jan 2025 14:36:57 +0530 Subject: [PATCH 3/8] Made a few changes --- .../proc-admin-enabling-metrics-ocp-operator.adoc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc index 50902b85af..66c0e62745 100644 --- a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc +++ b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc @@ -33,23 +33,24 @@ metadata: spec: namespaceSelector: matchNames: - - <4> + - {my-product-namespace} <4> selector: matchLabels: - app.kubernetes.io/instance: developer-hub <4> + app.kubernetes.io/instance: developer-hub <5> app.kubernetes.io/name: {product-custom-resource-type} endpoints: - port: http-metrics path: '/metrics' ---- -<1> The name of your ServiceMonitor resource, for example, `developer-hub-service-monitor`. -<2> The namespace where your ServiceMonitor lives and where your {product-very-short} instance is installed. +<1> The name of your `ServiceMonitor` resource, for example, `developer-hub-service-monitor`. +<2> The namespace where your `ServiceMonitor` lives. <3> The name of the {ocp-short} project where your {product} instance is running. -<4> The name of your {product-very-short} deployment. +<4> The namespace where your {product-very-short} instance is installed. +<5> The name of your {product-very-short} deployment. [NOTE] + ==== -`spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation. To confirm the label names, go to Project > Services and get the labels for `backstage-developer-hub`. +`spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation. To confirm the label names, go to Project > Services and verify the labels for `backstage-developer-hub`. ==== . Apply the `ServiceMonitor` CR by running the following command: From 847597e5ff76954133cf1b7332edaf64a4ec3e86 Mon Sep 17 00:00:00 2001 From: Priyanka Abel Date: Tue, 28 Jan 2025 21:25:17 +0530 Subject: [PATCH 4/8] Final changes --- modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc index 66c0e62745..03ea3a29f1 100644 --- a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc +++ b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc @@ -43,8 +43,8 @@ spec: path: '/metrics' ---- <1> The name of your `ServiceMonitor` resource, for example, `developer-hub-service-monitor`. -<2> The namespace where your `ServiceMonitor` lives. -<3> The name of the {ocp-short} project where your {product} instance is running. +<2> The namespace where your `ServiceMonitor` will live. +<3> The label name identifying the `ServiceMonitor` CR instance. <4> The namespace where your {product-very-short} instance is installed. <5> The name of your {product-very-short} deployment. [NOTE] From 19d80fe952fd7ca44496f28415d3be4d9769f084 Mon Sep 17 00:00:00 2001 From: Priyanka Abel Date: Wed, 29 Jan 2025 09:57:49 +0530 Subject: [PATCH 5/8] Incorporated Lindsey's comments --- ...c-admin-enabling-metrics-ocp-operator.adoc | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc index 03ea3a29f1..44ec5c978b 100644 --- a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc +++ b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc @@ -25,32 +25,33 @@ Currently, the {product} Operator does not support creating a `ServiceMonitor` c apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: developer-hub-service-monitor <1> - namespace: {my-product-namespace} <2> + name: <1> + namespace: <2> labels: app.kubernetes.io/instance: <3> app.kubernetes.io/name: {product-custom-resource-type} spec: namespaceSelector: matchNames: - - {my-product-namespace} <4> + - <4> selector: matchLabels: - app.kubernetes.io/instance: developer-hub <5> - app.kubernetes.io/name: {product-custom-resource-type} + app.kubernetes.io/instance: <5> + app.kubernetes.io/name: <6> endpoints: - port: http-metrics path: '/metrics' ---- <1> The name of your `ServiceMonitor` resource, for example, `developer-hub-service-monitor`. -<2> The namespace where your `ServiceMonitor` will live. -<3> The label name identifying the `ServiceMonitor` CR instance. -<4> The namespace where your {product-very-short} instance is installed. -<5> The name of your {product-very-short} deployment. -[NOTE] +<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 type of custom resource that you want to use, for example, `{product-custom-resource-type}`. + +[NOTE] ==== -`spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation. To confirm the label names, go to Project > Services and verify the labels for `backstage-developer-hub`. +`spec.selector.matchLabels` configuration must match the labels of your {product-very-short} installation. ==== . Apply the `ServiceMonitor` CR by running the following command: @@ -64,4 +65,4 @@ oc apply -f . 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 OpenShift Console in the Developer view, click **Project > Services** and verify the labels for `backstage-developer-hub`. \ No newline at end of file +. From the OpenShift Console in the Developer view, click **Project > Services** and verify the labels for `backstage-developer-hub`. From d82df2e03f994bd098bc14ecf3cdb40ac69a60cc Mon Sep 17 00:00:00 2001 From: Priyanka Abel Date: Fri, 31 Jan 2025 12:44:39 +0530 Subject: [PATCH 6/8] Final update --- modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc index 44ec5c978b..f5f9feea31 100644 --- a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc +++ b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc @@ -47,7 +47,7 @@ spec: <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 type of custom resource that you want to use, for example, `{product-custom-resource-type}`. +<6> The name of your {product-very-short} application, for example, `backstage`. + [NOTE] ==== From 85147449a8ddfd08e3aae6b9bd610a09b140e5b9 Mon Sep 17 00:00:00 2001 From: Priyanka Abel Date: Thu, 6 Feb 2025 20:19:07 +0530 Subject: [PATCH 7/8] Incorporated comments --- .../proc-admin-enabling-metrics-ocp-operator.adoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc index f5f9feea31..8af9ae6504 100644 --- a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc +++ b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc @@ -25,24 +25,24 @@ Currently, the {product} Operator does not support creating a `ServiceMonitor` c apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: <1> - namespace: <2> + name: __ <1> + namespace: __ <2> labels: - app.kubernetes.io/instance: <3> + app.kubernetes.io/instance: __ <3> app.kubernetes.io/name: {product-custom-resource-type} spec: namespaceSelector: matchNames: - - <4> + - __ <4> selector: matchLabels: - app.kubernetes.io/instance: <5> - app.kubernetes.io/name: <6> + app.kubernetes.io/instance: __ <5> + app.kubernetes.io/name: __ <6> endpoints: - port: http-metrics path: '/metrics' ---- -<1> The name of your `ServiceMonitor` resource, for example, `developer-hub-service-monitor`. +<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}`. From 25030496457c05d038d1e2448753daf54fa9f715 Mon Sep 17 00:00:00 2001 From: Priyanka Abel Date: Tue, 11 Feb 2025 11:01:45 +0530 Subject: [PATCH 8/8] Incorporated comment --- modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc index 8af9ae6504..921ed4d11b 100644 --- a/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc +++ b/modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc @@ -65,4 +65,4 @@ oc apply -f . 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 OpenShift Console in the Developer view, click **Project > Services** and verify the labels for `backstage-developer-hub`. +. From the Developer perspective in the {ocp-short} web console, click **Project > Services** and verify the labels for `backstage-developer-hub`.