From b128ad127f206fbeb50a55bdb7fde582d47e11d2 Mon Sep 17 00:00:00 2001 From: zer0def Date: Thu, 8 Jul 2021 09:22:26 +0200 Subject: [PATCH] Refresh stale health status on health check request --- patroni_exporter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/patroni_exporter.py b/patroni_exporter.py index 57373d0..eb90db4 100755 --- a/patroni_exporter.py +++ b/patroni_exporter.py @@ -285,6 +285,7 @@ def app(self, environ: Dict, start_response: Any) -> Iterable[ByteString]: url = urlparse(request_uri(environ)) if url.path == '/health': + self.collector.scrape_patroni() # refresh collector status start_response(self.collector.status, [('Content-Type', 'application/json')]) return [b'{}']