This page provides information about how long Cloud Monitoring retains your metric data, and information about the latency between the collection of the data and its visibility to you.
Quotas and limits provides additional information about limits on metric data.
Retention of metric data
Cloud Monitoring acquires metric data and holds it in the time series of metric types for a period of time. This period of time varies with the metric type; See Data retention for details.
At the end of that period, Monitoring deletes the expired data points.
When all the points in a time series have expired, Monitoring deletes the time series. Deleted time series do not appear in Monitoring charts or in results from the Monitoring API.
Latency of metric data
Latency refers to how long it takes before a new metric data point is available in Monitoring after it is written. The time varies according to the monitored resource and other factors:
The descriptions of metric types included on the Metrics list often include a statement like this: “Sampled every 60 seconds. After sampling, data is not visible for up to 240 seconds.”
This means that Monitoring collects one measurement each minute (the sampling rate), but it can take up to 4 minutes before you can retrieve the data (latency). So, the time stamp recording the collection time might be up to 4 minutes old.
For example, consider the client library for Python. The time-series query method field labeled
minutesspecifies the time interval that the query covers. When you set
minutes=5, then the query retrieves data in the time interval
(now - 5 minutes, now]. Due to the latency of metric data, we recommend that you set this field to
If you are using custom metrics and you use the Monitoring API to write a new data point to an existing time series, you can retrieve the data in a few seconds.
In contrast, when you write the first data point to a new time series, you might have to wait a couple of minutes before you can retrieve the data. Writing a data point to a non-existent time series initiates the creation of the time series, and that takes some extra time.