Skip to content

Commit 412884a

Browse files
hmanwani-rhopenshift-cherrypick-robot
authored andcommitted
modularized the content
1 parent bdf1109 commit 412884a

File tree

6 files changed

+134
-124
lines changed

6 files changed

+134
-124
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[id="assembly-monitoring-and-logging-aks"]
2+
= Monitoring and logging with Azure Kubernetes Services (AKS) in {product}
3+
:context: assembly-monitoring-and-logging-aks
4+
5+
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.
6+
7+
// Azure monitor metrics
8+
include::modules/observe/proc-enabling-azure-monitor-metrics.adoc[leveloffset=+1]
9+
10+
// configure annotations
11+
include::modules/observe/proc-configure-annotations-for-aks-monitoring.adoc[leveloffset=+1]
12+
13+
// view logs
14+
include::modules/observe/proc-view-logs-aks.adoc[leveloffset=+1]
15+
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
[id='proc-configure-annotations-for-aks-monitoring_{context}']
2+
= Configuring annotations for monitoring
3+
4+
You can configure the annotations for monitoring {product} specific metrics in both Helm deployment and Operator-backed deployment.
5+
6+
Helm deployment::
7+
+
8+
--
9+
To annotate the backstage pod for monitoring, update your `values.yaml` file as follows:
10+
11+
[source,yaml]
12+
----
13+
upstream:
14+
backstage:
15+
# --- TRUNCATED ---
16+
podAnnotations:
17+
prometheus.io/scrape: 'true'
18+
prometheus.io/path: '/metrics'
19+
prometheus.io/port: '9464'
20+
prometheus.io/scheme: 'http'
21+
----
22+
--
23+
24+
Operator-backed deployment::
25+
+
26+
--
27+
.Procedure
28+
29+
. As an administrator of the operator, edit the default configuration to add Prometheus annotations as follows:
30+
+
31+
[source,bash]
32+
----
33+
# Update OPERATOR_NS accordingly
34+
OPERATOR_NS=rhdh-operator
35+
kubectl edit configmap backstage-default-config -n "${OPERATOR_NS}"
36+
----
37+
38+
. Find the `deployment.yaml` key in the ConfigMap and add the annotations to the `spec.template.metadata.annotations` field as follows:
39+
+
40+
[source,yaml]
41+
----
42+
deployment.yaml: |-
43+
apiVersion: apps/v1
44+
kind: Deployment
45+
# --- truncated ---
46+
spec:
47+
template:
48+
# --- truncated ---
49+
metadata:
50+
labels:
51+
rhdh.redhat.com/app: # placeholder for 'backstage-<cr-name>'
52+
# --- truncated ---
53+
annotations:
54+
prometheus.io/scrape: 'true'
55+
prometheus.io/path: '/metrics'
56+
prometheus.io/port: '9464'
57+
prometheus.io/scheme: 'http'
58+
# --- truncated ---
59+
----
60+
61+
. Save your changes.
62+
--
63+
64+
.Verification
65+
66+
To verify if the scraping works, navigate to the corresponding Azure Monitor Workspace and view the metrics under *Monitoring -> Metrics*.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[id='proc-enabling-azure-monitor-metrics_{context}']
2+
= Enabling Azure Monitor metrics
3+
4+
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:
5+
6+
[source,bash]
7+
----
8+
az aks create/update --resource-group <your-ResourceGroup> --name <your-Cluster> --enable-azure-monitor-metrics
9+
----
10+
11+
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].
12+
13+
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.
14+
15+
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.

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

Lines changed: 0 additions & 123 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[id='proc-view-logs-aks_{context}']
2+
= Viewing logs with Azure Kubernetes Services (AKS)
3+
4+
You can access live data logs generated by Kubernetes objects and collect log data in Container Insights within AKS.
5+
6+
.Prerequisites
7+
8+
* You have deployed {product-short} on {aks-short}.
9+
10+
For more information, see xref:{installing-on-aks-book-url}#assembly-install-rhdh-aks[{installing-on-aks-book-title}].
11+
12+
.Procedure
13+
14+
View live logs from your {product-short} instance::
15+
+
16+
--
17+
. Navigate to the Azure Portal.
18+
. Search for the resource group `<your-ResourceGroup>` and locate your AKS cluster `<your-Cluster>`.
19+
. Select *Kubernetes resources -> Workloads* from the menu.
20+
. Select the `<your-rhdh-cr>-developer-hub` (in case of Helm Chart installation) or `<your-rhdh-cr>-backstage` (in case of Operator-backed installation) deployment.
21+
. Click *Live Logs* in the left menu.
22+
. Select the pod.
23+
+
24+
NOTE: There must be only single pod.
25+
26+
Live log data is collected and displayed.
27+
--
28+
29+
View real-time log data from the Container Engine::
30+
+
31+
--
32+
. Navigate to the Azure Portal.
33+
. Search for the resource group `<your-ResourceGroup>` and locate your AKS cluster `<your-Cluster>`.
34+
. Select *Monitoring* -> *Insights* from the menu.
35+
. Go to the *Containers* tab.
36+
. Find the backend-backstage container and click it to view real-time log data as it's generated by the Container Engine.
37+
--

titles/monitoring-and-logging/master.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ include::assemblies/assembly-rhdh-observability.adoc[leveloffset=+1]
1414
include::modules/observe/proc-rhdh-monitoring-logging-aws.adoc[leveloffset=+1]
1515

1616
//AKS
17-
include::modules/observe/proc-rhdh-monitoring-logging-aks.adoc[leveloffset=+1]
17+
include::assemblies/assembly-monitoring-and-logging-aks.adoc[leveloffset=+1]
1818

0 commit comments

Comments
 (0)