From 2f9830c16abed91632dfb66e0cee279e7933e8ac Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Wed, 1 Jun 2022 03:52:34 +0100 Subject: [PATCH] Handle containers going missing in the middle of a metrics run --- dockstat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dockstat.py b/dockstat.py index e5a3628..d5e82ba 100644 --- a/dockstat.py +++ b/dockstat.py @@ -37,7 +37,10 @@ class HTTPHandler(MetricsHandler): # type: ignore[misc] Handle GET requests """ if self.path == '/metrics': - self._metrics() + try: + self._metrics() + except docker.errors.NotFound: + pass if self.path == '/healthcheck': if not healthy():