mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01:00
3fb785b0ad
target_groups was renamed to static_configs in d459916504 ("prometheus service: rename values to match prometheus 1.0 naming."). Catch up.
29 lines
698 B
Nix
29 lines
698 B
Nix
import ./make-test.nix {
|
|
name = "prometheus";
|
|
|
|
nodes = {
|
|
one = { config, pkgs, ... }: {
|
|
services.prometheus = {
|
|
enable = true;
|
|
globalConfig = {
|
|
labels = { foo = "bar"; };
|
|
};
|
|
scrapeConfigs = [{
|
|
job_name = "prometheus";
|
|
static_configs = [{
|
|
targets = [ "127.0.0.1:9090" ];
|
|
labels = { instance = "localhost"; };
|
|
}];
|
|
}];
|
|
rules = [ ''testrule = count(up{job="prometheus"})'' ];
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
startAll;
|
|
$one->waitForUnit("prometheus.service");
|
|
$one->waitForOpenPort(9090);
|
|
$one->succeed("curl -s http://127.0.0.1:9090/metrics");
|
|
'';
|
|
}
|