Queries the monitoring data in a specified namespace.

Prerequisites

Hybrid Cloud Monitoring is activated. For more information, see Activate Hybrid Cloud Monitoring.

Limits

The size of monitoring data that is returned in each call cannot exceed 1.5 MB. If the returned data reaches the upper limit, the query fails. You must reset the query conditions.

Description

This topic provides an example to show how to query the monitoring data of the AliyunEcs_cpu_total metric in the default-aliyun namespace from 1653804865 (14:14:25 on May 29, 2022) to 1653805225 (14:20:25 on May 29, 2022).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeHybridMonitorDataList

The operation that you want to perform. Set the value to DescribeHybridMonitorDataList.

Namespace String Yes default-aliyun

The name of the namespace.

For information about how to obtain the name of a namespace, see DescribeHybridMonitorNamespaceList.

PromSQL String Yes AliyunEcs_cpu_total

The name of the metric.

Note PromQL statements are supported.
Start Long Yes 1653804865

The timestamp that specifies the beginning of the time range to query.

Unit: seconds.

End Long Yes 1653805225

The timestamp that specifies the end of the time range to query.

Unit: seconds.

Period String No 60

The interval at which monitoring data is collected.

Unit: seconds.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code.

Note The status code 200 indicates that the call is successful.
Message String end timestamp must not be before start time.

The error message.

RequestId String C240412F-3F5F-50E2-ACEC-DE808EF9C4BE

The ID of the request.

Success String true

Indicates whether the call is successful. Valid values:

  • true: The call is successful.
  • false: The call fails.
TimeSeries Array of TimeSeries

The returned monitoring data.

MetricName String AliyunEcs_cpu_total

The name of the metric.

Labels Array of Label

The tags of the time dimension.

K String instanceId

The tag key.

V String i-rj99xc6cptkk64ml****

The tag value.

Values Array of Value

The metric values that are collected at different timestamps.

V String 0.13

The metric value.

Ts String 1653804865

The timestamp that indicates the time when the metric value is collected.

Unit: seconds.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeHybridMonitorDataList
&Namespace=default-aliyun
&PromSQL=AliyunEcs_cpu_total
&Start=1653804865
&End=1653805225
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeHybridMonitorDataList>
	<TimeSeries>
		<MetricName>AliyunEcs_cpu_total</MetricName>
		<Values>
			<V>0.13</V>
			<Ts>1653804865</Ts>
		</Values>
		<Values>
			<V>0.13</V>
			<Ts>1653804925</Ts>
		</Values>
		<Values>
			<V>0.13</V>
			<Ts>1653804985</Ts>
		</Values>
		<Values>
			<V>0.17</V>
			<Ts>1653805045</Ts>
		</Values>
		<Values>
			<V>0.23</V>
			<Ts>1653805105</Ts>
		</Values>
		<Values>
			<V>0.2</V>
			<Ts>1653805165</Ts>
		</Values>
		<Values>
			<V>0.13</V>
			<Ts>1653805225</Ts>
		</Values>
		<Labels>
			<V>rg-acfmw3ty5y7****</V>
			<K>rmgroup_id</K>
		</Labels>
		<Labels>
			<V>ESS</V>
			<K>tag_ess</K>
		</Labels>
		<Labels>
			<V>hostname1</V>
			<K>hostname</K>
		</Labels>
		<Labels>
			<V>i-rj99xc6cptkk64ml****</V>
			<K>instanceId</K>
		</Labels>
		<Labels>
			<V>cn-hangzhou</V>
			<K>regionId</K>
		</Labels>
		<Labels>
			<V>192.168.XX.XX</V>
			<K>ipgroup</K>
		</Labels>
		<Labels>
			<V>120886317861****</V>
			<K>userId</K>
		</Labels>
	</TimeSeries>
	<RequestId>C240412F-3F5F-50E2-ACEC-DE808EF9C4BE</RequestId>
	<Code>200</Code>
	<Success>true</Success>
</DescribeHybridMonitorDataList>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TimeSeries" : [ {
    "MetricName" : "AliyunEcs_cpu_total",
    "Values" : [ {
      "V" : "0.13",
      "Ts" : 1653804865
    }, {
      "V" : "0.13",
      "Ts" : 1653804925
    }, {
      "V" : "0.13",
      "Ts" : 1653804985
    }, {
      "V" : "0.17",
      "Ts" : 1653805045
    }, {
      "V" : "0.23",
      "Ts" : 1653805105
    }, {
      "V" : "0.2",
      "Ts" : 1653805165
    }, {
      "V" : "0.13",
      "Ts" : 1653805225
    } ],
    "Labels" : [ {
      "V" : "rg-acfmw3ty5y7****",
      "K" : "rmgroup_id"
    }, {
      "V" : "ESS",
      "K" : "tag_ess"
    }, {
      "V" : "hostname1",
      "K" : "hostname"
    }, {
      "V" : "i-rj99xc6cptkk64ml****",
      "K" : "instanceId"
    }, {
      "V" : "cn-hangzhou",
      "K" : "regionId"
    }, {
      "V" : "192.168.XX.XX",
      "K" : "ipgroup"
    }, {
      "V" : "120886317861****",
      "K" : "userId"
    } ]
  } ],
  "RequestId" : "C240412F-3F5F-50E2-ACEC-DE808EF9C4BE",
  "Code" : "200",
  "Success" : true
}

Error codes

For a list of error codes, visit the Error Center.