Time Series#

Time series for the Google Stackdriver Monitoring API (V3).

Features intentionally omitted from this first version of the client library:
  • Writing time series.
  • Natural representation of distribution values.
class google.cloud.monitoring.timeseries.Point[source]#

Bases: google.cloud.monitoring.timeseries.Point

A single point in a time series.

  • end_time (str) – The end time in RFC3339 UTC “Zulu” format.
  • start_time (str) – (Optional) The start time in RFC3339 UTC “Zulu” format.
  • value (object) – The metric value. This can be a scalar or a distribution.

Create new instance of Point(end_time, start_time, value)

class google.cloud.monitoring.timeseries.TimeSeries[source]#

Bases: google.cloud.monitoring.timeseries.TimeSeries

A single time series of metric values.

The preferred way to construct a TimeSeries object is using the time_series() factory method of the Client class.

  • metric (Metric) – A metric object.
  • resource (Resource) – A resource object.
  • metric_kind (str) – The kind of measurement: MetricKind.GAUGE, MetricKind.DELTA, or MetricKind.CUMULATIVE. See MetricKind.
  • value_type (str) – The value type of the metric: ValueType.BOOL, ValueType.INT64, ValueType.DOUBLE, ValueType.STRING, or ValueType.DISTRIBUTION. See ValueType.
  • points (list of Point) – A list of point objects.

Create new instance of TimeSeries(metric, resource, metric_kind, value_type, points)


Copy everything but the point data.

Parameters:points (list of Point, or None) – An optional point list.
Return type:TimeSeries
Returns:The new time series object.

A single dictionary with values for all the labels.

This combines resource.labels and metric.labels and also adds "resource_type".