From 789566e224c9296ad169a02c67f371b3c7849e3c Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 6 Mar 2023 18:05:04 +0100 Subject: [PATCH] cluster/services/patroni: improve health checks --- cluster/services/patroni/worker.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cluster/services/patroni/worker.nix b/cluster/services/patroni/worker.nix index 1113742..297c5ac 100644 --- a/cluster/services/patroni/worker.nix +++ b/cluster/services/patroni/worker.nix @@ -81,12 +81,20 @@ in port = cluster.config.links.patroni-pg-internal.port; checks = [ { - name = "service:patroni"; + name = "Patroni API"; + id = "service:patroni"; interval = "5s"; - http = "http://${address}:${cluster.config.links.patroni-api.portStr}"; + http = "http://${address}:${cluster.config.links.patroni-api.portStr}/liveness"; } { - name = "service:patroni:postgres"; + name = "Patroni Leader"; + id = "service:patroni:leader"; + interval = "5s"; + http = "http://${address}:${cluster.config.links.patroni-api.portStr}/leader"; + } + { + name = "PostgreSQL"; + id = "service:patroni:postgres"; interval = "120s"; tcp = "${address}:${cluster.config.links.patroni-pg-internal.portStr}"; }