This topic explains how to monitor Docker standalone containers to effectively manage and maintain containerized applications.
Prerequisites
-
Managed Service for Prometheus is activated. Instance billing.
-
An ECS instance is created. Create and manage an ECS instance by using the ECS console (express version).
-
Resource Center is activated. Activate Resource Center.
Step 1: Integrate Docker container monitoring
Log on to the Managed Service for Prometheus console. In the left-side navigation pane, click Integration Center.
-
Click the Docker Container card and follow the on-screen instructions. The following table describes the key parameters.
Parameter
Description
cAdvisor installation mode
cAdvisor (Container Advisor) is an open-source container monitoring tool from Google. It collects resource usage information for containers, such as CPU, memory, network, and disk utilization.
-
Automatic installation: Automatically discovers ECS instances based on your specified filter policy and installs the cAdvisor service on them.
-
Manual installation: You must manually install the cAdvisor service on the ECS instance and open the required port for access within the VPC before you can set up monitoring.
NoteYou must configure the instance's security group to allow inbound traffic on the specified port from the VPC's CIDR block.
Host service discovery mode
Specifies how to discover the ECS instances to monitor.
Taint label selection
ECS taint label: Excludes ECS instances with the specified taints. This is a reverse selection method.
Unconditional (select all Linux instances in the current VPC)
-
Tag selection
ECS instance tag: Selects instances by their ECS instance tags.
CIDR block selection
ECS CIDR block: Selects instances whose IP addresses fall within the specified CIDR block. If you enter the CIDR block of a VPC, all ECS instances within that VPC are selected.
Instance ID
ECS instance ID: Separate multiple instance IDs with a comma (,).
cAdvisor service port
Default: 8080.
Metric scrape interval (seconds)
Default: 15.
Automatic security group configuration
When enabled, this feature automatically adds a security group rule if the connectivity check fails.
Custom ECS tag injection
Specify the keys of the ECS tags to inject. The corresponding key-value pairs are then added as labels to Prometheus metrics.
-
Step 2: View monitoring dashboards
Managed Service for Prometheus provides multiple built-in dashboards to show container monitoring details, such as cluster overview, core components, nodes, and Pods. You can view these dashboards on the Container Service for Kubernetes console, the Application Real-Time Monitoring Service (ARMS) console, or the Managed Service for Prometheus console.
Log on to the Managed Service for Prometheus console. In the left-side navigation pane, click Integration Management.
-
On the Integration Management page, click the Query Dashboards tab. In the ECS environment section, select a cluster to open its dashboard.

