- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- TimeSeriesDescriptor
- ValueDescriptor
- TimeSeriesData
- LabelValue
- PointData
- Try it!
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.
HTTP request
POST https://monitoring.googleapis.com/v3/{name}/timeSeries:query
Path parameters
Parameters | |
---|---|
name |
Required. The project on which to execute the request. The format is:
|
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "query": string, "pageSize": integer, "pageToken": string } |
Fields | |
---|---|
query |
Required. The query in the Monitoring Query Language format. The default time zone is in UTC. |
page |
A positive number that is the maximum number of timeSeriesData to return. |
page |
If this field is not empty then it must contain the |
Response body
The timeSeries.query
response. For information about the status of Monitoring Query Language (MQL), see the MQL deprecation notice.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{ "timeSeriesDescriptor": { object ( |
Fields | |
---|---|
time |
The descriptor for the time series data. |
time |
The time series data. |
next |
If there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as |
partial |
Query execution errors that may have caused the time series data returned to be incomplete. The available data will be available in the response. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/monitoring
https://www.googleapis.com/auth/monitoring.read
For more information, see the Authentication Overview.
TimeSeriesDescriptor
A descriptor for the labels and points in a time series.
JSON representation |
---|
{ "labelDescriptors": [ { object ( |
Fields | |
---|---|
label |
Descriptors for the labels. |
point |
Descriptors for the point data value columns. |
ValueDescriptor
A descriptor for the value columns in a data point.
JSON representation |
---|
{ "key": string, "valueType": enum ( |
Fields | |
---|---|
key |
The value key. |
value |
The value type. |
metric |
The value stream kind. |
unit |
The unit in which |
TimeSeriesData
Represents the values of a time series associated with a TimeSeriesDescriptor.
JSON representation |
---|
{ "labelValues": [ { object ( |
Fields | |
---|---|
label |
The values of the labels in the time series identifier, given in the same order as the |
point |
The points in the time series. |
LabelValue
A label value.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field value . The label value can be a bool, int64, or string. value can be only one of the following: |
|
bool |
A bool label value. |
int64 |
An int64 label value. |
string |
A string label value. |
PointData
A point's value columns and time interval. Each point has one or more point values corresponding to the entries in pointDescriptors
field in the TimeSeriesDescriptor associated with this object.
JSON representation |
---|
{ "values": [ { object ( |
Fields | |
---|---|
values[] |
The values that make up the point. |
time |
The time interval associated with the point. |