Install Cloud Monitoring on AKS attached clusters

This document describes how GKE attached clusters integrates with Cloud Monitoring and how to view your metrics.

Before you begin

  1. Fulfill the prerequisites for GKE attached clusters.

  2. Authorize Cloud Logging and Cloud Monitoring to set up permissions for Google Cloud Observability.

Overview

GKE attached clusters 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 attached clusters 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

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

  1. In the Google Cloud console, go to the  Metrics explorer page:

    Go to Metrics explorer

    If you use the search bar to find this page, then select the result whose subheading is Monitoring.

  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.

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 example, 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. If you want to see metrics for a specific cluster, use the following format:

attachedClusters/CLUSTER_NAME

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?