diff options
Diffstat (limited to 'nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix')
-rw-r--r-- | nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix index dbfa69678a0c..59715f5d33e2 100644 --- a/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix +++ b/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters/sql.nix @@ -1,13 +1,19 @@ { config, lib, pkgs, options, ... }: -with lib; let cfg = config.services.prometheus.exporters.sql; + inherit (lib) + mkOption + types + mapAttrs + mapAttrsToList + concatStringsSep + ; cfgOptions = { options = with types; { jobs = mkOption { type = attrsOf (submodule jobOptions); default = { }; - description = lib.mdDoc "An attrset of metrics scraping jobs to run."; + description = "An attrset of metrics scraping jobs to run."; }; }; }; @@ -15,23 +21,23 @@ let options = with types; { interval = mkOption { type = str; - description = lib.mdDoc '' + description = '' How often to run this job, specified in [Go duration](https://golang.org/pkg/time/#ParseDuration) format. ''; }; connections = mkOption { type = listOf str; - description = lib.mdDoc "A list of connection strings of the SQL servers to scrape metrics from"; + description = "A list of connection strings of the SQL servers to scrape metrics from"; }; startupSql = mkOption { type = listOf str; default = []; - description = lib.mdDoc "A list of SQL statements to execute once after making a connection."; + description = "A list of SQL statements to execute once after making a connection."; }; queries = mkOption { type = attrsOf (submodule queryOptions); - description = lib.mdDoc "SQL queries to run."; + description = "SQL queries to run."; }; }; }; @@ -40,20 +46,20 @@ let help = mkOption { type = nullOr str; default = null; - description = lib.mdDoc "A human-readable description of this metric."; + description = "A human-readable description of this metric."; }; labels = mkOption { type = listOf str; default = [ ]; - description = lib.mdDoc "A set of columns that will be used as Prometheus labels."; + description = "A set of columns that will be used as Prometheus labels."; }; query = mkOption { type = str; - description = lib.mdDoc "The SQL query to run."; + description = "The SQL query to run."; }; values = mkOption { type = listOf str; - description = lib.mdDoc "A set of columns that will be used as values of this metric."; + description = "A set of columns that will be used as values of this metric."; }; }; }; @@ -77,14 +83,14 @@ in configFile = mkOption { type = with types; nullOr path; default = null; - description = lib.mdDoc '' + description = '' Path to configuration file. ''; }; configuration = mkOption { type = with types; nullOr (submodule cfgOptions); default = null; - description = lib.mdDoc '' + description = '' Exporter configuration as nix attribute set. Mutually exclusive with 'configFile' option. ''; }; |