# Host / infrastructure monitoring for the edge collector (Pi 3B+).
# OCETS-GUIDE-1.1 §19.2: limit collection to filesystems, interfaces, and
# services that affect telemetry acquisition or forwarding.
#
# These are implementation-namespace metrics (raw kernel/sensor values),
# not canonical OCETS series. Canonical labels (plant, device, role) come
# from [global_tags] in telegraf.conf.

# --- CPU ---
[[inputs.cpu]]
  percpu = false
  totalcpu = true
  report_active = true      # emits usage_active = 100 - usage_idle
  collect_cpu_time = false

# --- RAM ---
[[inputs.mem]]

# --- Disk (only the SD-card filesystems; snaps/tmpfs are noise) ---
[[inputs.disk]]
  mount_points = ["/", "/boot/firmware"]
  ignore_fs = ["tmpfs", "devtmpfs", "overlay", "squashfs"]

# --- Disk I/O (SD wear + saturation) ---
# Without a device filter this also reports every snap loop device.
[[inputs.diskio]]
  devices = ["mmcblk0"]

# --- SoC temperature (thermal throttling in the cabinet) ---
[[inputs.temp]]

# --- System uptime + load ---
[[inputs.system]]

# --- Network (only interfaces that carry telemetry) ---
[[inputs.net]]
  interfaces = ["eth0", "wlan0", "tailscale0"]
  ignore_protocol_stats = true

# --- Telegraf self-monitoring (buffer fill, write errors, gather errors) ---
[[inputs.internal]]
  collect_memstats = false

# --- systemd units that affect the pipeline ---
[[inputs.systemd_units]]
  pattern = "telegraf.service mosquitto.service systemd-timesyncd.service ssh.service"
