time_series
Creates, updates, deletes, gets or lists a time_series resource.
Overview
| Name | time_series |
| Type | Resource |
| Id | google.monitoring.time_series |
Fields
The following fields are returned by SELECT queries:
- projects_time_series_list
- folders_time_series_list
- organizations_time_series_list
| Name | Datatype | Description |
|---|---|---|
description | string | Input only. A detailed description of the time series that will be associated with the google.api.MetricDescriptor for the metric. Once set, this field cannot be changed through CreateTimeSeries. |
metadata | object | Output only. The associated monitored resource metadata. When reading a time series, this field will include metadata labels that are explicitly named in the reduction. When creating a time series, this field is ignored. (id: MonitoredResourceMetadata) |
metric | object | The associated metric. A fully-specified metric used to identify the time series. (id: Metric) |
metricKind | string | The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either GAUGE (the default) or CUMULATIVE. (METRIC_KIND_UNSPECIFIED, GAUGE, DELTA, CUMULATIVE) |
points | array | The data points of this time series. When listing time series, points are returned in reverse time order.When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be BOOL, INT64, DOUBLE, or DISTRIBUTION. |
resource | object | An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for "gce_instance" has labels "project_id", "instance_id" and "zone": { "type": "gce_instance", "labels": { "project_id": "my-project", "instance_id": "12345678901234", "zone": "us-central1-a" }} (id: MonitoredResource) |
unit | string | The units in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The unit defines the representation of the stored metric values. This field can only be changed through CreateTimeSeries when it is empty. |
valueType | string | The value type of the time series. When listing time series, this value type might be different from the value type of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the type of the data in the points field. (VALUE_TYPE_UNSPECIFIED, BOOL, INT64, DOUBLE, STRING, DISTRIBUTION, MONEY) |
| Name | Datatype | Description |
|---|---|---|
description | string | Input only. A detailed description of the time series that will be associated with the google.api.MetricDescriptor for the metric. Once set, this field cannot be changed through CreateTimeSeries. |
metadata | object | Output only. The associated monitored resource metadata. When reading a time series, this field will include metadata labels that are explicitly named in the reduction. When creating a time series, this field is ignored. (id: MonitoredResourceMetadata) |
metric | object | The associated metric. A fully-specified metric used to identify the time series. (id: Metric) |
metricKind | string | The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either GAUGE (the default) or CUMULATIVE. (METRIC_KIND_UNSPECIFIED, GAUGE, DELTA, CUMULATIVE) |
points | array | The data points of this time series. When listing time series, points are returned in reverse time order.When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be BOOL, INT64, DOUBLE, or DISTRIBUTION. |
resource | object | An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for "gce_instance" has labels "project_id", "instance_id" and "zone": { "type": "gce_instance", "labels": { "project_id": "my-project", "instance_id": "12345678901234", "zone": "us-central1-a" }} (id: MonitoredResource) |
unit | string | The units in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The unit defines the representation of the stored metric values. This field can only be changed through CreateTimeSeries when it is empty. |
valueType | string | The value type of the time series. When listing time series, this value type might be different from the value type of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the type of the data in the points field. (VALUE_TYPE_UNSPECIFIED, BOOL, INT64, DOUBLE, STRING, DISTRIBUTION, MONEY) |
| Name | Datatype | Description |
|---|---|---|
description | string | Input only. A detailed description of the time series that will be associated with the google.api.MetricDescriptor for the metric. Once set, this field cannot be changed through CreateTimeSeries. |
metadata | object | Output only. The associated monitored resource metadata. When reading a time series, this field will include metadata labels that are explicitly named in the reduction. When creating a time series, this field is ignored. (id: MonitoredResourceMetadata) |
metric | object | The associated metric. A fully-specified metric used to identify the time series. (id: Metric) |
metricKind | string | The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either GAUGE (the default) or CUMULATIVE. (METRIC_KIND_UNSPECIFIED, GAUGE, DELTA, CUMULATIVE) |
points | array | The data points of this time series. When listing time series, points are returned in reverse time order.When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be BOOL, INT64, DOUBLE, or DISTRIBUTION. |
resource | object | An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for "gce_instance" has labels "project_id", "instance_id" and "zone": { "type": "gce_instance", "labels": { "project_id": "my-project", "instance_id": "12345678901234", "zone": "us-central1-a" }} (id: MonitoredResource) |
unit | string | The units in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The unit defines the representation of the stored metric values. This field can only be changed through CreateTimeSeries when it is empty. |
valueType | string | The value type of the time series. When listing time series, this value type might be different from the value type of the associated metric if this time series is an alignment or reduction of other time series.When creating a time series, this field is optional. If present, it must be the same as the type of the data in the points field. (VALUE_TYPE_UNSPECIFIED, BOOL, INT64, DOUBLE, STRING, DISTRIBUTION, MONEY) |
Methods
The following methods are available for this resource:
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
foldersId | string | |
organizationsId | string | |
projectsId | string | |
aggregation.alignmentPeriod | string (google-duration) | |
aggregation.crossSeriesReducer | string | |
aggregation.groupByFields | string | |
aggregation.perSeriesAligner | string | |
filter | string | |
interval.endTime | string (google-datetime) | |
interval.startTime | string (google-datetime) | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
secondaryAggregation.alignmentPeriod | string (google-duration) | |
secondaryAggregation.crossSeriesReducer | string | |
secondaryAggregation.groupByFields | string | |
secondaryAggregation.perSeriesAligner | string | |
view | string |
SELECT examples
- projects_time_series_list
- folders_time_series_list
- organizations_time_series_list
Lists time series that match a filter.
SELECT
description,
metadata,
metric,
metricKind,
points,
resource,
unit,
valueType
FROM google.monitoring.time_series
WHERE projectsId = '{{ projectsId }}' -- required
AND secondaryAggregation.perSeriesAligner = '{{ secondaryAggregation.perSeriesAligner }}'
AND view = '{{ view }}'
AND orderBy = '{{ orderBy }}'
AND secondaryAggregation.groupByFields = '{{ secondaryAggregation.groupByFields }}'
AND aggregation.alignmentPeriod = '{{ aggregation.alignmentPeriod }}'
AND secondaryAggregation.crossSeriesReducer = '{{ secondaryAggregation.crossSeriesReducer }}'
AND interval.startTime = '{{ interval.startTime }}'
AND aggregation.perSeriesAligner = '{{ aggregation.perSeriesAligner }}'
AND interval.endTime = '{{ interval.endTime }}'
AND aggregation.groupByFields = '{{ aggregation.groupByFields }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
AND secondaryAggregation.alignmentPeriod = '{{ secondaryAggregation.alignmentPeriod }}'
AND pageToken = '{{ pageToken }}'
AND aggregation.crossSeriesReducer = '{{ aggregation.crossSeriesReducer }}'
;
Lists time series that match a filter.
SELECT
description,
metadata,
metric,
metricKind,
points,
resource,
unit,
valueType
FROM google.monitoring.time_series
WHERE foldersId = '{{ foldersId }}' -- required
AND pageToken = '{{ pageToken }}'
AND aggregation.crossSeriesReducer = '{{ aggregation.crossSeriesReducer }}'
AND aggregation.groupByFields = '{{ aggregation.groupByFields }}'
AND filter = '{{ filter }}'
AND secondaryAggregation.alignmentPeriod = '{{ secondaryAggregation.alignmentPeriod }}'
AND pageSize = '{{ pageSize }}'
AND aggregation.alignmentPeriod = '{{ aggregation.alignmentPeriod }}'
AND secondaryAggregation.crossSeriesReducer = '{{ secondaryAggregation.crossSeriesReducer }}'
AND secondaryAggregation.groupByFields = '{{ secondaryAggregation.groupByFields }}'
AND interval.endTime = '{{ interval.endTime }}'
AND interval.startTime = '{{ interval.startTime }}'
AND aggregation.perSeriesAligner = '{{ aggregation.perSeriesAligner }}'
AND secondaryAggregation.perSeriesAligner = '{{ secondaryAggregation.perSeriesAligner }}'
AND orderBy = '{{ orderBy }}'
AND view = '{{ view }}'
;
Lists time series that match a filter.
SELECT
description,
metadata,
metric,
metricKind,
points,
resource,
unit,
valueType
FROM google.monitoring.time_series
WHERE organizationsId = '{{ organizationsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND aggregation.crossSeriesReducer = '{{ aggregation.crossSeriesReducer }}'
AND aggregation.groupByFields = '{{ aggregation.groupByFields }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
AND secondaryAggregation.alignmentPeriod = '{{ secondaryAggregation.alignmentPeriod }}'
AND aggregation.alignmentPeriod = '{{ aggregation.alignmentPeriod }}'
AND secondaryAggregation.crossSeriesReducer = '{{ secondaryAggregation.crossSeriesReducer }}'
AND secondaryAggregation.groupByFields = '{{ secondaryAggregation.groupByFields }}'
AND interval.startTime = '{{ interval.startTime }}'
AND aggregation.perSeriesAligner = '{{ aggregation.perSeriesAligner }}'
AND interval.endTime = '{{ interval.endTime }}'
AND secondaryAggregation.perSeriesAligner = '{{ secondaryAggregation.perSeriesAligner }}'
AND view = '{{ view }}'
AND orderBy = '{{ orderBy }}'
;
INSERT examples
- projects_time_series_create
- Manifest
Creates or adds data to one or more time series. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response. This method does not support resource locations constraint of an organization policy (https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy).
INSERT INTO google.monitoring.time_series (
data__timeSeries,
projectsId
)
SELECT
'{{ timeSeries }}',
'{{ projectsId }}'
;
# Description fields are for documentation purposes
- name: time_series
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the time_series resource.
- name: timeSeries
description: |
Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each TimeSeries value must fully specify a unique time series by supplying all label values for the metric and the monitored resource.The maximum number of TimeSeries objects per Create request is 200.
value:
- metadata:
systemLabels: "{{ systemLabels }}"
userLabels: "{{ userLabels }}"
description: "{{ description }}"
metric:
type: "{{ type }}"
labels: "{{ labels }}"
metricKind: "{{ metricKind }}"
unit: "{{ unit }}"
valueType: "{{ valueType }}"
resource:
labels: "{{ labels }}"
type: "{{ type }}"
points: "{{ points }}"
Lifecycle Methods
- projects_time_series_query
Queries time series by using Monitoring Query Language (MQL). We recommend using PromQL instead of MQL. For more information about the status of MQL, see the MQL deprecation notice (https://cloud.google.com/stackdriver/docs/deprecations/mql).
EXEC google.monitoring.time_series.projects_time_series_query
@projectsId='{{ projectsId }}' --required
@@json=
'{
"query": "{{ query }}",
"pageSize": {{ pageSize }},
"pageToken": "{{ pageToken }}"
}'
;