52 lines
1.2 KiB
Nix
52 lines
1.2 KiB
Nix
{ ... }:
|
|
let
|
|
influxURL = "http://panoptes.john-stream.com:8086";
|
|
organization = "homelab";
|
|
bucket = "docker";
|
|
envFile = ./telegraf.env;
|
|
in
|
|
{
|
|
systemd.services.telegraf.serviceConfig = {
|
|
SupplementaryGroups = [ "docker" ];
|
|
};
|
|
|
|
services.telegraf = {
|
|
enable = true;
|
|
environmentFiles = [ "${envFile}" ];
|
|
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 = "";
|
|
hostname = "";
|
|
omit_hostname = false;
|
|
};
|
|
inputs = {
|
|
docker = {
|
|
endpoint = "unix:///var/run/docker.sock";
|
|
gather_services = false;
|
|
source_tag = false;
|
|
container_name_include = [];
|
|
timeout = "5s";
|
|
perdevice_include = ["cpu" "blkio" "network"];
|
|
total = false;
|
|
docker_label_include = [];
|
|
};
|
|
};
|
|
outputs = {
|
|
influxdb_v2 = {
|
|
urls = ["${influxURL}"];
|
|
token = "$INFLUX_WRITE_TOKEN";
|
|
organization = "${organization}";
|
|
bucket = "${bucket}";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|