Queries the monitoring data of an elastic container instance.

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.
  • You can query only the monitoring data of elastic container instances that are created after April 3, 2019 15:00 UTC+8.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeContainerGroupMetric

The operation that you want to perform. Set the value to DescribeContainerGroupMetric.

ContainerGroupId String Yes eci-bp17da5olmkuagfr****

The ID of the elastic container instance.

RegionId String Yes cn-hangzhou

The ID of the region.

StartTime String No 2019-03-12T01:00:00.000Z

The beginning of the time range to query. The beginning of the time range must be a time point in the past 30 days. The default value is 5 minutes before the value of EndTime.

Specify the time in RFC 3339 format. 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.

EndTime String No 2019-09-12T01:05:00.000Z

The end of the time range to query. The default value is the current time.

Specify the time in RFC 3339 format.

Period String No 15

The data aggregation period. Unit: seconds. Valid values: 15, 30, 60, and 600. Default value: 60.

Note If StartTime and EndTime 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.

Response parameters

Parameter Type Example Description
ContainerGroupId String eci-bp1dqpye03ke5s6p****

The ID of the elastic container instance.

Records Array of Record

The monitoring data of the elastic container instance.

CPU Struct

The monitoring data of vCPUs.

Limit Long 2000

The upper limit of vCPU usage (the maximum number of vCPUs × 1000).

Load Long 0

The average load in the last 10 seconds.

UsageCoreNanoSeconds Long 70769883

The cumulative usage of vCPUs.

UsageNanoCores Long 0

The vCPU usage in the sampling window. Unit for the sampling window: nanoseconds.

Containers Array of Container

The monitoring data of containers.

CPU Struct

The vCPU monitoring data of the container.

Limit Long 1024

The upper limit of vCPU usage (the maximum number of vCPUs × 1000).

Load Long 0

The average load in the last 10 seconds.

UsageCoreNanoSeconds Long 40876694

The cumulative usage of vCPUs.

UsageNanoCores Long 0

The vCPU usage in the sampling window. Unit for the sampling window: nanoseconds.

Memory Struct

The memory monitoring data of the container.

AvailableBytes Long 4285091840

The amount of available memory.

Cache Long 9289728

The size of the cache.

Rss Long 9289728

The resident set size, which indicates the amount of physical memory that is actually used.

UsageBytes Long 9289728

The amount of used memory.

WorkingSet Long 9289728

The usage of the working set.

Name String u1

The name of the container.

Disk Array of DiskStats

The monitoring data of disks.

Device String /dev/vda

The name of the disk.

ReadBytes Long 210714112

The amount of data that was read from the disk. Unit: bytes.

ReadIO Long 123

This parameter is unavailable.

WriteBytes Long 1375109120

The amount of data that was written to the disk. Unit: bytes.

WriteIO Long 123

This parameter is unavailable.

Filesystem Array of FsStats

The monitoring data of file system partitions.

Available Long 35319836672

The size of the available space.

Capacity Long 41610981376

The total size of space.

Category String System

The type of the partition. Valid values:

  • System
  • Volume
  • Other
FsName String /dev/root

The name of the partition.

Usage Long 4368744448

The size of used space.

Memory Struct

The monitoring data of the memory.

AvailableBytes Long 4285091840

The amount of available memory.

Cache Long 9289728

The size of the cache.

Rss Long 9289728

The resident set size, which indicates the amount of physical memory that is actually used.

UsageBytes Long 9289728

The amount of used memory.

WorkingSet Long 9289728

The usage of the working set.

Network Struct

The monitoring data of the network.

Interfaces Array of Interface

The monitoring data of network interface controllers (NICs).

Name String eth0

The name of the NIC.

RxBytes Long 505001954

The number of bytes received by the NIC.

RxDrops Long 0

The number of packets that the NIC failed to receive.

RxErrors Long 0

The number of bytes that the NIC failed to receive.

RxPackets Long 4800583

