Collect and view cAdvisor/Kubelet metrics Stay organized with collections Save and categorize content based on your preferences.
This page describes how to configure a Google Kubernetes Engine (GKE) cluster tosend a curated set of cAdvisor/Kubelet metrics toCloud Monitoring using Google Cloud Managed Service for Prometheus. This pagealso describes how these metrics are formatted when they are written toMonitoring, and how to query metrics.
The curated set of metrics is a subset of the set ofcAdvisor/Kubelet metrics built into every Kubernetes deploymentby default and includes metrics related to reducing ingestion volume andassociated costs.
Before you begin
Before you start, make sure that you have performed the following tasks:
- Enable the Google Kubernetes Engine API. Enable Google Kubernetes Engine API
- If you want to use the Google Cloud CLI for this task,install and theninitialize the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running the
gcloud components updatecommand. Earlier gcloud CLI versions might not support running the commands in this document.Note: For existing gcloud CLI installations, make sure to set thecompute/regionproperty. If you use primarily zonal clusters, set thecompute/zoneinstead. By setting a default location, you can avoid errors in the gcloud CLI like the following:One of [--zone, --region] must be supplied: Please specify location. You might need to specify the location in certain commands if the location of your cluster differs from the default that you set.
Requirements
To collect cAdvisor/Kubelet metrics, your GKEcluster must meet the following requirements:
- The cluster must be running GKE version1.29.3-gke.1093000 or later. cAdvisor/Kubeletpackages are enabled by default when you create a cluster running version1.29.3-gke.1093000 or later.
- The cluster must havesystem metricsenabled.
- The cluster hasGoogle Cloud Managed Service for Prometheus managed collectionenabled. Google Cloud Managed Service for Prometheus managed collectionis enabled by default for new clusters.
Configuring collection of cAdvisor/Kubelet metrics
You can enable cAdvisor/Kubelet metrics in an existingGKE cluster using the Google Cloud console, thegcloud CLI, or Terraform.
Console
To configure cAdvisor/Kubelet metrics from theDetailstab for the cluster, do the following:
In the Google Cloud console, go to theKubernetes clusters page:
If you use the search bar to find this page, then select the result whose subheading isKubernetes Engine.
Click your cluster's name.
In theFeatures row labelledCloud Monitoring,click theEdit icon.
In theEdit Cloud Monitoring dialog that appears, confirm thatEnable Cloud Monitoring is selected.
In theComponents drop-down menu, select thecAdvisor/Kubelet componentsfrom which you would like to collect metrics:
- cAdvisor
- Kubelet
ClickOK.
ClickSave Changes.
gcloud
Update your cluster to collect metrics:
gcloudcontainerclustersupdateCLUSTER_NAME\--location=COMPUTE_LOCATION\--enable-managed-prometheus\--monitoring=SYSTEM,CADVISOR,KUBELETReplace the following:
CLUSTER_NAME: the name of the existing cluster.COMPUTE_LOCATION: theCompute Engine locationof the cluster.
The set of values supplied to themonitoring flag overrides any previoussetting.
Terraform
To configure the collection of cAdvisor/Kubelet metrics by using Terraform,see themonitoring_config block in the Terraform registry forgoogle_container_cluster.For general information about using Google Cloud with Terraform, seeTerraform with Google Cloud.
Metric format
All Kubernetes cAdvisor/Kubelet metrics written to Cloud Monitoringuse the resource typeprometheus_target.Each metric name is prefixed withprometheus.googleapis.com/ and has a suffix indicating thePrometheus metric type, such as/gauge,/histogram,or/counter. Otherwise, each metric name isidentical to the metric name exposed by open source Kubernetes.
Exporting from Cloud Monitoring
The cAdvisor/Kubelet metrics can be exported from Cloud Monitoring byusing theCloud Monitoring API.Because all cAdvisor/Kubelet metrics are ingested by usingGoogle Cloud Managed Service for Prometheus,cAdvisor/Kubelet metrics can be queriedby using Prometheus Query Language (PromQL). They can also be queried byusingby using Monitoring Query Language (MQL).
Querying metrics
When you query cAdvisor/Kubelet metrics, the name you use depends onwhether you are using PromQL or Cloud Monitoring-based features likeMQL or the Metrics Explorermenu-driven interface.
The following tables of cAdvisor/Kubelet metrics show two versions of each metric name:
- PromQL metric name: Whenusing PromQL in Cloud Monitoring pages of the Google Cloud console or in PromQL fields of theCloud Monitoring API, use the PromQL metric name.
- Cloud Monitoring metric name When using other Cloud Monitoring features, use the Cloud Monitoring metric name in the tables below. This name must be prefixed with
prometheus.googleapis.com/, which has been omitted from the entries in the table.
cAdvisor metrics
The Cloud Monitoring metric names in this table must be prefixed withprometheus.googleapis.com/. That prefix has been omitted from theentries in the table.
| PromQL metric name Cloud Monitoring metric name | |
|---|---|
| Kind, Type, Unit Monitored resources Required GKE version | Description Labels |
container_cpu_cfs_periods_totalcontainer_cpu_cfs_periods_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Number of elapsed enforcement period intervals. Sampled every 30 seconds.cpu |
container_cpu_cfs_throttled_periods_totalcontainer_cpu_cfs_throttled_periods_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Number of throttled period intervals. Sampled every 30 seconds.cpu |
container_cpu_usage_seconds_totalcontainer_cpu_usage_seconds_total/counter | |
CUMULATIVE, DOUBLE, sprometheus_target 1.29.3-gke.1093000 | Cumulative cpu time consumed. Sampled every 30 seconds.cpu |
container_fs_limit_bytescontainer_fs_limit_bytes/gauge | |
GAUGE, DOUBLE, Byprometheus_target 1.29.3-gke.1093000 | Number of bytes that can be consumed by the container on this filesystem. Sampled every 30 seconds.disk |
container_fs_read_seconds_totalcontainer_fs_read_seconds_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Cumulative count of reads completed. Sampled every 30 seconds.diskIO |
container_fs_reads_bytes_totalcontainer_fs_reads_bytes_total/counter | |
CUMULATIVE, DOUBLE, Byprometheus_target 1.29.3-gke.1093000 | Cumulative count of bytes read. Sampled every 30 seconds.diskIO |
container_fs_reads_totalcontainer_fs_reads_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Cumulative count of reads completed. Sampled every 30 seconds.diskIO |
container_fs_usage_bytescontainer_fs_usage_bytes/gauge | |
GAUGE, DOUBLE, Byprometheus_target 1.29.3-gke.1093000 | Number of bytes that are consumed by the container on this filesystem. Sampled every 30 seconds.disk |
container_fs_write_seconds_totalcontainer_fs_write_seconds_total/counter | |
CUMULATIVE, DOUBLE, sprometheus_target 1.29.3-gke.1093000 | Cumulative count of seconds spent writing. Sampled every 30 seconds.diskIO |
container_fs_writes_bytes_totalcontainer_fs_writes_bytes_total/counter | |
CUMULATIVE, DOUBLE, Byprometheus_target 1.29.3-gke.1093000 | Cumulative count of bytes written. Sampled every 30 seconds.diskIO |
container_fs_writes_totalcontainer_fs_writes_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Cumulative count of writes completed. Sampled every 30 seconds.diskIO |
container_memory_rsscontainer_memory_rss/gauge | |
GAUGE, DOUBLE, Byprometheus_target 1.29.3-gke.1093000 | Size of RSS. Sampled every 30 seconds.memory |
container_memory_working_set_bytescontainer_memory_working_set_bytes/gauge | |
GAUGE, DOUBLE, Byprometheus_target 1.29.3-gke.1093000 | Current working set. Sampled every 30 seconds.memory |
container_network_receive_bytes_totalcontainer_network_receive_bytes_total/counter | |
CUMULATIVE, DOUBLE, Byprometheus_target 1.29.3-gke.1093000 | Cumulative count of bytes received. Sampled every 30 seconds.network |
container_network_receive_packets_dropped_totalcontainer_network_receive_packets_dropped_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Cumulative count of packets dropped while receiving. Sampled every 30 seconds.network |
container_network_receive_packets_totalcontainer_network_receive_packets_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Cumulative count of packets received. Sampled every 30 seconds.network |
container_network_transmit_bytes_totalcontainer_network_transmit_bytes_total/counter | |
CUMULATIVE, DOUBLE, Byprometheus_target 1.29.3-gke.1093000 | Cumulative count of bytes transmitted. Sampled every 30 seconds.network |
container_network_transmit_packets_dropped_totalcontainer_network_transmit_packets_dropped_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Cumulative count of packets dropped while transmitting. Sampled every 30 seconds.network |
container_network_transmit_packets_totalcontainer_network_transmit_packets_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Cumulative count of packets transmitted. Sampled every 30 seconds.network |
Kubelet metrics
The Cloud Monitoring metric names in this table must be prefixed withprometheus.googleapis.com/. That prefix has been omitted from theentries in the table.
| PromQL metric name Cloud Monitoring metric name | |
|---|---|
| Kind, Type, Unit Monitored resources Required GKE version | Description Labels |
kubelet_certificate_manager_server_ttl_secondskubelet_certificate_manager_server_ttl_seconds/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Gauge of the shortest TTL (time-to-live) of the Kubelet's serving certificate. The value is in seconds until certificate expiry (negative if already expired). If serving certificate is invalid or unused, the value will be +INF. Sampled every 30 seconds. |
kubelet_node_namekubelet_node_name/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | The node's name. The count is always 1. Sampled every 30 seconds.node |
kubelet_pleg_relist_duration_secondskubelet_pleg_relist_duration_seconds/histogram | |
CUMULATIVE, DISTRIBUTION, sprometheus_target 1.29.3-gke.1093000 | Duration in seconds for relisting pods in PLEG. Sampled every 30 seconds. |
kubelet_pod_worker_duration_secondskubelet_pod_worker_duration_seconds/histogram | |
CUMULATIVE, DISTRIBUTION, sprometheus_target 1.29.3-gke.1093000 | Duration in seconds to sync a single pod. Broken down by operation type: create, update, or sync. Sampled every 30 seconds.operation_type |
kubelet_running_containerskubelet_running_containers/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Number of containers currently running. Sampled every 30 seconds.container_state |
kubelet_running_podskubelet_running_pods/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Number of pods that have a running pod sandbox. Sampled every 30 seconds. |
kubelet_runtime_operations_totalkubelet_runtime_operations_total/counter | |
CUMULATIVE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Cumulative number of runtime operations by operation type. Sampled every 30 seconds.operation_type |
kubelet_volume_stats_available_byteskubelet_volume_stats_available_bytes/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Number of available bytes in the volume. Sampled every 30 seconds.namespacepersistentvolumeclaim |
kubelet_volume_stats_capacity_byteskubelet_volume_stats_capacity_bytes/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Capacity in bytes of the volume. Sampled every 30 seconds.namespacepersistentvolumeclaim |
kubelet_volume_stats_inodeskubelet_volume_stats_inodes/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Maximum number of inodes in the volume. Sampled every 30 seconds.namespacepersistentvolumeclaim |
kubelet_volume_stats_inodes_freekubelet_volume_stats_inodes_free/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Number of free inodes in the volume. Sampled every 30 seconds.namespacepersistentvolumeclaim |
kubelet_volume_stats_inodes_usedkubelet_volume_stats_inodes_used/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Number of used inodes in the volume. Sampled every 30 seconds.namespacepersistentvolumeclaim |
kubelet_volume_stats_used_byteskubelet_volume_stats_used_bytes/gauge | |
GAUGE, DOUBLE, 1prometheus_target 1.29.3-gke.1093000 | Number of used bytes in the volume. Sampled every 30 seconds.namespacepersistentvolumeclaim |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.