From 9a6c7cd95acfdfa69a8d1f442cec213c9b2b7706 Mon Sep 17 00:00:00 2001 From: Matheus Svolenski Date: Tue, 2 May 2023 09:19:39 -0300 Subject: [PATCH] fix regression while adding the health diagnosis on failure (#628) health["diagnosis"] is expected to return a string, but due to incorrect replacement, it started returning a tuple, which breaks other services that depend on this value. Co-authored-by: Matheus Svolenski --- buildpack/telemetry/metrics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildpack/telemetry/metrics.py b/buildpack/telemetry/metrics.py index 224ae25e6..f589dc5fb 100644 --- a/buildpack/telemetry/metrics.py +++ b/buildpack/telemetry/metrics.py @@ -352,8 +352,8 @@ def _inject_health(self, stats): else: health["health"] = translation["critical"] health["diagnosis"] = ( - "Health check failed unexpectedly: %s", - health_response.get_error(), + "Health check failed unexpectedly: " + f"{health_response.get_error()}" ) else: feedback = health_response.get_feedback() @@ -365,7 +365,7 @@ def _inject_health(self, stats): except Exception as exc: logging.warning("Metrics: Failed to get health status %s", str(exc)) health["health"] = translation["critical"] - health["diagnosis"] = "Health check failed unexpectedly: %s", exc + health["diagnosis"] = f"Health check failed unexpectedly: {exc}" return stats @staticmethod