From a23db5db08206e77c2861107bfaf600b8ff7f5ce Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Tue, 16 Apr 2019 16:04:33 +0200 Subject: nixos/prometheus: add new ec2_sd_config options for prometheus2 --- .../services/monitoring/prometheus/default.nix | 38 ++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'nixos') diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix index 41519fe548fe..525b0b18cecf 100644 --- a/nixos/modules/services/monitoring/prometheus/default.nix +++ b/nixos/modules/services/monitoring/prometheus/default.nix @@ -322,12 +322,19 @@ let The AWS Region. ''; }; + endpoint = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + Custom endpoint to be used. + ''; + }; access_key = mkOption { type = types.nullOr types.str; default = null; description = '' The AWS API key id. If blank, the environment variable - `AWS_ACCESS_KEY_ID` is used. + AWS_ACCESS_KEY_ID is used. ''; }; secret_key = mkOption { @@ -335,7 +342,7 @@ let default = null; description = '' The AWS API key secret. If blank, the environment variable - `AWS_SECRET_ACCESS_KEY` is used. + AWS_SECRET_ACCESS_KEY is used. ''; }; profile = mkOption { @@ -368,6 +375,32 @@ let rule. ''; }; + filters = mkOption { + type = types.nullOr (types.listOf promTypes.filter); + default = null; + description = '' + Filters can be used optionally to filter the instance list by other criteria. + ''; + }; + }; + }; + + promTypes.filter = types.submodule { + options = { + name = mkOption { + type = types.str; + description = '' + See this list + for the available filters. + ''; + }; + value = mkOption { + type = types.listOf types.str; + default = []; + description = '' + Value of the filter. + ''; + }; }; }; @@ -545,7 +578,6 @@ let }; }; - in { options = { services.prometheus = { -- cgit 1.4.1