mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
26 lines
611 B
Nix
26 lines
611 B
Nix
import ./make-test.nix {
|
|
name = "prometheus";
|
|
|
|
nodes = {
|
|
one = { ... }: {
|
|
services.prometheus = {
|
|
enable = true;
|
|
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");
|
|
'';
|
|
}
|