feat(snuba): healthcheck adjustments preparing for distroless#4352
Conversation
| SENTRY_TASKWORKER_CONCURRENCY=4 | ||
| SENTRY_IMAGE=ghcr.io/getsentry/sentry:nightly | ||
| SNUBA_IMAGE=ghcr.io/getsentry/snuba:nightly | ||
| SNUBA_IMAGE=ghcr.io/getsentry/snuba:nightly-distroless |
There was a problem hiding this comment.
Nope, this is going to problematic, as the monthly release would become ghcr.io/getsentry/snuba:26.6.0-distroless, which may not exist.
| URL = "http://127.0.0.1:1218/health" | ||
| TIMEOUT = 2 |
There was a problem hiding this comment.
It'd be best if this two is configurable through environment variables or other means. Editing the file here right away is a no-go, users shouldn't get into git conflict troubles.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2503d4e. Configure here.
|
Tested on our self-hosted instance by switching snuba tag from |

The snuba-api and consumer healthchecks shell out to /bin/bash, /bin/sh (via CMD-SHELL), and rm — none of which ship in the distroless snuba image. Setting
SNUBA_IMAGE=ghcr.io/getsentry/snuba:nightly-distrolesstoday produces:Replaces both healthchecks with Python scripts that use only python3 (already on PATH in both the regular and distroless image variants):
snuba/healthcheck/api.py— GETs/healthand asserts the body contains"ok". Same semantics as the previous bash +/dev/tcpprobe./tmp/health.txt, equivalent to the previousrm.Both print a single-line stderr message on failure (e.g.
snuba /health unreachable: [Errno 111] Connection refused) instead of a multi-line Python traceback, sodocker inspectoutput stays readable while services are coming up.Scripts are mounted via a single
volumes:onx-snuba-defaults, so every snuba-* service inherits the mount automatically. The existing CA-cert override mechanism appends to the volumes list, so the two mounts coexist without conflict.This was tested on our self-hosted instance,
snuba-apiandsnuba-errors-consumercontainers.Benefits:
Cons:
snuba-api
snuba-errors-consumer