Skip to content

Commit

Permalink
chore(api): Do not log healthcheck error if downfile exists (#6635)
Browse files Browse the repository at this point in the history
Kubernetes tells the old snuba pods to mark itself as unhealthy, so that
envoy stops sending traffic to it.

Snuba reports itself as unhealthy to Sentry.

Gocd checks Sentry for new errors.

Gocd stalls the deployment because there are new errors.
  • Loading branch information
untitaker authored Dec 12, 2024
1 parent 38f2d86 commit 5fc3d7d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions snuba/utils/health_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ def get_health_info(thorough: Union[bool, str]) -> HealthInfo:
payload = json.dumps(body)
if status != 200:
metrics.increment("healthcheck_failed", tags=metric_tags)
logger.error(f"Snuba health check failed! Tags: {metric_tags}")

if status != 200 or down_file_exists:
logger.info(payload)
if down_file_exists:
logger.error("Snuba health check failed! Tags: %s", metric_tags)
else:
logger.info("Snuba health check failed! Tags: %s", metric_tags)

metrics.timing(
"healthcheck.latency",
Expand Down

0 comments on commit 5fc3d7d

Please sign in to comment.