Value types and metric kinds

In the discussion of the metric model, the section Metric types provides a general discussion of the attributes that describe a metric type. This section provides a more detailed discussion of two of those attributes:

  • Value type
  • Metric kind

Value type

The value type is the data type for the measurements. Each time series records the value type (type ValueType) for its data points.

  • For measurements consisting of a single value at a time, like boolean values and numeric data, the value type tells you how the data is stored:

    • BOOL, a boolean
    • INT64, a 64-bit integer
    • DOUBLE, a double-precision float
    • STRING, a string
  • For distribution measurements, the value isn't a single value but a group of values. The value type for distribution measurements is DISTRIBUTION.

    A distribution contains statistics that summarize a group of values. The values in a distribution include the mean, count, max, and other statistics, computed for a group of values. A distribution can also include a histogram that represents how the values are distributed across a set of ranges.

Latency metrics typically capture data as distributions. For more information about distributions, see the Distribution reference page.

Metric kind

Each time series includes the metric kind (type MetricKind) for its data points. The kind of metric data tells you how to interpret the values relative to each other. Cloud Monitoring metrics are one of three kinds:

  • A gauge metric, in which the value measures a specific instant in time. For example, metrics measuring CPU utilization are gauge metrics; each point records the CPU utilization at the time of measurement. Another example of a gauge metric is the current temperature.

  • A delta metric, in which the value measures the change in a time interval. For reads, the time interval is half-open, it excludes the start time but includes the end time: (startTime, endTime]. For example, metrics measuring request counts are delta metrics; each value records how many requests were received after the start time, up to and including the end time.

  • A cumulative metric, in which the value constantly increases over time. For example, a metric for “sent bytes” might be cumulative; each value records the total number of bytes sent by a service at that time.