All Products
Search
Document Center

DescribeContainerGroupMetric

Last Updated: Aug 15, 2019

DescribeContainerGroupMetric

You can call this operation to query the monitoring data of a specific metric in Elastic Container Instance (ECI).

Request parameters

Parameter Type Required Example Description
Action String Yes DescribeContainerGroupMetric The operation that you want to perform. Set this parameter to DescribeContainerGroupMetric.
RegionId String Yes cn-hangzhou The ID of the region where the container group resides.
ContainerGroupId String Yes eci-djfioduf35gitgyif The ID of the container group.
StartTime The start time of the monitoring data to be queried. Specify the time in the RFC 3339 format. No For example, to indicate 9:00 a.m. March 12, 2019 (UTC+8), you can use either of the following notations:
2019-03-12T09:00:00.000+08:00 or 2019-03-12T01:00:00.000Z
Default value: 5 minutes before the EndTime time. Valid value: a time within the last 30 days.
EndTime The end time of the monitoring data to be queried. Specify the time in the RFC 3339 format. No The same as StartTime. Default value: the current time.
Period int No 15 The sampling interval of the metric, measured in seconds. Valid values: 15, 30, 60, and 600. Default value: 60. If neither StartTime nor EndTime is specified, the system returns the data of the last 5 minutes, with a sampling interval of 15 seconds. In this case, the specified Period parameter is ignored.

Note:

1. You can query a maximum of 50 records. If more than 50 records match your query, an error occurs.

2. With each API call, you can either query data within the last 5 minutes or data of a time period earlier than the last 5 minutes. If the specified duration spans across the last 5 minute mark, the system only returns the data of the last 5 minutes.

3. You can only query monitoring data for ECI container groups created after April 3, 2019, 15:00 (UTC+8).

Response parameters

Parameter Type Description
ContainerGroupId String The ID of the container group.
RequestId String The ID of the request.
Records Record[] The details of the monitoring data.

Record

Parameter Type Description
Timestamp String The timestamp of each record in the monitoring data.
Cpu CpuStats The statistics of CPUs.
Memory MemoryStats The statistics of memory.
Network Network The statistics of the network.
Containers ContainerStats[] The statistics of containers.

Container

Parameter Type Description
Name String The name of the container.
Cpu CpuStats The statistics of CPUs.
Memory MemoryStats The statistics of memory.

CpuStats

Parameter Type Description
UsageNanoCores uint64 The usage of the CPU in the sampling window.
UsageCoreNanoSeconds uint64 The cumulative utilization of the CPU.

MemoryStats

Parameter Type Description
AvailableBytes uint64 Available memory, measured in bytes.
UsageBytes uint64 The memory usage, measured in bytes.
Rss uint64 The resident memory, measured in bytes.
WorkingSet uint64 The size of the working set, measured in bytes.
Cache uint64 The cache, measured in bytes.

NetworkStats

Parameter Type Description
Interfaces Interface[]

Interface

Parameter Type Description
Name String The name of the network interface card (NIC).
RxBytes uint64 The received bytes.
TxBytes uint64 The sent bytes.
RxErrors uint64 The number of errors that occurred while receiving data.
TxErrors uint64 The number of errors that occurred while sending data.

Sample responses

  1. {
  2. "ContainerGroupId": "eci-bp1dqpye03ke5s6p2ijc",
  3. "Records":{
  4. {
  5. "Containers": [
  6. {
  7. "Name": "redis-liu",
  8. "Memory": {
  9. "AvailableBytes": 2145820672,
  10. "UsageBytes": 1662976
  11. },
  12. "CPU": {
  13. "Load": 0,
  14. "UsageNanoCores": 0,
  15. "UsageCoreNanoSeconds": 40876694,
  16. "Limit": 1024
  17. }
  18. },
  19. {
  20. "Name": "nginx-liu",
  21. "Memory": {
  22. "AvailableBytes": 2145325056,
  23. "UsageBytes": 2166784
  24. },
  25. "CPU": {
  26. "Load": 0,
  27. "UsageNanoCores": 0,
  28. "UsageCoreNanoSeconds": 43183279,
  29. "Limit": 1024
  30. }
  31. }
  32. ],
  33. "Memory": {
  34. "AvailableBytes": 4285091840,
  35. "UsageBytes": 9289728
  36. },
  37. "Network": {
  38. "Interfaces": [
  39. {
  40. "Name": "eth0",
  41. "TxBytes": 426,
  42. "RxErrors": 0,
  43. "TxErrors": 0,
  44. "RxBytes": 0
  45. }
  46. ]
  47. },
  48. "CPU": {
  49. "Load": 0,
  50. "UsageNanoCores": 7735803,
  51. "UsageCoreNanoSeconds": 122380547,
  52. "Limit": 2048
  53. },
  54. "Timestamp": "2019-03-29T10:38:50.734+08:00"
  55. },
  56. {
  57. "Containers": [
  58. {
  59. "Name": "nginx-liu",
  60. "Memory": {
  61. "AvailableBytes": 2145488896,
  62. "UsageBytes": 2021376
  63. },
  64. "CPU": {
  65. "Load": 0,
  66. "UsageNanoCores": 0,
  67. "UsageCoreNanoSeconds": 43183279,
  68. "Limit": 1024
  69. }
  70. },
  71. {
  72. "Name": "redis-liu",
  73. "Memory": {
  74. "AvailableBytes": 2145910784,
  75. "UsageBytes": 1572864
  76. },
  77. "CPU": {
  78. "Load": 0,
  79. "UsageNanoCores": 287628,
  80. "UsageCoreNanoSeconds": 44680652,
  81. "Limit": 1024
  82. }
  83. }
  84. ],
  85. "Memory": {},
  86. "Network": {
  87. "Interfaces": [
  88. {
  89. "Name": "eth0",
  90. "TxBytes": 143562,
  91. "RxErrors": 0,
  92. "TxErrors": 0,
  93. "RxBytes": 20410229
  94. }
  95. ]
  96. },
  97. "CPU": {},
  98. "Timestamp": "2019-03-29T10:39:05.734+08:00"
  99. }
  100. ],
  101. "RequestId": "D81A4A13-6DCC-4579-AC62-90A6C3EC7BBC"
  102. }

`