Skip to content

Commit 4062ae9

Browse files
committed
update metric monitoring instructions for OCP and AKS
Signed-off-by: Jessica He <[email protected]>
1 parent ff89067 commit 4062ae9

File tree

3 files changed

+72
-2
lines changed

3 files changed

+72
-2
lines changed

modules/observe/proc-admin-enabling-metrics-ocp-helm.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ upstream:
3030
serviceMonitor:
3131
enabled: true
3232
path: /metrics
33+
port: http-metrics
3334
# ...
3435
----
3536
+

modules/observe/proc-admin-enabling-metrics-ocp-operator.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spec:
3838
matchLabels:
3939
rhdh.redhat.com/app: backstage-<custom_resource_name>
4040
endpoints:
41-
- port: backend
41+
- port: http-metrics
4242
path: '/metrics'
4343
----
4444
<1> Replace `<custom_resource_name>` with the name of your {product} CR.

modules/observe/proc-rhdh-monitoring-logging-aks.adoc

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,88 @@
33

44
Monitoring and logging are integral aspects of managing and maintaining Azure Kubernetes Services (AKS) in {product}. With features like Managed Prometheus Monitoring and Azure Monitor integration, administrators can efficiently monitor resource utilization, diagnose issues, and ensure the reliability of their containerized workloads.
55

6+
== Enabling Azure Monitor Metrics
7+
68
To enable Managed Prometheus Monitoring, use the `-enable-azure-monitor-metrics` option within either the `az aks create` or `az aks update` command, depending on whether you're creating a new cluster or updating an existing one, such as:
79

810
[source,bash]
911
----
1012
az aks create/update --resource-group <your-ResourceGroup> --name <your-Cluster> --enable-azure-monitor-metrics
1113
----
1214

13-
The previous command installs the metrics add-on, which gathers https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/prometheus-metrics-overview[Prometheus metrics]. Using the previous command, you can enable monitoring of Azure resources through both native Azure Monitor metrics and Prometheus metrics. You can also view the results in the portal under *Monitoring -> Insights*. For more information, see https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/monitor-azure-resource[Monitor Azure resources with Azure Monitor].
15+
The previous command installs the metrics add-on, which gathers https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/prometheus-metrics-overview[Prometheus metrics]. Using the previous command, you can enable monitoring of Azure resources through both native Azure Monitor metrics. You can also view the results in the portal under *Monitoring -> Insights*. For more information, see https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/monitor-azure-resource[Monitor Azure resources with Azure Monitor].
1416

1517
Furthermore, metrics from both the Managed Prometheus service and Azure Monitor can be accessed through Azure Managed Grafana service. For more information, see https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/azure-monitor-workspace-manage?tabs=azure-portal#link-a-grafana-workspace[Link a Grafana workspace] section.
1618

1719
By default, Prometheus uses the minimum ingesting profile, which optimizes ingestion volume and sets default configurations for scrape frequency, targets, and metrics collected. The default settings can be customized through custom configuration. Azure offers various methods, including using different ConfigMaps, to provide scrape configuration and other metric add-on settings. For more information about default configuration, see https://learn.microsoft.com/en-us/azure/azure-monitor/containers/prometheus-metrics-scrape-default[Default Prometheus metrics configuration in Azure Monitor] and https://learn.microsoft.com/en-us/azure/azure-monitor/containers/prometheus-metrics-scrape-configuration?tabs=CRDConfig%2CCRDScrapeConfig[Customize scraping of Prometheus metrics in Azure Monitor managed service for Prometheus] documentation.
1820

21+
== Configuring annotations for monitoring
22+
23+
You can configure the annotations for monitoring {product} specific metrics in both Helm deployment and Operator-backed deployment.
24+
25+
Helm deployment::
26+
+
27+
--
28+
To annotate the backstage pod for monitoring, update your `values.yaml` file as follows:
29+
30+
[source,yaml]
31+
----
32+
upstream:
33+
backstage:
34+
# --- TRUNCATED ---
35+
podAnnotations:
36+
prometheus.io/scrape: 'true'
37+
prometheus.io/path: '/metrics'
38+
prometheus.io/port: '9464'
39+
prometheus.io/scheme: 'http'
40+
----
41+
--
42+
43+
Operator-backed deployment::
44+
+
45+
--
46+
.Procedure
47+
48+
. As an administrator of the operator, edit the default configuration to add Prometheus annotations as follows:
49+
+
50+
[source,bash]
51+
----
52+
# Update OPERATOR_NS accordingly
53+
OPERATOR_NS=rhdh-operator
54+
kubectl edit configmap backstage-default-config -n "${OPERATOR_NS}"
55+
----
56+
57+
. Find the `deployment.yaml` key in the ConfigMap and add the annotations to the `spec.template.metadata.annotations` field as follows:
58+
+
59+
[source,yaml]
60+
----
61+
deployment.yaml: |-
62+
apiVersion: apps/v1
63+
kind: Deployment
64+
# --- truncated ---
65+
spec:
66+
template:
67+
# --- truncated ---
68+
metadata:
69+
labels:
70+
rhdh.redhat.com/app: # placeholder for 'backstage-<cr-name>'
71+
# --- truncated ---
72+
annotations:
73+
prometheus.io/scrape: 'true'
74+
prometheus.io/path: '/metrics'
75+
prometheus.io/port: '9464'
76+
prometheus.io/scheme: 'http'
77+
# --- truncated ---
78+
----
79+
80+
. Save your changes.
81+
--
82+
83+
.Verification
84+
85+
To verify if the scraping works, navigate to the corresponding Azure Monitor Workspace and view the metrics under *Monitoring -> Metrics*.
86+
87+
1988
== Viewing logs with Azure Kubernetes Services (AKS)
2089

2190
You can access live data logs generated by Kubernetes objects and collect log data in Container Insights within AKS.

0 commit comments

Comments
 (0)