From 0b92d81d9f5656895ce9b10d7f8276d374c18a27 Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Thu, 5 Feb 2026 09:27:32 +0100 Subject: [PATCH] WIP Telegraf: Update config for latest version --- templates/telegraf-docker.conf | 3 +-- templates/telegraf.conf.j2 | 18 +++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/templates/telegraf-docker.conf b/templates/telegraf-docker.conf index a794b44..f1edd49 100644 --- a/templates/telegraf-docker.conf +++ b/templates/telegraf-docker.conf @@ -1,7 +1,6 @@ [[inputs.docker]] endpoint = "unix:///var/run/docker.sock" - perdevice = false - total = true + perdevice_include = [] total_include = ["cpu", "blkio", "network"] container_name_include = [] container_name_exclude = [] diff --git a/templates/telegraf.conf.j2 b/templates/telegraf.conf.j2 index 7194686..c8f9d4d 100644 --- a/templates/telegraf.conf.j2 +++ b/templates/telegraf.conf.j2 @@ -1,6 +1,7 @@ [agent] interval = "{{ telegraf_interval }}" hostname = "" + skip_processors_after_aggregators = true [[outputs.influxdb]] urls = ["{{ telegraf_server_url }}"] @@ -23,18 +24,18 @@ collect_cpu_time = false ## If true, collect raw CPU time metrics report_active = true ## If true, compute and report the sum of all non-idle CPU states. - fieldpass = ["usage_user", "usage_system", "usage_iowait", "usage_irq", "usage_active"] + fieldinclude = ["usage_user", "usage_system", "usage_iowait", "usage_irq", "usage_active"] # Read metrics about memory usage [[inputs.mem]] - #fieldpass = ["total", "used_percent"] + #fieldinclude = ["total", "used_percent"] # Read metrics about disk usage by mount point [[inputs.disk]] # By default, telegraf gather stats for all mountpoints. mount_points = ["/", "/mnt/volume-nbg1-1", "/zroot", "/zfspool/zfsstore"] ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"] - fieldpass = ["total", "free", "used_percent"] + fieldinclude = ["total", "free", "used_percent"] # Read metrics about disk IO by device [[inputs.diskio]] @@ -43,7 +44,7 @@ devices = ["sd[a-d]", "mmcblk[0-1]", "ada[0-9]", "nvd[0-9]", "ploop*"] ## Uncomment the following line if you need disk serial numbers. # skip_serial_number = false - fieldpass = ["read_bytes", "write_bytes", "io_time", "weighted_io_time", "iops_in_progress"] + fieldinclude = ["read_bytes", "write_bytes", "io_time", "weighted_io_time", "iops_in_progress"] # Read metrics about system load & uptime [[inputs.system]] @@ -51,13 +52,12 @@ # Get TCP connection state and UDP socket counts using lsof [[inputs.netstat]] - fieldpass = ["tcp_established", "tcp_listen", "udp_socket"] + fieldinclude = ["tcp_established", "tcp_listen", "udp_socket"] # Gather metrics about network interface and protocol usage (Linux only) [[inputs.net]] interfaces = ["eth*", "enp0s[0-1]", "venet*"] - ignore_protocol_stats = true - fieldpass = ["bytes_sent", "bytes_recv"] + fieldinclude = ["bytes_sent", "bytes_recv"] {% if telegraf_docker|default(false)|bool %} @@ -88,7 +88,11 @@ # Read metrics of ZFS from arcstats, zfetchstats, vdev_cache_stats, and pools [[inputs.zfs]] ## By default, telegraf gather all zfs stats + {% if ansible_facts['os_family'] is defined and ansible_facts['os_family'] == "FreeBSD" %} kstatMetrics = ["arcstats", "zfetchstats", "vdev_cache_stats"] + {% else %} + kstatMetrics = ["arcstats", "zfetchstats"] + {% endif %} ## By default, don't gather zpool stats poolMetrics = true {% endif %}