2024-10-28 00:17:05 +01:00
|
|
|
{config, ...}: {
|
2024-03-28 11:37:35 +01:00
|
|
|
sops.secrets."grafana-telegraf-key".mode = "0440";
|
|
|
|
sops.secrets."grafana-telegraf-key".owner = config.users.users.telegraf.name;
|
2024-03-28 11:12:02 +01:00
|
|
|
services.telegraf = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = {
|
|
|
|
agent = {
|
|
|
|
interval = "10s";
|
|
|
|
round_interval = true;
|
|
|
|
metric_batch_size = 1000;
|
|
|
|
metric_buffer_limit = 10000;
|
|
|
|
collection_jitter = "0s";
|
|
|
|
flush_interval = "10s";
|
|
|
|
flush_jitter = "0s";
|
|
|
|
precision = "";
|
|
|
|
debug = false;
|
|
|
|
quiet = false;
|
|
|
|
logfile = "";
|
|
|
|
hostname = "queen";
|
|
|
|
omit_hostname = false;
|
|
|
|
};
|
|
|
|
inputs = {
|
|
|
|
cpu = {
|
|
|
|
percpu = true;
|
|
|
|
totalcpu = true;
|
|
|
|
collect_cpu_time = false;
|
|
|
|
report_active = false;
|
|
|
|
core_tags = false;
|
|
|
|
};
|
|
|
|
disk = {
|
|
|
|
ignore_fs = ["tmpfs" "devtmpfs" "devfs" "overlay" "aufs" "squashfs"];
|
|
|
|
};
|
|
|
|
diskio = {};
|
|
|
|
kernel = {};
|
|
|
|
mem = {};
|
|
|
|
system = {};
|
|
|
|
};
|
2024-03-28 11:19:01 +01:00
|
|
|
outputs = {
|
2024-03-28 11:45:20 +01:00
|
|
|
websocket = {
|
2024-03-28 11:53:28 +01:00
|
|
|
url = "ws://localhost:${toString config.services.prometheus.port}/api/live/push/telegraf";
|
2024-03-28 11:37:35 +01:00
|
|
|
data_format = "influx";
|
2024-03-28 11:52:19 +01:00
|
|
|
headers = {
|
|
|
|
Authorisation = "Bearer glsa_lqpcKV34Pp0d7eIhKN79E2HTwzWWwN4m_fe64e398";
|
|
|
|
};
|
2024-03-28 11:19:01 +01:00
|
|
|
};
|
|
|
|
};
|
2024-03-28 11:12:02 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|