From c37d2faa726b3d065995fa874d027ed5850bcbc0 Mon Sep 17 00:00:00 2001 From: Hazel Atkinson Date: Sat, 5 Apr 2025 17:21:38 +0100 Subject: dont chat shit about cadvisor --- README.md | 6 +++++- output.txt | 6 ------ 2 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 output.txt diff --git a/README.md b/README.md index a2e8f39..5b38772 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ The main reason for this to exist is my personal difficulties deploying cAdvisor cAdvisor is rather RAM-heavy, and it really does not need to be so. It also requires a plethora of different mounts to get working inside of a container, including /sys, or even the entire / filesystem, and in some cases must be ran as a privileged user! -Even with this, it can often just completely fail to collect CPU usage data depending on your distro. + +This is mostly because cAdvisor actually collects statistics on *cgroups*, not specifically on docker containers. +It does have specific integration for containerd, docker, and podman, but it will also happily report statistics about +systemd services to Prometheus too! +If you only want to support Docker, you need not bother with cgroups, as the Docker Engine can report all you need. I have previously used Beszel for my monitoring, and it's agent runs as an unprivileged user, needs access to only the docker socket, collects all data out of the box, and has a lightweight footprint. diff --git a/output.txt b/output.txt deleted file mode 100644 index 2645cb8..0000000 --- a/output.txt +++ /dev/null @@ -1,6 +0,0 @@ -Connected to Docker Daemon version Some("28.0.4") -Some(["/peaceful_dijkstra"]) -Stats { read: "2025-04-05T11:28:22.692535502Z", preread: "0001-01-01T00:00:00Z", num_procs: 0, pids_stats: PidsStats { current: Some(14), limit: Some(16617) }, network: None, networks: Some({"eth0": NetworkStats { rx_dropped: 0, rx_bytes: 73311, rx_errors: 0, tx_packets: 3, tx_dropped: 0, rx_packets: 846, tx_errors: 0, tx_bytes: 126 }}), memory_stats: MemoryStats { stats: Some(V2(MemoryStatsStatsV2 { anon: 22941696, file: 65019904, kernel_stack: 229376, slab: 354288, sock: 0, shmem: 0, file_mapped: 20066304, file_dirty: 0, file_writeback: 0, anon_thp: 20971520, inactive_anon: 921600, active_anon: 22020096, inactive_file: 67497984, active_file: 1331200, unevictable: 0, slab_reclaimable: 118400, slab_unreclaimable: 235888, pgfault: 6977, pgmajfault: 28, workingset_refault: 0, workingset_activate: 0, workingset_nodereclaim: 0, pgrefill: 73, pgscan: 7176, pgsteal: 6921, pgactivate: 82, pgdeactivate: 0, pglazyfree: 0, pglazyfreed: 0, thp_fault_alloc: 1, thp_collapse_alloc: 35 })), max_usage: None, usage: Some(92590080), failcnt: None, limit: Some(14602190848), commit: None, commit_peak: None, commitbytes: None, commitpeakbytes: None, privateworkingset: None }, blkio_stats: BlkioStats { io_service_bytes_recursive: Some([BlkioStatsEntry { major: 259, minor: 0, op: "read", value: 93347840 }, BlkioStatsEntry { major: 259, minor: 0, op: "write", value: 4096 }]), io_serviced_recursive: None, io_queue_recursive: None, io_service_time_recursive: None, io_wait_time_recursive: None, io_merged_recursive: None, io_time_recursive: None, sectors_recursive: None }, cpu_stats: CPUStats { cpu_usage: CPUUsage { percpu_usage: None, usage_in_usermode: 293061000, total_usage: 430277000, usage_in_kernelmode: 137215000 }, system_cpu_usage: Some(105448320000000), online_cpus: Some(8), throttling_data: ThrottlingData { periods: 0, throttled_periods: 0, throttled_time: 0 } }, precpu_stats: CPUStats { cpu_usage: CPUUsage { percpu_usage: None, usage_in_usermode: 0, total_usage: 0, usage_in_kernelmode: 0 }, system_cpu_usage: None, online_cpus: None, throttling_data: ThrottlingData { periods: 0, throttled_periods: 0, throttled_time: 0 } }, storage_stats: StorageStats { read_count_normalized: None, read_size_bytes: None, write_count_normalized: None, write_size_bytes: None }, name: "/peaceful_dijkstra", id: "3379e4311956bf383ee055667820f5c9c4790f274c4cd2608f8e4af2eb5e36c7" } -Stats { read: "2025-04-05T11:28:23.695024439Z", preread: "2025-04-05T11:28:22.692535502Z", num_procs: 0, pids_stats: PidsStats { current: Some(14), limit: Some(16617) }, network: None, networks: Some({"eth0": NetworkStats { rx_dropped: 0, rx_bytes: 73390, rx_errors: 0, tx_packets: 3, tx_dropped: 0, rx_packets: 847, tx_errors: 0, tx_bytes: 126 }}), memory_stats: MemoryStats { stats: Some(V2(MemoryStatsStatsV2 { anon: 22941696, file: 65019904, kernel_stack: 229376, slab: 354288, sock: 0, shmem: 0, file_mapped: 20066304, file_dirty: 0, file_writeback: 0, anon_thp: 20971520, inactive_anon: 921600, active_anon: 22020096, inactive_file: 67497984, active_file: 1331200, unevictable: 0, slab_reclaimable: 118400, slab_unreclaimable: 235888, pgfault: 6977, pgmajfault: 28, workingset_refault: 0, workingset_activate: 0, workingset_nodereclaim: 0, pgrefill: 73, pgscan: 7176, pgsteal: 6921, pgactivate: 82, pgdeactivate: 0, pglazyfree: 0, pglazyfreed: 0, thp_fault_alloc: 1, thp_collapse_alloc: 35 })), max_usage: None, usage: Some(92590080), failcnt: None, limit: Some(14602190848), commit: None, commit_peak: None, commitbytes: None, commitpeakbytes: None, privateworkingset: None }, blkio_stats: BlkioStats { io_service_bytes_recursive: Some([BlkioStatsEntry { major: 259, minor: 0, op: "read", value: 93347840 }, BlkioStatsEntry { major: 259, minor: 0, op: "write", value: 4096 }]), io_serviced_recursive: None, io_queue_recursive: None, io_service_time_recursive: None, io_wait_time_recursive: None, io_merged_recursive: None, io_time_recursive: None, sectors_recursive: None }, cpu_stats: CPUStats { cpu_usage: CPUUsage { percpu_usage: None, usage_in_usermode: 293061000, total_usage: 430277000, usage_in_kernelmode: 137215000 }, system_cpu_usage: Some(105456300000000), online_cpus: Some(8), throttling_data: ThrottlingData { periods: 0, throttled_periods: 0, throttled_time: 0 } }, precpu_stats: CPUStats { cpu_usage: CPUUsage { percpu_usage: None, usage_in_usermode: 293061000, total_usage: 430277000, usage_in_kernelmode: 137215000 }, system_cpu_usage: Some(105448320000000), online_cpus: Some(8), throttling_data: ThrottlingData { periods: 0, throttled_periods: 0, throttled_time: 0 } }, storage_stats: StorageStats { read_count_normalized: None, read_size_bytes: None, write_count_normalized: None, write_size_bytes: None }, name: "/peaceful_dijkstra", id: "3379e4311956bf383ee055667820f5c9c4790f274c4cd2608f8e4af2eb5e36c7" } -Stats { read: "2025-04-05T11:28:24.698495438Z", preread: "2025-04-05T11:28:23.695024439Z", num_procs: 0, pids_stats: PidsStats { current: Some(14), limit: Some(16617) }, network: None, networks: Some({"eth0": NetworkStats { rx_dropped: 0, rx_bytes: 73390, rx_errors: 0, tx_packets: 3, tx_dropped: 0, rx_packets: 847, tx_errors: 0, tx_bytes: 126 }}), memory_stats: MemoryStats { stats: Some(V2(MemoryStatsStatsV2 { anon: 22941696, file: 65019904, kernel_stack: 229376, slab: 354288, sock: 0, shmem: 0, file_mapped: 20066304, file_dirty: 0, file_writeback: 0, anon_thp: 20971520, inactive_anon: 921600, active_anon: 22020096, inactive_file: 67497984, active_file: 1331200, unevictable: 0, slab_reclaimable: 118400, slab_unreclaimable: 235888, pgfault: 6977, pgmajfault: 28, workingset_refault: 0, workingset_activate: 0, workingset_nodereclaim: 0, pgrefill: 73, pgscan: 7176, pgsteal: 6921, pgactivate: 82, pgdeactivate: 0, pglazyfree: 0, pglazyfreed: 0, thp_fault_alloc: 1, thp_collapse_alloc: 35 })), max_usage: None, usage: Some(92590080), failcnt: None, limit: Some(14602190848), commit: None, commit_peak: None, commitbytes: None, commitpeakbytes: None, privateworkingset: None }, blkio_stats: BlkioStats { io_service_bytes_recursive: Some([BlkioStatsEntry { major: 259, minor: 0, op: "read", value: 93347840 }, BlkioStatsEntry { major: 259, minor: 0, op: "write", value: 4096 }]), io_serviced_recursive: None, io_queue_recursive: None, io_service_time_recursive: None, io_wait_time_recursive: None, io_merged_recursive: None, io_time_recursive: None, sectors_recursive: None }, cpu_stats: CPUStats { cpu_usage: CPUUsage { percpu_usage: None, usage_in_usermode: 293061000, total_usage: 430277000, usage_in_kernelmode: 137215000 }, system_cpu_usage: Some(105464360000000), online_cpus: Some(8), throttling_data: ThrottlingData { periods: 0, throttled_periods: 0, throttled_time: 0 } }, precpu_stats: CPUStats { cpu_usage: CPUUsage { percpu_usage: None, usage_in_usermode: 293061000, total_usage: 430277000, usage_in_kernelmode: 137215000 }, system_cpu_usage: Some(105456300000000), online_cpus: Some(8), throttling_data: ThrottlingData { periods: 0, throttled_periods: 0, throttled_time: 0 } }, storage_stats: StorageStats { read_count_normalized: None, read_size_bytes: None, write_count_normalized: None, write_size_bytes: None }, name: "/peaceful_dijkstra", id: "3379e4311956bf383ee055667820f5c9c4790f274c4cd2608f8e4af2eb5e36c7" } -Stats { read: "2025-04-05T11:28:25.700769535Z", preread: "2025-04-05T11:28:24.698495438Z", num_procs: 0, pids_stats: PidsStats { current: Some(14), limit: Some(16617) }, network: None, networks: Some({"eth0": NetworkStats { rx_dropped: 0, rx_bytes: 73469, rx_errors: 0, tx_packets: 3, tx_dropped: 0, rx_packets: 848, tx_errors: 0, tx_bytes: 126 }}), memory_stats: MemoryStats { stats: Some(V2(MemoryStatsStatsV2 { anon: 22941696, file: 65019904, kernel_stack: 229376, slab: 354288, sock: 0, shmem: 0, file_mapped: 20066304, file_dirty: 0, file_writeback: 0, anon_thp: 20971520, inactive_anon: 921600, active_anon: 22020096, inactive_file: 67497984, active_file: 1331200, unevictable: 0, slab_reclaimable: 118400, slab_unreclaimable: 235888, pgfault: 6977, pgmajfault: 28, workingset_refault: 0, workingset_activate: 0, workingset_nodereclaim: 0, pgrefill: 73, pgscan: 7176, pgsteal: 6921, pgactivate: 82, pgdeactivate: 0, pglazyfree: 0, pglazyfreed: 0, thp_fault_alloc: 1, thp_collapse_alloc: 35 })), max_usage: None, usage: Some(92590080), failcnt: None, limit: Some(14602190848), commit: None, commit_peak: None, commitbytes: None, commitpeakbytes: None, privateworkingset: None }, blkio_stats: BlkioStats { io_service_bytes_recursive: Some([BlkioStatsEntry { major: 259, minor: 0, op: "read", value: 93347840 }, BlkioStatsEntry { major: 259, minor: 0, op: "write", value: 4096 }]), io_serviced_recursive: None, io_queue_recursive: None, io_service_time_recursive: None, io_wait_time_recursive: None, io_merged_recursive: None, io_time_recursive: None, sectors_recursive: None }, cpu_stats: CPUStats { cpu_usage: CPUUsage { percpu_usage: None, usage_in_usermode: 293061000, total_usage: 430277000, usage_in_kernelmode: 137215000 }, system_cpu_usage: Some(105472350000000), online_cpus: Some(8), throttling_data: ThrottlingData { periods: 0, throttled_periods: 0, throttled_time: 0 } }, precpu_stats: CPUStats { cpu_usage: CPUUsage { percpu_usage: None, usage_in_usermode: 293061000, total_usage: 430277000, usage_in_kernelmode: 137215000 }, system_cpu_usage: Some(105464360000000), online_cpus: Some(8), throttling_data: ThrottlingData { periods: 0, throttled_periods: 0, throttled_time: 0 } }, storage_stats: StorageStats { read_count_normalized: None, read_size_bytes: None, write_count_normalized: None, write_size_bytes: None }, name: "/peaceful_dijkstra", id: "3379e4311956bf383ee055667820f5c9c4790f274c4cd2608f8e4af2eb5e36c7" } -- cgit