Skip to content

Commit

Permalink
nixos/prometheus: make scrapeConfigs.*.static_configs.*.labels optional
Browse files Browse the repository at this point in the history
...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.
  • Loading branch information
bjornfor committed Dec 25, 2016
1 parent 7cd5ef7 commit b20fdff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/services/monitoring/prometheus/default.nix
Expand Up @@ -191,6 +191,7 @@ let
};
labels = mkOption {
type = types.attrsOf types.str;
default = {};
description = ''
Labels assigned to all metrics scraped from the targets.
'';
Expand Down

0 comments on commit b20fdff

Please sign in to comment.