The number of packets received by the NIC.

TxBytes Long 1381805699

The number of bytes sent by the NIC.

TxDrops Long 0

The number of packets that the NIC failed to send.

TxErrors Long 0

The number of bytes that the NIC failed to send.

TxPackets Long 5158427

The number of packets sent by the NIC.

Timestamp String 2021-08-25T16:22:00.000+08:00

The time when the monitoring data entry was collected. The time is indicated in RFC 3339 format.

RequestId String D81A4A13-6DCC-4579-AC62-90A6C3EC7BBC

The ID of the request.

Examples

Sample requests

https://eci.aliyuncs.com/?Action=DescribeContainerGroupMetric
&ContainerGroupId=eci-bp17da5olmkuagfr****
&RegionId=cn-hangzhou
&<Common request parameters>|

Sample success responses

XML format

<DescribeContainerGroupMetricResponse>
      <RequestId>96F7805E-16E6-55B1-817F-EA6CF365E7AE</RequestId>
      <ContainerGroupId>eci-2zea33h8fdgiw23jfp3f</ContainerGroupId>
      <Records>
            <Memory>
                  <UsageBytes>11153408</UsageBytes>
                  <Rss>1593344</Rss>
                  <AvailableBytes>4289445888</AvailableBytes>
                  <WorkingSet>5521408</WorkingSet>
                  <Cache>7028736</Cache>
            </Memory>
            <Network>
                  <Interfaces>
                        <RxPackets>0</RxPackets>
                        <TxDrops>0</TxDrops>
                        <RxDrops>0</RxDrops>
                        <RxErrors>0</RxErrors>
                        <TxErrors>0</TxErrors>
                        <TxPackets>0</TxPackets>
                        <RxBytes>505001954</RxBytes>
                        <TxBytes>1381805699</TxBytes>
                        <Name>eth0</Name>
                  </Interfaces>
            </Network>
            <Containers>
                  <Memory>
                        <UsageBytes>9850880</UsageBytes>
                        <Rss>1593344</Rss>
                        <AvailableBytes>0</AvailableBytes>
                        <WorkingSet>4841472</WorkingSet>
                        <Cache>7028736</Cache>
                  </Memory>
                  <CPU>
                        <UsageCoreNanoSeconds>38373298</UsageCoreNanoSeconds>
                        <Load>0</Load>
                        <UsageNanoCores>0</UsageNanoCores>
                        <Limit>0</Limit>
                  </CPU>
                  <Name>nginx</Name>
            </Containers>
            <Containers>
                  <Memory>
                        <UsageBytes>9850880</UsageBytes>
                        <Rss>1593344</Rss>
                        <AvailableBytes>0</AvailableBytes>
                        <WorkingSet>4841472</WorkingSet>
                        <Cache>7028736</Cache>
                  </Memory>
                  <CPU>
                        <UsageCoreNanoSeconds>38373298</UsageCoreNanoSeconds>
                        <Load>0</Load>
                        <UsageNanoCores>0</UsageNanoCores>
                        <Limit>0</Limit>
                  </CPU>
                  <Name>nginx</Name>
            </Containers>
            <CPU>
                  <UsageCoreNanoSeconds>70769883</UsageCoreNanoSeconds>
                  <Load>0</Load>
                  <UsageNanoCores>0</UsageNanoCores>
                  <Limit>2000</Limit>
            </CPU>
            <Filesystem>
                  <Usage>612556800</Usage>
                  <Category>System</Category>
                  <FsName>/dev/disk/by-uuid/39d6ac87-caa5-4bdd-b31e-660301e51bab</FsName>
                  <Capacity>52576092160</Capacity>
                  <Available>49262403584</Available>
            </Filesystem>
            <Filesystem>
                  <Usage>5022646272</Usage>
                  <Category>Other</Category>
                  <FsName>/dev/root</FsName>
                  <Capacity>41610981376</Capacity>
                  <Available>34665934848</Available>
            </Filesystem>
            <Filesystem>
                  <Usage>0</Usage>
                  <Category>Other</Category>
                  <FsName>/dev/shm</FsName>
                  <Capacity>1991725056</Capacity>
                  <Available>1991725056</Available>
            </Filesystem>
            <Filesystem>
                  <Usage>37249024</Usage>
                  <Category>Other</Category>
                  <FsName>/dev/vda2</FsName>
                  <Capacity>511647744</Capacity>
                  <Available>436822016</Available>
            </Filesystem>
            <Timestamp>2021-08-25T16:22:00.000+08:00</Timestamp>
            <Disk>
                  <Device>/dev/vda</Device>
                  <ReadBytes>177200640</ReadBytes>
                  <WriteBytes>8542216192</WriteBytes>
            </Disk>
      </Records>
