Skip to content

Commit

Permalink
fix regression while adding the health diagnosis on failure (#628)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
msvolenski and msvolenski authored May 2, 2023
1 parent 7e77135 commit 9a6c7cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions buildpack/telemetry/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 9a6c7cd

Please sign in to comment.