Chapter 3. Monitoring and logging with Azure Kubernetes Services (AKS) in Red Hat Developer Hub Monitoring and logging are integral aspects of managing and maintaining Azure Kubernetes Services (AKS) in Red Hat Developer Hub. 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. 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: az aks create/update --resource-group <your-ResourceGroup> --name <your-Cluster> --enable-azure-monitor-metrics The command installs the metrics add-on, which gathers Prometheus metrics . Using the 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 Monitor Azure resources with Azure Monitor . Furthermore, metrics from both the Managed Prometheus service and Azure Monitor can be accessed through Azure Managed Grafana service. For more information, see Link a Grafana workspace section. 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 Default Prometheus metrics configuration in Azure Monitor and Customize scraping of Prometheus metrics in Azure Monitor managed service for Prometheus documentation. 3.1. Viewing logs with Azure Kubernetes Services (AKS) You can access live data logs generated by Kubernetes objects and collect log data in Container Insights within AKS. Prerequisites You have deployed Developer Hub on AKS. For more information, see Installing Red Hat Developer Hub on Microsoft Azure Kubernetes Service . Procedure View live logs from your Developer Hub instance Navigate to the Azure Portal. Search for the resource group <your-ResourceGroup> and locate your AKS cluster <your-Cluster> . Select Kubernetes resources Workloads from the menu. 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. Click Live Logs in the left menu. Select the pod. Note There must be only single pod. Live log data is collected and displayed. View real-time log data from the Container Engine Navigate to the Azure Portal. Search for the resource group <your-ResourceGroup> and locate your AKS cluster <your-Cluster> . Select Monitoring Insights from the menu. Go to the Containers tab. Find the backend-backstage container and click it to view real-time log data as it's generated by the Container Engine.

Commands:
az aks create/update --resource-group <your-ResourceGroup> --name <your-Cluster> --enable-azure-monitor-metrics