</DescribeContainerGroupMetricResponse>

JSON format

{
    "RequestId": "96F7805E-16E6-55B1-817F-EA6CF365E7AE",
    "ContainerGroupId": "eci-2zea33h8fdgiw23jfp3f",
    "Records": [
        {
            "Memory": {
                "UsageBytes": 11153408,
                "Rss": 1593344,
                "AvailableBytes": 4289445888,
                "WorkingSet": 5521408,
                "Cache": 7028736
            },
            "Network": {
                "Interfaces": [
                    {
                        "RxPackets": 0,
                        "TxDrops": 0,
                        "RxDrops": 0,
                        "RxErrors": 0,
                        "TxErrors": 0,
                        "TxPackets": 0,
                        "RxBytes": 505001954,
                        "TxBytes": 1381805699,
                        "Name": "eth0"
                    }
                ]
            },
            "Containers": [
                {
                    "Memory": {
                        "UsageBytes": 9850880,
                        "Rss": 1593344,
                        "AvailableBytes": 0,
                        "WorkingSet": 4841472,
                        "Cache": 7028736
                    },
                    "CPU": {
                        "UsageCoreNanoSeconds": 38373298,
                        "Load": 0,
                        "UsageNanoCores": 0,
                        "Limit": 0
                    },
                    "Name": "nginx"
                },
                {
                    "Memory": {
                        "UsageBytes": 9850880,
                        "Rss": 1593344,
                        "AvailableBytes": 0,
                        "WorkingSet": 4841472,
                        "Cache": 7028736
                    },
                    "CPU": {
                        "UsageCoreNanoSeconds": 38373298,
                        "Load": 0,
                        "UsageNanoCores": 0,
                        "Limit": 0
                    },
                    "Name": "nginx"
                }
            ],
            "CPU": {
                "UsageCoreNanoSeconds": 70769883,
                "Load": 0,
                "UsageNanoCores": 0,
                "Limit": 2000
            },
            "Filesystem": [
                {
                    "Usage": 612556800,
                    "Category": "System",
                    "FsName": "/dev/disk/by-uuid/39d6ac87-caa5-4bdd-b31e-660301e51bab",
                    "Capacity": 52576092160,
                    "Available": 49262403584
                },
                {
                    "Usage": 5022646272,
                    "Category": "Other",
                    "FsName": "/dev/root",
                    "Capacity": 41610981376,
                    "Available": 34665934848
                },
                {
                    "Usage": 0,
                    "Category": "Other",
                    "FsName": "/dev/shm",
                    "Capacity": 1991725056,
                    "Available": 1991725056
                },
                {
                    "Usage": 37249024,
                    "Category": "Other",
                    "FsName": "/dev/vda2",
                    "Capacity": 511647744,
                    "Available": 436822016
                }
            ],
            "Timestamp": "2021-08-25T16:22:00.000+08:00",
            "Disk": [
                {
                    "Device": "/dev/vda",
                    "ReadBytes": 177200640,
                    "WriteBytes": 8542216192
                }
            ]
        }
    ]
}

Error codes

For a list of error codes, visit the API Error Center.