diff --git a/modules/nixos/tools/telegraf/default.nix b/modules/nixos/tools/telegraf/default.nix index 7391d63..2cc55d3 100644 --- a/modules/nixos/tools/telegraf/default.nix +++ b/modules/nixos/tools/telegraf/default.nix @@ -182,20 +182,81 @@ let }; }) (lib.mkIf (hasCollector "docker") { - inputs.docker = { - endpoint = "unix:///var/run/docker.sock"; - timeout = "5s"; - perdevice_include = [ ]; - total_include = [ ]; - fielddrop = [ - "memory_total" - "n_cpus" - "n_goroutines" - "n_listener_events" - "n_used_file_descriptors" - "server_version" - ]; - }; + inputs.docker = [ + { + endpoint = "unix:///var/run/docker.sock"; + timeout = "5s"; + perdevice_include = [ ]; + total_include = [ ]; + docker_label_exclude = [ "*" ]; + tagexclude = [ + "container_image" + "container_status" + "container_version" + "engine_host" + "server_version" + ]; + namedrop = [ + "docker_container_health" + "docker_container_mem" + "docker_container_status" + ]; + fielddrop = [ + "memory_total" + "n_cpus" + "n_goroutines" + "n_listener_events" + "n_used_file_descriptors" + "server_version" + ]; + } + { + endpoint = "unix:///var/run/docker.sock"; + timeout = "5s"; + perdevice_include = [ ]; + total_include = [ ]; + docker_label_exclude = [ "*" ]; + tagexclude = [ + "container_image" + "container_status" + "container_version" + "engine_host" + "server_version" + ]; + namepass = [ "docker_container_mem" ]; + fielddrop = [ + "active_anon" + "active_file" + "container_id" + "hierarchical_memory_limit" + "inactive_anon" + "inactive_file" + "mapped_file" + "max_usage" + "pgfault" + "pgmajfault" + "pgpgin" + "pgpgout" + "rss_huge" + "total_active_anon" + "total_active_file" + "total_cache" + "total_inactive_anon" + "total_inactive_file" + "total_mapped_file" + "total_pgfault" + "total_pgmajfault" + "total_pgpgin" + "total_pgpgout" + "total_rss" + "total_rss_huge" + "total_unevictable" + "total_writeback" + "unevictable" + "writeback" + ]; + } + ]; }) (lib.mkIf (hasCollector "ping") { inputs.ping = { @@ -210,6 +271,13 @@ let ]; }; }) + (lib.mkIf (hasCollector "internet_speed") { + inputs.internet_speed = { + interval = "30m"; + cache = true; + memory_saving_mode = true; + }; + }) (lib.mkIf (hasCollector "gpu") { inputs.exec = [{ commands = [ amdgpuMetricsScript ]; diff --git a/modules/shared/syscfg/monitoring.nix b/modules/shared/syscfg/monitoring.nix index 4c6b30d..759e243 100644 --- a/modules/shared/syscfg/monitoring.nix +++ b/modules/shared/syscfg/monitoring.nix @@ -23,6 +23,7 @@ with lib; { "smart" "docker" "ping" + "internet_speed" "gpu" ]); default = [ ]; diff --git a/systems/sandbox/cfg.nix b/systems/sandbox/cfg.nix index d7a9667..a3fcdca 100644 --- a/systems/sandbox/cfg.nix +++ b/systems/sandbox/cfg.nix @@ -103,6 +103,7 @@ #"processes" "docker" "ping" + "internet_speed" ]; outputs = [ "http://127.0.0.1:8181" ]; };