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.
Description
When you call this operation, 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 calculated based on the following formula is greater than 400:
(EndTime - StartTime)/Period
. - You can query the monitoring data of the last 30 days. If the value of the
StartTime
parameter 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.
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 ID of the instance. |
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 period in 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 about the instance. |
|
InstanceMonitorData | |||
CPUCreditBalance | Float | 120 |
The total 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 public data traffic sent by the instance 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 internal data traffic sent by the instance during the period specified by the
|
InstanceId | String | i-bp1a36962lrhj4**** |
The ID of the instance. |
BPSWrite | Integer | 13585 |
The write bandwidth of the disks (system disk and data disks). Unit: Byte/s. |
CPUNotpaidSurplusCreditUsage | Float | 0.5 |
The unpaid excess 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 public data traffic received by the instance during the period specified by the
|
TimeStamp | String | 2014-10-30T05:00:00Z |
The timestamp of monitoring data query. |
IntranetRX | Integer | 122 |
The internal data traffic received by the instance 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 | InvalidStartTime.Malformed | The specified parameter "StartTime" is not valid. | The error message returned because the specified StartTime parameter is invalid. |
400 | InvalidEndTime.Malformed | The specified parameter "EndTime" is not valid. | The error message returned because the specified EndTime parameter is invalid. |
400 | InvalidPeriod.ValueNotSupported | The specified parameter "Period" is not valid. | The error message returned because the specified Period parameter is invalid. |
400 | InvalidStartTime.TooEarly | The specified parameter "StartTime" is too early. | The error message returned because the specified start time is more than 30 days earlier than the current time. |
400 | InvalidParameter.TooManyDataQueried | Too many data queried. | The error message returned because the amount of queried monitoring data has reached the upper limit. |
400 | Throttling | Request was denied due to request throttling. | The error message returned because the request is denied due to throttling. Try again later. |
400 | InvalidStartTime.ValueNotSupported | The specified parameter StartTime is later than EndTime. | The error message returned because the specified end time is earlier than the specified start time. |
500 | InternalError | The request processing has failed due to some unknown error. | The error message returned because an internal error has occurred. Try again later. If the problem persists, submit a ticket. |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The error message returned because the specified InstanceId parameter does not exist. Check whether the instance ID is correct. |
For a list of error codes, visit the API Error Center.