Queries the monitoring data of an elastic container instance.
Operation description
- A maximum of 50 monitoring data entries can be returned. If the number of monitoring data entries exceeds this limit, an error message is returned.
- You can query real-time monitoring data (data generated within the last 5 minutes) and historical data (data generated more than 5 minutes ago). If the time range to query starts or ends later than the current time, historical monitoring data generated more than 5 minutes ago is returned.
- The elastic container instance whose monitoring data you want to query must be created after April 3, 2019, 15:00 UTC+8.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
eci:DescribeContainerGroupMetric | get | *containergroup acs:eci:{#regionId}:{#accountId}:containergroup/{#containergroupId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the instance. | cn-hangzhou |
ContainerGroupId | string | Yes | The instance ID. | eci-bp17da5olmkuagfr**** |
StartTime | string | No | The beginning of the time range to query. The beginning of the time range must be a time point in the last 30 days. The default value is 5 minutes before the value of EndTime. Specify the time in RFC 3339 format. For example, to query the data starting from March 12, 2019, 09:00 UTC+8, you can set the parameter to 2019-03-12T09:00:00.000+08:00 or 2019-03-12T01:00:00.000Z. | 2019-03-12T01:00:00.000Z |
EndTime | string | No | The end of the time range to query. The default value is the current time. Specify the time in RFC 3339 format. | 2019-09-12T01:05:00.000Z |
Period | string | No | The data aggregation period. Unit: seconds. Valid values: 15, 30, 60, and 600. Default value: 60. Note
If the StartTime and EndTime parameters are not specified, the system returns the monitoring data generated in the last 5 minutes with a data aggregation period of 15s. The Period parameter is ignored.
| 15 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "D81A4A13-6DCC-4579-AC62-90A6C3EC7BBC",
"ContainerGroupId": "eci-bp1dqpye03ke5s6p****",
"Records": [
{
"Network": {
"Interfaces": [
{
"RxErrors": 0,
"TxDrops": 0,
"TxBytes": 1381805699,
"RxPackets": 4800583,
"TxPackets": 5158427,
"Name": "eth0",
"TxErrors": 0,
"RxBytes": 505001954,
"RxDrops": 0
}
]
},
"CPU": {
"UsageNanoCores": 0,
"Limit": 2000,
"UsageCoreNanoSeconds": 70769883,
"Load": 0
},
"Disk": [
{
"WriteBytes": 1375109120,
"WriteIO": 123,
"Device": "/dev/vda",
"ReadIO": 123,
"ReadBytes": 210714112
}
],
"Timestamp": "2021-08-25T16:22:00.000+08:00",
"Memory": {
"Rss": 9289728,
"UsageBytes": 9289728,
"WorkingSet": 9289728,
"AvailableBytes": 4285091840,
"Cache": 9289728
},
"Filesystem": [
{
"Capacity": 41610981376,
"Available": 35319836672,
"FsName": "/dev/root",
"Usage": 4368744448,
"Category": "System"
}
],
"Containers": [
{
"CPU": {
"UsageNanoCores": 0,
"Limit": 1024,
"UsageCoreNanoSeconds": 40876694,
"Load": 0
},
"Memory": {
"Rss": 9289728,
"UsageBytes": 9289728,
"WorkingSet": 9289728,
"AvailableBytes": 4285091840,
"Cache": 9289728
},
"Name": "u1"
}
]
}
]
}
Error codes
For a list of error codes, visit the Service error codes.