Skip to content

Instantly share code, notes, and snippets.

@allyford
Last active July 5, 2024 16:14
Show Gist options
  • Save allyford/fe2f976cf736ef2f28df6f8754521aed to your computer and use it in GitHub Desktop.
Save allyford/fe2f976cf736ef2f28df6f8754521aed to your computer and use it in GitHub Desktop.
Enable Windows Exporter on AKS (Preview)

Enable Windows Exporter on AKS (Private Preview)

AKS preview features are available on a self-service, opt-in basis. Previews are provided "as is" and "as available," and they're excluded from the service-level agreements and limited warranty. AKS previews are partially covered by customer support on a best-effort basis. As such, these features aren't meant for production use. For more information, see the following support articles:

AKS support policies

Azure support FAQ

What is Windows Exporter?

Prometheus is a mainstream open-source observability solution that requires an exporter to scrape metrics from an AKS node and expose it to a readable HTTP endpoint. When exposed, these metrics can be pulled by the customer's monitoring solution to generate observability around deploy nodes and pods. With Windows Exporter, customers can now see their metrics through Managed Prometheus or Prometheus OSS deployments and enjoy enhanced observability around their node and pod performance, health, and resource usage. These metrics will also be visible with Managed Grafana.

The default collectors included in Windows Exporter on AKS are:

cpu, cpu_info, cs, container, logical_disk, memory, net, os, process, service, system, textfile

For more information on what metrics you can see using these collectors, please see prometheus-community/windows_exporter

How can I access Private Preview?

Windows Exporter on AKS can be enabled by a specified subscription and/or region. Please note this feature is in preview and recommended for test environments only.

It will take 2-4 weeks for Windows Exporter to be enabled, but we will follow up via email as soon as it is ready for your subscription. After your subscription is enabled, all AKS Windows nodes (existing nodes and new nodes) under the specified subscriptions or regions will install windows-exporter.

Enable Windows Exporter on AKS

Windows Exporter will be enabled automatically on specified subscriptions and/or regions after filling out the form above. There is no additional steps to enable Windows Exporter.

Check if Windows Exporter is enabled on your node pools:

Run this command to check if Windows Exporter is enabled in your subscription:

az vmss extension list --vmss-name vmss-name --resource-group resource-group-name --subscription subscription-id

View Windows Exporter metrics in Prometheus and Grafana:

Enable Managed Prometheus

az aks create/update --enable-azure-monitor-metrics -n cluster-name -g cluster-resource-group --azure-monitor-workspace-resource-id azure-monitor-workspace-name-resource-id --grafana-resource-id grafana-workspace-name-resource-id --enable-windows-recording-rules

  • cluster-name: Name of your AKS cluster.
  • cluster-resource-group: Resource group where your AKS cluster is deployed.
  • azure-monitor-workspace-resource-id (optional): Resource ID of your Azure Monitor workspace. If not provided, a default workspace will be created.
  • grafana-resource-id>: Resource ID of your Grafana workspace. You can create one using these instructions
  • --enable-windows-recording-rules: Required parameter for correct dashboard data presentation for windows

Configure Prometheus Extension

kubectl apply -f https://raw.githubusercontent.com/Azure/prometheus-collector/kaveesh/test_windows_exporter_extension/otelcollector/configmaps/ama-metrics-prometheus-config-node-windows-configmap.yaml

View Metrics in Grafana Dashboard

Navigate to your Grafana resource and access the Grafana dashboard to verify if metrics are flowing in as expected:

  1. Go to your Grafana resource.
  2. Navigate to Dashboards > Azure Managed Prometheus.
  3. View the following listed dashboards:
  • Kubernetes / Compute Resources / Cluster (Windows)
  • Kubernetes / Compute Resources / Namespace (Windows)
  • Kubernetes / Compute Resources / Pod (Windows)
  • Kubernetes / USE Method / Cluster (Windows)
  • Kubernetes / USE Method / Node (Windows)

Please note that due to the image size, it may take around 5-10 minutes for the ama-metrics-win pods to start running and collecting data for visualization in Grafana.

Questions and support

If you experience any issues using the feature or have any feedback, please use AKS issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment