nixos/prometheus: make scrapeConfigs.*.static_configs.*.labels optional

...by providing a default value of "no labels" (an empty attrset).

Without this change we get

  $ nixos-rebuild test -I nixpkgs=.
  building Nix...
  building the system configuration...
  error: The option `services.prometheus.scrapeConfigs.[definition 1-entry 1].static_configs.[definition 1-entry 1].labels' is used but not defined.

which is unneeded, because labels _are_ optional.
This commit is contained in:
Bjørn Forsman 2016-12-23 17:42:05 +01:00
parent 7cd5ef772b
commit b20fdff521

View File

@ -191,6 +191,7 @@ let
};
labels = mkOption {
type = types.attrsOf types.str;
default = {};
description = ''
Labels assigned to all metrics scraped from the targets.
'';