Queries the monitoring data of an ECS instance. The metrics that you can query include the vCPU utilization, burstable instance credits, inbound data traffic, outbound data traffic, and average bandwidth of the ECS instance.
Operation description
Operation description
Take note of the following items when you call this operation:
-
A maximum of 400 data entries can be returned at a time. Make sure that the value of
(EndTime – StartTime)/Periodis less than or equal to 400. In other words, the value of theTotalCountresponse parameter cannot exceed 400. Otherwise, theInvalidParameter.TooManyDataQueriederror is returned. -
You can query monitoring data from the last 30 days. The
StartTimeparameter value cannot be more than 30 days before the current date. -
If some content is missing from the response, the system may not have obtained the corresponding information. For example, the instance was in the Stopped state at that time.
-
This operation cannot retrieve the basic CPU monitoring data of ECS Bare Metal instances. You can install the CloudMonitor agent to obtain CPU monitoring data. For more information, see Install the CloudMonitor agent.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeInstanceMonitorData |
get |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID of the instance to query. |
i-bp1a36962lrhj4ab**** |
| StartTime |
string |
Yes |
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 ( |
2014-10-29T23:00:00Z |
| EndTime |
string |
Yes |
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 ( |
2014-10-30T08:00:00Z |
| Period |
integer |
No |
The interval at which to retrieve monitoring data. Unit: seconds. Valid values: Default value: 60. Valid values:
|
60 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| MonitorData |
object |
||
| InstanceMonitorData |
array<object> |
The collection of instance monitoring data. |
|
|
object |
|||
| CPUCreditBalance |
number |
The total number of burstable instance credits. |
120 |
| BPSRead |
integer |
The read bandwidth of the instance disks (including the system disk and data disks). Unit: bytes/s. |
1000 |
| InternetTX |
integer |
The public outbound data traffic sent by the instance during the specified interval ( |
343 |
| CPU |
integer |
The vCPU utilization of the instance. Unit: percent (%). |
2 |
| CPUCreditUsage |
number |
The number of burstable instance credits consumed. |
30 |
| IOPSWrite |
integer |
The I/O write operations on the instance disks (including the system disk and data disks). Unit: operations/s. |
200 |
| IntranetTX |
integer |
The internal outbound data traffic sent by the instance during the specified interval ( |
343 |
| InstanceId |
string |
The instance ID. |
i-bp1a36962lrhj4**** |
| BPSWrite |
integer |
The write bandwidth of the instance disks (including the system disk and data disks). Unit: bytes/s. |
13585 |
| CPUNotpaidSurplusCreditUsage |
number |
The unpaid overdrawn CPU credits. |
0.5 |
| CPUAdvanceCreditBalance |
number |
The overdrawn CPU credits (the portion of burstable instance credits that exceeds the limit). |
0.4 |
| IOPSRead |
integer |
The I/O read operations on the instance disks (including the system disk and data disks). Unit: operations/s. |
1000 |
| InternetBandwidth |
integer |
The public bandwidth of the instance, which is the network traffic per unit of time. Unit: kbits/s. |
10 |
| InternetRX |
integer |
The public inbound data traffic received by the instance during the specified interval ( |
122 |
| TimeStamp |
string |
The timestamp of the monitoring data. |
2014-10-30T05:00:00Z |
| IntranetRX |
integer |
The internal inbound data traffic received by the instance during the specified interval ( |
122 |
| IntranetBandwidth |
integer |
The internal bandwidth of the instance, which is the network traffic per unit of time. Unit: kbits/s. |
10 |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"MonitorData": {
"InstanceMonitorData": [
{
"CPUCreditBalance": 120,
"BPSRead": 1000,
"InternetTX": 343,
"CPU": 2,
"CPUCreditUsage": 30,
"IOPSWrite": 200,
"IntranetTX": 343,
"InstanceId": "i-bp1a36962lrhj4****",
"BPSWrite": 13585,
"CPUNotpaidSurplusCreditUsage": 0.5,
"CPUAdvanceCreditBalance": 0.4,
"IOPSRead": 1000,
"InternetBandwidth": 10,
"InternetRX": 122,
"TimeStamp": "2014-10-30T05:00:00Z",
"IntranetRX": 122,
"IntranetBandwidth": 10
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidStartTime.Malformed | The specified parameter "StartTime" is not valid. | The specified StartTime parameter does not conform to the specification. |
| 400 | InvalidEndTime.Malformed | The specified parameter "EndTime" is not valid. | The specified EndTime parameter is invalid. |
| 400 | InvalidPeriod.ValueNotSupported | The specified parameter "Period" is not valid. | |
| 400 | InvalidStartTime.TooEarly | The specified parameter "StartTime" is too early. | |
| 400 | InvalidParameter.TooManyDataQueried | Too many data queried. | The monitoring data node is out of range. |
| 400 | Throttling | Request was denied due to request throttling. | The request is throttled. |
| 400 | InvalidStartTime.ValueNotSupported | The specified parameter StartTime is later than EndTime. | The specified start time is not within the allowed range. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instanceId is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.