From 5da347405e57179ad2651af18dc4b4176f1e59d9 Mon Sep 17 00:00:00 2001 From: Aiqin Zhang Date: Wed, 30 Aug 2023 16:15:32 +1000 Subject: [PATCH] Emit a metric when pghoard quits main loop for example: for alerting purpose --- pghoard/pghoard.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pghoard/pghoard.py b/pghoard/pghoard.py index bc7a5cec..a2a04a3b 100644 --- a/pghoard/pghoard.py +++ b/pghoard/pghoard.py @@ -879,6 +879,7 @@ def run(self): self.metrics.unexpected_exception(ex, where="pghoard_run") if self.thread_critical_failure_event.wait(timeout=5.0): self.log.error("Unexpected critical failure in PGHoard thread. Quitting main loop.") + self.metrics.increase("pghoard.unrecoverable_quit_main_loop_failure") self.quit() def write_backup_state_to_json_file(self):