Metrics, time series, and resources

Cloud Monitoring collects measurements to help you understand how your applications and system services are performing. A collection of these measurements is generically called a metric. The applications and system services being monitored are called monitored resources.

There are 1,500 types of metrics available in Monitoring, for monitoring Google Cloud, AWS, and a variety of third-party software. You can find the complete set at Metrics list. And if you need something that isn't already defined, you can create your own.

There are 100 types of monitored resources available. For the current list, see Monitored resource list.

Overview

This page describes Cloud Monitoring's model for monitoring data, which consists of three primary concepts:

  • Monitored-resource types
  • Metric types
  • Time series

This page introduces and describes each of these concepts and how they are related. Start here if these concepts are new to you.

These concepts are covered in more concrete detail in Components of the metric model.

For information on these concepts and how they map to the Cloud Monitoring API, see Structure of time series, particularly if you plan to use the Monitoring API or custom metrics.

The Cloud Monitoring metric model

A metric is a set of related measurements of some attribute of a resource you are monitoring. Measurements might include the latency of requests to a service, the amount of disk space available on a machine, the number of tables in your SQL database, the number of widgets sold, and so forth. Resources might include virtual machines (VMs), database instances, disks, and so forth.

The general notion of a metric in Cloud Monitoring encompasses three primary components:

  • Information about the source of the measurements.
  • A set of time-stamped measurements of the value of some property.
  • Information about the values of the property being measured.

For example, suppose you want to track the number of widgets sold by your stores. The components of the model map to this example in the following ways:

  • Source of the measurements

    The metric model records information about each resource being monitored. The particular information captured depends on the type of resource being monitored: it might include geographical locations, method names, disk IDs, and so forth, anything that might be the source of measurements.

    Resource info might include information like project, location, or method.

    The source of monitoring data is called a monitored resource.

    Example: In the widget-sales example, the monitored resources are the stores selling the widgets.

  • Measurements

    The metric model captures measurements of a property as a set of data points, consisting of time-stamped values.

    Values are collected as an array of time-stamped values.

    Values are typically numeric, but it depends on what you're measuring.

    Example: In the widget-sales example, the measurements record sales information at points in time. Such measurements might look like the following:

    [(150, 2019-05-23T17:37:00-04:00),
     (229, 2019-05-23T17:38:00-04:00),
     (138, 2018-05-23T17:39:00-04:00),
     ...]
  • Information about the values

    The measurement values are meaningless without information about how to interpret them. You need to have some “type” information about the values, like data type, unit, and kind of each measurement:

    • Is the value an integer or a string?
    • Does the value represent miles per hour or radians?
    • Does the value represent the total at the time, or the change since the previous value?

    Information about the values includes data type and other information.

    Cloud Monitoring calls each set of characteristics about something you want to measure a metric type.

    Example: In the widget-sales example, this information might tell you the following:

    • Each value is recorded as a 64-bit integer.
    • Each value represents a count of widgets sold.
    • Each value represents the number of widgets sold since the last recorded measurement.

Time series: putting the components together

In Cloud Monitoring, the data structure that underlies this model is the time series (the singular and the plural forms are the same).

Each time series encompasses the three components of the model:

  • A description of the monitored resource from which the data originated.
  • The set of time-stamped values associated with a single monitored resource.
  • A description of the metric type that describes what you are measuring.

Components of a time series: data points, type info, resource info.

Example: In the widget-sales example, a time series includes the following:

  • A description of the store that sold the widgets counted in this time series.
  • The set of time-stamped values recorded for this store.
  • A description of the values: 64-bit integers measuring the number of widgets sold since the previous recorded value.

A single Cloud Monitoring metric type or monitored-resource type can be associated with many related time series. In the widget-sales example, each store that sells widgets stores its data in a time series, so if there are 15 stores selling widgets, there can be 15 time series recording widget sales.

What's next