All Products
Search
Document Center

Elastic Compute Service:DescribeInstanceMonitorData

Last Updated:Sep 29, 2024

Queries the monitoring data of an Elastic Compute Service (ECS) instance. The monitoring data can include the vCPU utilization, CPU credits of the burstable instance, amount of received data traffic, amount of sent data traffic, and average bandwidth.

Operation description

Usage notes

Take note of the following items:

  • Up to 400 monitoring data entries can be returned at a time. Make sure that the TotalCount value does not exceed 400. The value is calculated by using the following formula: TotalCount = (EndTime - StartTime)/Period. If the TotalCount value is greater than 400, the InvalidParameter.TooManyDataQueried error is returned.
  • You can query the monitoring data in the last 30 days. If the value of StartTime 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 specific information may be missing from the returned monitoring data.
  • You cannot call this operation to obtain the CPU basic monitoring information of an ECS bare metal instance. To obtain the CPU monitoring information of an ECS bare metal instance, install the CloudMonitor agent on the instance. For more information, see InstallCloudMonitor .

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeInstanceMonitorDataget
  • Instance
    acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The instance ID.

i-bp1a36962lrhj4ab****
StartTimestringYes

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 (ss) is not 00, the time is rounded up to the next minute.

2014-10-29T23:00:00Z
EndTimestringYes

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 (ss) is not 00, the time is rounded up to the next minute.

2014-10-30T08:00:00Z
PeriodintegerNo

The interval at which to retrieve monitoring data. Unit: seconds. Valid values:

  • 60
  • 600
  • 3600

Default value: 60.

60

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
MonitorDataarray<object>

The monitoring data of the instance.

InstanceMonitorDataobject
CPUCreditBalancefloat

The total number of CPU credits of the burstable instance.

120
BPSReadinteger

The read bandwidth of the cloud disks (system disk and data disks). Unit: Byte/s.

1000
InternetTXinteger

The Internet traffic sent by the instance during the period that is specified by the Period parameter. The period starts from the point in time that is specified by the TimeStamp parameter. Unit: Kbit.

343
CPUinteger

The vCPU utilization of the instance. Unit: percent (%).

2
CPUCreditUsagefloat

The number of CPU credits consumed by the burstable instance.

30
IOPSWriteinteger

The number of write I/O operations per second on the cloud disks (system disk and data disks).

200
IntranetTXinteger

The internal data traffic sent by the instance during the period that is specified by the Period parameter. The period starts from the point in time that is specified by the TimeStamp parameter. Unit: Kbit.

343
InstanceIdstring

The instance ID.

i-bp1a36962lrhj4****
BPSWriteinteger

The write bandwidth of the cloud disks (system disk and data disks). Unit: Byte/s.

13585
CPUNotpaidSurplusCreditUsagefloat

The unpaid overdrawn CPU credits.

0.5
CPUAdvanceCreditBalancefloat

The overdrawn CPU credits of the burstable instance.

0.4
IOPSReadinteger

The number of read I/O operations per second on the cloud disks (system disk and data disks).

1000
InternetBandwidthinteger

The public bandwidth of the instance. Unit: Kbit/s.

10
InternetRXinteger

The Internet traffic received by the instance during the period that is specified by the Period parameter. The period starts from the point in time that is specified by the TimeStamp parameter. Unit: Kbit.

122
TimeStampstring

The timestamp of the monitoring data.

2014-10-30T05:00:00Z
IntranetRXinteger

The internal data traffic received by the instance during the period that is specified by the Period parameter. The period starts from the point in time that is specified by the TimeStamp parameter. Unit: Kbit.

122
IntranetBandwidthinteger

The internal bandwidth of the instance. Unit: Kbit/s.

10

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InvalidStartTime.MalformedThe specified parameter "StartTime" is not valid.-
400InvalidEndTime.MalformedThe specified parameter "EndTime" is not valid.The specified EndTime parameter is invalid.
400InvalidPeriod.ValueNotSupportedThe specified parameter "Period" is not valid.-
400InvalidStartTime.TooEarlyThe specified parameter "StartTime" is too early.-
400InvalidParameter.TooManyDataQueriedToo many data queried.-
400ThrottlingRequest was denied due to request throttling.-
400InvalidStartTime.ValueNotSupportedThe specified parameter StartTime is later than EndTime.-
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.The specified instance does not exist.
500InternalErrorThe request processing has failed due to some unknown error.An internal error has occurred. Try again later.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history