Cloud monitoring

This topic describes how GKE on Azure integrates with Cloud Monitoring and how to view your metrics.

Before you begin

  1. Configure the Google Cloud CLI and enable the required APIs in your Google Cloud project.

  2. Authorize Cloud Logging / Cloud Monitoring to set up permissions for Google Cloud's operations suite.

Overview

GKE on Azure has built-in integration with Cloud Monitoring for system metrics of nodes, pods, and containers. This allows you to easily see the resource consumption of workloads in the cluster, build dashboards, and configure alerts.

GKE on Azure installs the metrics collector gke-metrics-agent in your cluster. This agent is based on OpenTelemetry Collector, and runs on every node in the cluster. It samples metrics every minute, and uploads measurements to Cloud Monitoring.

Once metrics for your cluster have been uploaded, they reside in your Google Cloud project. You can aggregate data across all of your clusters, build custom dashboards, explore a single cluster's data, view line charts, set up alerts, and more.

Using the Metrics Explorer

1.27 or later

To view the metrics for a monitored resource by using the Metrics Explorer, do the following:

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Metrics explorer:

    Go to Metrics explorer

  2. In the Metric element, expand the Select a metric menu, enter Kubernetes Container in the filter bar, and then use the submenus to select a specific resource type and metric:
    1. In the Active resources menu, select Kubernetes Container.
    2. In the Active metric categories menu, select Anthos.
    3. In the Active metrics menu, select CPU usage time.
    4. Click Apply.
  3. To remove time series from the display, use the Filter element.

  4. To combine time series, use the menus on the Aggregation element. For example, to display the CPU utilization for your VMs, based on their zone, set the first menu to Mean and the second menu to zone.

    All time series are displayed when the first menu of the Aggregation element is set to Unaggregated. The default settings for the Aggregation element are determined by the metric type you selected.

  5. For quota and other metrics that report one sample per day, do the following:
    1. In the Display pane, set the Widget type to Stacked bar chart.
    2. Set the time period to at least one week.

1.26 or earlier

To view the metrics for a monitored resource by using the Metrics Explorer, do the following:

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Metrics explorer:

    Go to Metrics explorer

  2. In the Metric element, expand the Select a metric menu, enter Kubernetes Container in the filter bar, and then use the submenus to select a specific resource type and metric:
    1. In the Active resources menu, select Kubernetes Container.
    2. In the Active metric categories menu, select Container.
    3. In the Active metrics menu, select CPU usage time.
    4. Click Apply.
  3. To remove time series from the display, use the Filter element.

  4. To combine time series, use the menus on the Aggregation element. For example, to display the CPU utilization for your VMs, based on their zone, set the first menu to Mean and the second menu to zone.

    All time series are displayed when the first menu of the Aggregation element is set to Unaggregated. The default settings for the Aggregation element are determined by the metric type you selected.

  5. For quota and other metrics that report one sample per day, do the following:
    1. In the Display pane, set the Widget type to Stacked bar chart.
    2. Set the time period to at least one week.

Metrics monitored resource type

Metrics are collected using one of the following three monitored resource types. These types correspond to a Kubernetes object that the measurement is being made for:

For instance, measurements about a Pod would use the monitored resource type k8s_pod. These metrics would therefore include labels for pod_name and namespace_name, that identify a particular Pod.

A different set of metrics types are used for each monitored resource type. To learn more about these metrics types, see GKE system metrics.

What metrics are collected

What's next?