Step 3: Set up alerts
Log on to the Managed Service for Prometheus console. In the left-side navigation pane, click Integration Management.
-
On the Integration Management page, click the Integrated Environments tab. Select ECS instance, then click the name of the target environment to view its details.
-
The Component Management tab allows you to configure built-in alert notifications for Prometheus. To view the specific alert rules, select Docker Standalone Container Monitoring from the component type list, and then click the Alert Rule tab. You will find three default built-in alert rules: ContainerDown, HighMemoryUsage, and HighCPUUsage, which are in the Running state by default.
-
The built-in alert rules generate alert events but do not send alert notifications. To send alert notifications by email or to other platforms, click Edit to configure notification methods.
The alert configuration page also allows you to customize parameters such as the alert threshold, duration, and alert content. For detailed configuration instructions, see Create a Prometheus alert rule.
In the Alert Notification section, select Normal Mode. From the Quick Notification Policy drop-down list, select Do not specify notification policies. Expand Advanced Settings and set the alert check interval to 1 minute.
Metrics
|
Metric |
Type |
Description |
|
container_blkio_device_usage_total |
COUNTER |
Cumulative byte usage for the block I/O device. |
|
container_cpu_cfs_periods_total |
COUNTER |
Total elapsed enforcement periods. |
|
container_cpu_cfs_throttled_periods_total |
COUNTER |
Total throttled periods. |
|
container_cpu_cfs_throttled_seconds_total |
COUNTER |
Total time, in seconds, the container was throttled. |
|
container_cpu_load_average_10s |
GAUGE |
The container's CPU load average over the last 10 seconds. |
|
container_cpu_schedstat_run_periods_total |
COUNTER |
Total number of times processes in the cgroup ran on the CPU. |
|
container_cpu_schedstat_runqueue_seconds_total |
COUNTER |
Cumulative time in seconds that container processes have spent waiting in a run queue. |
|
container_cpu_schedstat_run_seconds_total |
COUNTER |
Cumulative time in seconds that container processes have been running on the CPU. |
|
container_cpu_system_seconds_total |
COUNTER |
Cumulative system CPU time consumed, in seconds. |
|
container_cpu_usage_seconds_total |
COUNTER |
Cumulative CPU time consumed, in seconds. |
|
container_cpu_user_seconds_total |
COUNTER |
Cumulative user CPU time consumed, in seconds. |
|
container_file_descriptors |
GAUGE |
Number of open file descriptors for the container. |
|
container_fs_inodes_free |
GAUGE |
Number of available inodes on the file system. |
|
container_fs_inodes_total |
GAUGE |
Total inodes on the file system. |
|
container_fs_io_current |
GAUGE |
Number of I/O operations currently in progress. |
|
container_fs_io_time_seconds_total |
COUNTER |
Cumulative time in seconds spent on I/O operations. |
|
container_fs_io_time_weighted_seconds_total |
COUNTER |
Cumulative weighted I/O time in seconds. |
|
container_fs_limit_bytes |
GAUGE |
Maximum bytes the container can use on the file system. |
|
container_fs_read_seconds_total |
COUNTER |
Cumulative time in seconds spent on reads. |
|
container_fs_reads_bytes_total |
COUNTER |
Cumulative bytes read. |
|
container_fs_reads_merged_total |
COUNTER |
Cumulative number of merged reads. |
|
container_fs_reads_total |
COUNTER |
Cumulative number of completed reads. |
|
container_fs_sector_reads_total |
COUNTER |
Cumulative number of completed sector reads. |
|
container_fs_sector_writes_total |
COUNTER |
Cumulative number of completed sector writes. |
|
container_fs_usage_bytes |
GAUGE |
Number of bytes used by the container on the file system. |
|
container_fs_write_seconds_total |
COUNTER |
Cumulative time in seconds spent on writes. |
|
container_fs_writes_bytes_total |
COUNTER |
Cumulative bytes written. |
|
container_fs_writes_merged_total |
COUNTER |
Cumulative number of merged writes. |
|
container_fs_writes_total |
COUNTER |
Cumulative number of completed writes. |
|
container_hugetlb_failcnt |
COUNTER |
Total times that hugepage usage reached its limit. |
|
container_hugetlb_max_usage_bytes |
GAUGE |
Maximum recorded hugepage usage in bytes. |
|
container_hugetlb_usage_bytes |
GAUGE |
Current hugepage usage in bytes. |
|
container_last_seen |
GAUGE |
Timestamp of when the container was last detected. |
|
container_llc_occupancy_bytes |
GAUGE |
The container's LLC cache usage, measured by Resource Director Technology (RDT) Memory Bandwidth Monitoring (MBM). |
|
container_memory_bandwidth_bytes |
GAUGE |
The container's total memory bandwidth usage, measured by Resource Director Technology (RDT) Memory Bandwidth Monitoring (MBM). |
|
container_memory_bandwidth_local_bytes |
GAUGE |
The container's local memory bandwidth usage, measured by Resource Director Technology (RDT) Memory Bandwidth Monitoring (MBM). |
|
container_memory_cache |
GAUGE |
Total page cache size in bytes. |
|
container_memory_failcnt |
COUNTER |
Total times that memory usage reached its limit. |
|
container_memory_failures_total |
COUNTER |
Cumulative number of memory allocation failures |
|
container_memory_mapped_file |
GAUGE |
Size of the memory mapped file in bytes. |
|
container_memory_max_usage_bytes |
GAUGE |
Maximum memory usage in bytes. |
|
container_memory_migrate |
GAUGE |
Memory migration status. |
|
container_memory_numa_pages |
GAUGE |
Number of memory pages used per NUMA (Non-Uniform Memory Access) node. |
|
container_memory_rss |
GAUGE |
The Resident Set Size (RSS) in bytes. |
|
container_memory_swap |
GAUGE |
The container's current swap memory usage in bytes. |
|
container_memory_usage_bytes |
GAUGE |
Current memory usage in bytes. |
|
container_memory_working_set_bytes |
GAUGE |
Current working set size in bytes. |
|
container_network_advance_tcp_stats_total |
GAUGE |
Advanced TCP connection statistics for the container. |
|
container_network_receive_bytes_total |
COUNTER |
Cumulative number of bytes received. |
|
container_network_receive_errors_total |
COUNTER |
Cumulative receive errors. |
|
container_network_receive_packets_dropped_total |
COUNTER |
Cumulative dropped incoming packets. |
|
container_network_receive_packets_total |
COUNTER |
Cumulative packets received. |
|
container_network_tcp6_usage_total |
GAUGE |
The container's TCPv6 connection statistics. |
|
container_network_tcp_usage_total |
GAUGE |
The container's TCP connection statistics. |
|
container_network_transmit_bytes_total |
COUNTER |
Cumulative number of bytes transmitted. |
|
container_network_transmit_errors_total |
COUNTER |
Cumulative transmit errors. |
|
container_network_transmit_packets_dropped_total |
COUNTER |
Cumulative dropped outgoing packets. |
|
container_network_transmit_packets_total |
COUNTER |
Cumulative packets transmitted. |
|
container_network_udp6_usage_total |
GAUGE |
The container's UDPv6 connection statistics. |
|
container_network_udp_usage_total |
GAUGE |
The container's UDP connection statistics. |
|
container_oom_events_total |
COUNTER |
Total out of memory (OOM) events for the container. |
|
container_perf_events_scaling_ratio |
GAUGE |
Scaling ratio for the perf event counter. |
|
container_perf_events_total |
COUNTER |
Scaled count of perf core events. |
|
container_perf_uncore_events_scaling_ratio |
GAUGE |
Scaling ratio for the perf uncore event counter. The |
|
container_perf_uncore_events_total |
COUNTER |
Scaled count of perf uncore events. The |
|
container_processes |
GAUGE |
Number of processes running in the container. |
|
container_referenced_bytes |
GAUGE |
Memory, in bytes, referenced by the container since the last measurement. This value is based on the |
|
container_sockets |
GAUGE |
Number of open sockets for the container. |
|
container_spec_cpu_period |
GAUGE |
The container's CPU period. |
|
container_spec_cpu_quota |
GAUGE |
The container's CPU quota. |
|
container_spec_cpu_shares |
GAUGE |
The container's CPU share. |
|
container_spec_memory_limit_bytes |
GAUGE |
The container's memory limit in bytes. |
|
container_spec_memory_reservation_limit_bytes |
GAUGE |
The container's memory reservation limit in bytes. |
|
container_spec_memory_swap_limit_bytes |
GAUGE |
The container's memory swap limit in bytes. |
|
container_start_time_seconds |
GAUGE |
Start time of the container as a Unix timestamp. |
|
container_tasks_state |
GAUGE |
Number of tasks by state: sleeping, running, stopped, uninterruptible, or I/O-wait. |
|
container_threads |
GAUGE |
Number of threads running in the container. |
|
container_threads_max |
GAUGE |
Maximum threads allowed in the container. |
|
container_ulimits_soft |
GAUGE |
The soft ulimit value for the container's root process. |
|
machine_cpu_cache_capacity_bytes |
GAUGE |
The cache size in bytes assigned to the NUMA node and CPU cores. |
|
machine_cpu_cores |
GAUGE |
Number of logical CPU cores. |
|
machine_cpu_physical_cores |
GAUGE |
Number of physical CPU cores. |
|
machine_cpu_sockets |
GAUGE |
Number of CPU sockets. |
|
machine_dimm_capacity_bytes |
GAUGE |
Total RAM DIMM capacity, labeled by memory module type. |
|
machine_dimm_count |
GAUGE |
Number of RAM DIMMs, labeled by memory module type. |
|
machine_memory_bytes |
GAUGE |
Amount of memory installed on the machine. |
|
machine_swap_bytes |
GAUGE |
Amount of swap memory available on the machine. |
|
machine_node_distance |
GAUGE |
The relative distance from one NUMA node to another. |
|
machine_node_hugepages_count |
GAUGE |
Number of hugepages assigned to the NUMA node. |
|
machine_node_memory_capacity_bytes |
GAUGE |
Memory assigned to the NUMA node, in bytes. |
|
machine_nvm_avg_power_budget_watts |
GAUGE |
Average power budget of the NVM (Non-Volatile Memory) in watts. |
|
machine_nvm_capacity |
GAUGE |
The capacity of the NVM (Non-Volatile Memory). |
|
machine_thread_siblings_count |
GAUGE |
Number of CPU thread siblings. |
References
How to Build an Efficient and Stable Docker Container Monitoring System