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
- organizations_time_series_list
- folders_time_series_list
Successful response
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. |
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 | The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data. For more information, see Monitored resources for custom metrics (https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). (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. |
Successful response
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. |
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 | The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data. For more information, see Monitored resources for custom metrics (https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). (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. |
Successful response
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. |
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 | The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data. For more information, see Monitored resources for custom metrics (https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom-metric-resources). (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. |
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
- organizations_time_series_list
- folders_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 filter = '{{ filter }}'
AND interval.endTime = '{{ interval.endTime }}'
AND interval.startTime = '{{ interval.startTime }}'
AND aggregation.alignmentPeriod = '{{ aggregation.alignmentPeriod }}'
AND aggregation.perSeriesAligner = '{{ aggregation.perSeriesAligner }}'
AND aggregation.crossSeriesReducer = '{{ aggregation.crossSeriesReducer }}'
AND aggregation.groupByFields = '{{ aggregation.groupByFields }}'
AND secondaryAggregation.alignmentPeriod = '{{ secondaryAggregation.alignmentPeriod }}'
AND secondaryAggregation.perSeriesAligner = '{{ secondaryAggregation.perSeriesAligner }}'
AND secondaryAggregation.crossSeriesReducer = '{{ secondaryAggregation.crossSeriesReducer }}'
AND secondaryAggregation.groupByFields = '{{ secondaryAggregation.groupByFields }}'
AND orderBy = '{{ orderBy }}'
AND view = '{{ view }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
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 filter = '{{ filter }}'
AND interval.endTime = '{{ interval.endTime }}'
AND interval.startTime = '{{ interval.startTime }}'
AND aggregation.alignmentPeriod = '{{ aggregation.alignmentPeriod }}'
AND aggregation.perSeriesAligner = '{{ aggregation.perSeriesAligner }}'
AND aggregation.crossSeriesReducer = '{{ aggregation.crossSeriesReducer }}'
AND aggregation.groupByFields = '{{ aggregation.groupByFields }}'
AND secondaryAggregation.alignmentPeriod = '{{ secondaryAggregation.alignmentPeriod }}'
AND secondaryAggregation.perSeriesAligner = '{{ secondaryAggregation.perSeriesAligner }}'
AND secondaryAggregation.crossSeriesReducer = '{{ secondaryAggregation.crossSeriesReducer }}'
AND secondaryAggregation.groupByFields = '{{ secondaryAggregation.groupByFields }}'
AND orderBy = '{{ orderBy }}'
AND view = '{{ view }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
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 filter = '{{ filter }}'
AND interval.endTime = '{{ interval.endTime }}'
AND interval.startTime = '{{ interval.startTime }}'
AND aggregation.alignmentPeriod = '{{ aggregation.alignmentPeriod }}'
AND aggregation.perSeriesAligner = '{{ aggregation.perSeriesAligner }}'
AND aggregation.crossSeriesReducer = '{{ aggregation.crossSeriesReducer }}'
AND aggregation.groupByFields = '{{ aggregation.groupByFields }}'
AND secondaryAggregation.alignmentPeriod = '{{ secondaryAggregation.alignmentPeriod }}'
AND secondaryAggregation.perSeriesAligner = '{{ secondaryAggregation.perSeriesAligner }}'
AND secondaryAggregation.crossSeriesReducer = '{{ secondaryAggregation.crossSeriesReducer }}'
AND secondaryAggregation.groupByFields = '{{ secondaryAggregation.groupByFields }}'
AND orderBy = '{{ orderBy }}'
AND view = '{{ view }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
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: string
description: Required parameter for the time_series resource.
- name: timeSeries
value: array
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.
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 }}"
}';