Merge pull request #104206 from Mic92/telegraf

This commit is contained in:
Jörg Thalheim 2020-11-18 21:55:07 +01:00 committed by GitHub
commit 624285d029
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 13 deletions

View file

@ -21,7 +21,7 @@ in {
};
environmentFiles = mkOption {
type = types.nullOr (types.listOf types.path);
type = types.listOf types.path;
default = [];
example = "/run/keys/telegraf.env";
description = ''
@ -38,17 +38,13 @@ in {
description = "Extra configuration options for telegraf";
type = settingsFormat.type;
example = {
outputs = {
influxdb = {
urls = ["http://localhost:8086"];
database = "telegraf";
};
outputs.influxdb = {
urls = ["http://localhost:8086"];
database = "telegraf";
};
inputs = {
statsd = {
service_address = ":8125";
delete_timings = true;
};
inputs.statsd = {
service_address = ":8125";
delete_timings = true;
};
};
};

View file

@ -6,9 +6,9 @@ import ./make-test-python.nix ({ pkgs, ...} : {
machine = { ... }: {
services.telegraf.enable = true;
services.telegraf.environmentFiles = [pkgs.writeText "secrets" ''
services.telegraf.environmentFiles = [(pkgs.writeText "secrets" ''
SECRET=example
''];
'')];
services.telegraf.extraConfig = {
agent.interval = "1s";
agent.flush_interval = "1s";