summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/prometheus/default.nix
diff options
context:
space:
mode:
authorBas van Dijk <v.dijk.bas@gmail.com>2019-04-16 16:04:33 +0200
committerBas van Dijk <v.dijk.bas@gmail.com>2019-04-16 16:04:33 +0200
commita23db5db08206e77c2861107bfaf600b8ff7f5ce (patch)
tree16991053349b174f7a0aacce7890fd1d12db1eb4 /nixos/modules/services/monitoring/prometheus/default.nix
parentad7e232f88da63802544a4b473185a5589fd9a74 (diff)
downloadnixpkgs-a23db5db08206e77c2861107bfaf600b8ff7f5ce.tar
nixpkgs-a23db5db08206e77c2861107bfaf600b8ff7f5ce.tar.gz
nixpkgs-a23db5db08206e77c2861107bfaf600b8ff7f5ce.tar.bz2
nixpkgs-a23db5db08206e77c2861107bfaf600b8ff7f5ce.tar.lz
nixpkgs-a23db5db08206e77c2861107bfaf600b8ff7f5ce.tar.xz
nixpkgs-a23db5db08206e77c2861107bfaf600b8ff7f5ce.tar.zst
nixpkgs-a23db5db08206e77c2861107bfaf600b8ff7f5ce.zip
nixos/prometheus: add new ec2_sd_config options for prometheus2
Diffstat (limited to 'nixos/modules/services/monitoring/prometheus/default.nix')
-rw-r--r--nixos/modules/services/monitoring/prometheus/default.nix38
1 files changed, 35 insertions, 3 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix
index 41519fe548f..525b0b18cec 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.
+          <literal>AWS_ACCESS_KEY_ID</literal> 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.
+           <literal>AWS_SECRET_ACCESS_KEY</literal> 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 <link xlink:href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html">this list</link>
+          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 = {