Monitor Azure Kubernetes Service resources in Grafana

Kumar Allamraju
3 min readMar 15, 2020

--

Grafana is one of the popular and leading open source tools for visualizing time series metrics. You can use it to monitor Azure services and applications by leveraging the Azure Monitor data source plugin, built by Grafana Labs. This plugin enables you to include all metrics from Azure Monitor and Application Insights in your Grafana dashboards.

In this article we will learn the steps to monitor your Azure Kubernetes Service (AKS) in Grafana Dashboards.

Pre-requisites

  • An Azure subscription. If you don’t have one, sign up here for free
  • An AKS cluster with monitoring enabled. If you don’t have one here are the steps to create an AKS cluster from Azure CLI

Steps to configure AKS with Grafana

  1. Login to Azure Portal and provision a Grafana VM from Azure Marketplace

2. Go through the provisioning wizard and complete the process to create a VM.

3. In Azure Portal, go to the resource group of your AKS cluster >> click on IAM

4. Add a Role Assignment, provide Reader and Log Analytics Reader role privileges to your AKS cluster’s service principal.

5. Once the VM is provisioned, access the Grafana Dashboard at http://{grafana-vm's-public-ip}:3000

6. Login to the Grafana dashboard with default username and password (admin/admin); You can reset the default password at this time.

7. Click on Configuration >> Datasources

8. Refer to this page to retrieve the Tenant Id, Client Id, Client Secret and Subscription details from Azure Portal and input the same under Azure Monitor and Azure Log Analytics API details. The Client Id and Secret should be same as the one that you have used while creating your AKS cluster.

9. Save & Test

10. Instead of building from scratch, there’s an option to import an existing dashboard (10956) in to your Grafana dashboard. You can further extend this dashboard that suits to your monitoring needs.

11. There seems to be a known bug in Grafana for which we have to manually edit the widget, select the log analytics workspace , Run and Save the dashboard.

12. If all goes well, you should see the following

Conclusion

Grafana has quickly became the preferred visualization tool of choice for developers and operations teams for monitoring server and application metrics. Grafana dashboards enable operation teams to quickly monitor and react to performance, availability, and overall health of the service. Grafana is one of the many tools to monitor AKS resources in Azure. In the future episodes, we will explore other tools to monitor Azure Kubernetes Service (AKS ) resources.

References

Azure Kubernetes Service

Azure Monitor Data Source For Grafana

Using Azure Monitor in Grafana

--

--

Responses (5)