nixos/thanos: Add check for serving gRPC port
This commit is contained in:
@@ -42,7 +42,10 @@ in
|
|||||||
{
|
{
|
||||||
virtualisation.diskSize = 2 * 1024;
|
virtualisation.diskSize = 2 * 1024;
|
||||||
virtualisation.memorySize = 2048;
|
virtualisation.memorySize = 2048;
|
||||||
environment.systemPackages = [ pkgs.jq ];
|
environment.systemPackages = [
|
||||||
|
pkgs.grpc-health-probe
|
||||||
|
pkgs.jq
|
||||||
|
];
|
||||||
networking.firewall.allowedTCPPorts = [ grpcPort ];
|
networking.firewall.allowedTCPPorts = [ grpcPort ];
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -178,6 +181,7 @@ in
|
|||||||
virtualisation.diskSize = 2 * 1024;
|
virtualisation.diskSize = 2 * 1024;
|
||||||
virtualisation.memorySize = 2048;
|
virtualisation.memorySize = 2048;
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
grpc-health-probe
|
||||||
jq
|
jq
|
||||||
thanos
|
thanos
|
||||||
];
|
];
|
||||||
@@ -251,6 +255,13 @@ in
|
|||||||
prometheus.wait_for_open_port(${toString queryPort})
|
prometheus.wait_for_open_port(${toString queryPort})
|
||||||
prometheus.succeed("curl -sf http://127.0.0.1:${toString queryPort}/metrics")
|
prometheus.succeed("curl -sf http://127.0.0.1:${toString queryPort}/metrics")
|
||||||
|
|
||||||
|
prometheus.wait_until_succeeds("journalctl -o cat -u thanos-sidecar.service | grep 'listening for serving gRPC'")
|
||||||
|
|
||||||
|
store.wait_until_succeeds("journalctl -o cat -u thanos-store.service | grep 'listening for serving gRPC'")
|
||||||
|
|
||||||
|
for machine in prometheus, store:
|
||||||
|
machine.wait_until_succeeds("grpc-health-probe -addr 127.0.0.1:${toString grpcPort}")
|
||||||
|
|
||||||
# Let's test if pushing a metric to the pushgateway succeeds:
|
# Let's test if pushing a metric to the pushgateway succeeds:
|
||||||
prometheus.wait_for_unit("pushgateway.service")
|
prometheus.wait_for_unit("pushgateway.service")
|
||||||
prometheus.succeed(
|
prometheus.succeed(
|
||||||
|
|||||||
Reference in New Issue
Block a user