Install Cloud Monitoring on AKS attached clusters

This topic describes how Anthos attached clusters integrates with Cloud Monitoring and how to view your metrics.

Before you begin

  1. Fulfill the prerequisites for Anthos attached clusters.

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


Anthos 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.

Anthos 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 use Metrics Explorer to view the metrics for a monitored resource, follow these steps:

  1. In the Google Cloud console, select Monitoring, and then select  Metrics Explorer, or click the following button:

    Go to Metrics Explorer

  2. In the Select a metric pane, expand the 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. Optional: To configure how the data is viewed, add filters, groupings, and configure the alignment fields. By default, Metrics Explorer adds a grouping that averages all time series:
    • To group time series by resource or metric labels, expand the Labels menu in the Group by section, and then make your selections. You can also change the Grouping function.
    • To view all time series, in the Group by entry, click Delete.
    • To access the alignment fields, click More Options.
    For more information, see Select metrics when using Metrics Explorer.
  4. Optional: Change the settings in the Display pane:
    • For quota and other metrics that report one sample per day, set the Widget type to Stacked bar chart.
    • For distribution valued metrics, set the Widget type to Heatmap chart.
  5. Optional: For quota and other metrics that report one sample per day, set the time frame 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?