This document describes how GKE attached clusters integrates with Cloud Monitoring and how to view your metrics.
Before you begin
Fulfill the prerequisites for GKE attached clusters.
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:
-
In the Google Cloud console, go to the leaderboard Metrics explorer page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
- 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:- In the Active resources menu, select Kubernetes Container.
- In the Active metric categories menu, select Anthos.
- In the Active metrics menu, select CPU usage time.
- Click Apply.
To remove time series from the display, use the Filter element.
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.
- For quota and other metrics that report one sample per day, do the following:
- In the Display pane, set the Widget type to Stacked bar chart.
- 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
- v1.31.0-gke.1
- v1.30.0-gke.4
- v1.30.0-gke.3
- v1.30.0-gke.2
- v1.30.0-gke.1
- v1.29.0-gke.7
- v1.29.0-gke.6
- v1.29.0-gke.5
- v1.29.0-gke.4
- v1.29.0-gke.3
- v1.29.0-gke.2
- v1.29.0-gke.1
- v1.28.0-gke.9
- v1.28.0-gke.8
- v1.28.0-gke.7
- v1.28.0-gke.6
- v1.28.0-gke.5
- v1.28.0-gke.4
- v1.28.0-gke.3
- v1.28.0-gke.2
- v1.28.0-gke.1
- v1.27.0-gke.9
- v1.27.0-gke.8
- v1.27.0-gke.7
- v1.27.0-gke.6
- v1.27.0-gke.5
- v1.27.0-gke.4
- v1.27.0-gke.3
- v1.26.0-gke.9
- v1.26.0-gke.8
- v1.26.0-gke.7
- v1.26.0-gke.6
- v1.25.0-gke.8
What's next?
- Set up managed data collection with Managed Service for Prometheus
- Using Metrics Explorer
- Create logs-based metrics
- Building queries for Cloud Monitoring
- Setting up Alerting
- The GKE Enterprise overview