This topic describes how Anthos attached clusters integrates with Cloud Monitoring and how to view your metrics.
Before you begin
Fulfill the prerequisites for Anthos attached clusters.
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
your cluster. This agent is based on
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:
In the Google Cloud console, select Monitoring, and then select leaderboard Metrics Explorer, or click the following button:
- In the Select a metric pane, expand the Metric menu,
Kubernetes Containerin 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 Container.
- In the Active metrics menu, select CPU usage time.
- Click Apply.
- 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 deleteDelete.
- To access the alignment fields, click More Options.
- 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.
- 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
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
- Using Metrics Explorer
- Create logs-based metrics
- Building queries for Cloud Monitoring
- Setting up Alerting
- Use the Anthos overview