Collect metrics overview

This document describes what metrics are automatically available to you when you use Google Cloud services. It also describes different approaches that you can use to collect additional information about the performance of your services.

You can monitor the (numeric) metric data stored in your Google Cloud project by creating alerting policies. These policies notify you when the data monitored by the policy meets criteria that you define. You can also visualize your metric data by creating charts and dashboards.

The metrics scope of a Google Cloud project determines the time-series data that can be charted or monitored by the Google Cloud project. By default, the metrics scope limits the project to the time-series data stored by project. You can configure a metrics scope to include time-series data that is stored by other projects. For conceptual information and references to configuration documents, see Metrics scopes overview.

Metrics from Google Cloud services

System metrics generated by Google Cloud services are automatically collected and stored by Cloud Monitoring. These metrics provide information about how the service is operating. For example, Compute Engine reports over 25 unique metrics for each virtual machine (VM) instance.

For a complete list of available system metrics, see Google Cloud metrics.

Metrics from your VMs

Some system metrics are automatically captured from your Compute Engine instances. However, these automatically collected Compute Engine metrics might not provide you with all the information that you need to monitor your services.

To collect additional system metrics from your Compute Engine instances, install an agent. For example, the Ops Agent metrics include those for CPU, disk, memory, and swap. These metrics, and others, can be collected from your Linux and Windows VMs.

For agent information, see Google Cloud Observability agents.

Metrics from integrations

Cloud Monitoring provides integrations that let you collect telemetry from applications such as Apache Web Server, MySQL, Redis, and others for deployments running on Compute Engine and Google Kubernetes Engine:

In the Google Cloud console, go to the  Integrations page:

Go to Integrations

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

Metrics you define

You can instrument your application so that it collects application-specific information. Several open-source instrumentation frameworks let you collect metrics, logs, and traces from your application and send that data to any vendor, including Google Cloud. To instrument your application, we recommend that you use a vendor-neutral instrumentation framework that is open source, such as OpenTelemetry, instead of vendor- and product-specific APIs or client libraries.

For information about instrumenting your applications by using vendor-neutral instrumentation frameworks, see Instrumentation and observability.

You can instrument your application by using a client library or the Cloud Monitoring API. For more information about these approaches, see User-defined metrics overview.

Metrics derived from logs

Google Cloud supports creating metrics from log data. These log-based metrics record numeric information about the logs written to Cloud Logging. Some metrics, such as the total number of log entries received by your Google Cloud project, are automatically derived from your logs. You can also define log-based metrics. For example, you might create a metric that counts the number of 404 Not Found errors for an application deployed to App Engine.

For more information, see Log-based metrics overview.

Pricing

In general, Cloud Monitoring system metrics are free, and metrics from external systems, agents, or applications are not. Billable metrics are billed by either the number of bytes or the number of samples ingested.

For more information about Cloud Monitoring pricing, see the following documents: