Queries the monitoring data of an Elastic Compute Service (ECS) instance. The monitoring data includes the vCPU utilization, CPU credits of the burstable instance, received data traffic, sent data traffic, and average bandwidth.
Usage notes
Take note of the following items:
- Up to 400 monitoring data entries can be returned at a time. An error is returned if the value that is calculated by using the following formula is greater than 400:
(EndTime − StartTime)/Period. - You can query the monitoring data of the previous 30 days. If the value of the
StartTimeparameter is more than 30 days earlier than the current time, an error is returned. - In some scenarios, such as when the instance is in the Stopped state, the system cannot obtain the relevant information and a portion may be missing from the returned monitoring data.
- You cannot obtain the CPU basic monitoring of an ECS bare metal instance. You can install the CloudMonitor agent to obtain the CPU monitoring information. For more information, see InstallCloudMonitor.
Debugging
Request parameters
|
Parameter |
Type |
Required |
Example |
Description |
| Action | String | Yes | DescribeInstanceMonitorData | The operation that you want to perform. Set the value to DescribeInstanceMonitorData. |
| InstanceId | String | Yes | i-bp1a36962lrhj4ab**** | The instance ID. |
| StartTime | String | Yes | 2014-10-29T23:00:00Z | The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. If the value of seconds ( |
| EndTime | String | Yes | 2014-10-30T08:00:00Z | The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. If the value of seconds ( |
| Period | Integer | No | 60 | The interval at which to retrieve monitoring data. Unit: seconds. Valid values:
Default value: 60. |
Response parameters
Parameter |
Type |
Example |
Description |
| RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E | The ID of the request. |
| MonitorData | Array of InstanceMonitorData | The monitoring data of the instance. |
|
| InstanceMonitorData | |||
| CPUCreditBalance | Float | 120 | The total number of CPU credits of the burstable instance. |
| BPSRead | Integer | 1000 | The read bandwidth of the disks (system disk and data disks). Unit: Byte/s. |
| InternetTX | Integer | 343 | The volume of data traffic sent by the instance to the Internet during the period specified by the |
| CPU | Integer | 2 | The vCPU utilization of the instance. Unit: percent (%). |
| CPUCreditUsage | Float | 30 | The number of CPU credits consumed by the burstable instance. |
| IOPSWrite | Integer | 200 | The number of write I/O operations per second on the disks (system disk and data disks). |
| IntranetTX | Integer | 343 | The volume of data traffic sent by the instance to the internal network during the period specified by the |
| InstanceId | String | i-bp1a36962lrhj4**** | The instance ID. |
| BPSWrite | Integer | 13585 | The write bandwidth of the disks (system disk and data disks). Unit: Byte/s. |
| CPUNotpaidSurplusCreditUsage | Float | 0.5 | The unpaid overdrawn CPU credits. |
| CPUAdvanceCreditBalance | Float | 0.4 | The overdrawn CPU credits of the burstable instance. |
| IOPSRead | Integer | 1000 | The number of read I/O operations per second on the disks (system disk and data disks). |
| InternetBandwidth | Integer | 10 | The public bandwidth of the instance. Unit: Kbit/s. |
| InternetRX | Integer | 122 | The volume of data traffic received by the instance from the Internet during the period specified by the |
| TimeStamp | String | 2014-10-30T05:00:00Z | The timestamp when the monitoring data was queried. |
| IntranetRX | Integer | 122 | The volume of data traffic received by the instance from the internal network during the period specified by the |
| IntranetBandwidth | Integer | 10 | The internal bandwidth of the instance. Unit: Kbit/s. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=DescribeInstanceMonitorData
&EndTime=2014-10-30T08:00:00Z
&InstanceId=i-bp1a36962lrhj4ab****
&StartTime=2014-10-29T23:00:00Z
&Period=3600
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeInstanceMonitorDataResponse>
<RequestId>C8B26B44-0189-443E-9816-D951F59623A9</RequestId>
<MonitorData>
<InstanceMonitorData>
<InstanceId>i-bp1a36962lrhj4ab****</InstanceId>
<CPU>2</CPU>
<IntranetRX>122</IntranetRX>
<IntranetTX>343</IntranetTX>
<IntranetFlow>675</IntranetFlow>
<IntranetBandwidth>10</IntranetBandwidth>
<InternetRX>122</InternetRX>
<InternetTX>343</InternetTX>
<InternetFlow>675</InternetFlow>
<InternetBandwidth>10</InternetBandwidth>
<IOPSRead>1000</IOPSRead>
<IOPSWrite>200</IOPSWrite>
<BPSRead>1000</BPSRead>
<BPSWrite>13585</BPSWrite>
<TimeStamp>2014-10-30T05:00:00Z</TimeStamp>
</InstanceMonitorData>
</MonitorData>
</DescribeInstanceMonitorDataResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "C8B26B44-0189-443E-9816-D951F59623A9",
"MonitorData" : {
"InstanceMonitorData" : [ {
"InstanceId" : "i-bp1a36962lrhj4ab****",
"CPU" : 0,
"IntranetRX" : 122,
"IntranetTX" : 343,
"IntranetFlow" : 675,
"IntranetBandwidth" : 10,
"InternetRX" : 122,
"InternetTX" : 343,
"InternetFlow" : 675,
"InternetBandwidth" : 10,
"IOPSRead" : 1000,
"IOPSWrite" : 13585,
"BPSRead" : 1000,
"BPSWrite" : 200,
"TimeStamp" : "2014-10-30T05:00:00Z"
} ]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
| 400 | InvalidEndTime.Malformed | The specified parameter "EndTime" is not valid. | Invalid EndTime value. |
| 400 | InvalidParameter.TooManyDataQueried | Too many data queried. | The maximum amount of monitoring data that can be queried is exceeded. |
| 400 | Throttling | Request was denied due to request throttling. | The request is denied due to throttling. |
| 400 | InvalidStartTime.ValueNotSupported | The specified parameter StartTime is later than EndTime. | The end time cannot be earlier than the start time. |
| 500 | InternalError | The request processing has failed due to some unknown error. | An internal error occurred. Try again later. |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The instance ID is not found. |
For a list of error codes, see Service error codes.