The health-shim image provides universal health/metrics endpoints for images that don’t natively support Prometheus
metrics.
/livez; Liveness probe (always returns 200 OK)/readyz; Readiness probe (always returns 200 OK)/metrics; Prometheus metrics (image version, uptime)For images without native metrics, add the health-shim as a sidecar:
# docker-compose.yml
services:
myapp:
image: ghcr.io/owner/myapp:latest
# ... app config ...
myapp-metrics:
image: ghcr.io/owner/health-shim:latest
environment:
- IMAGE_VERSION=1.0.0
- METRICS_PORT=9101
ports:
- '9101:9101'
| Metric | Type | Description |
|---|---|---|
evergreen_image_info |
gauge | Image version label |
evergreen_up_seconds |
gauge | Uptime in seconds |
Images in the registry use one of two health-check strategies (see ADR-006):
/livez, /readyz, and /startupz endpoints on
port 9101. These are validated via Kubernetes probes or a health-shim sidecar.FROM scratch or distroless that have no shell use HEALTHCHECK NONE in the
Dockerfile. Health verification is delegated to the orchestrator.Images serving HTTP traffic use wget (available in wolfi-base) to check their application port:
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:8080/ || exit 1
Database images use their native health-check tools to validate service readiness:
| Database | HEALTHCHECK Command |
|---|---|
| PostgreSQL | pg_isready -U $POSTGRES_USER |
| Redis | redis-cli ping |
| MySQL | mysqladmin ping -h localhost |
| MongoDB | mongosh --eval "db.adminCommand('ping')" |
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD pg_isready -U $POSTGRES_USER || exit 1
Images built FROM scratch have no shell or utilities available, so they use HEALTHCHECK NONE. Health verification
relies on the health-shim sidecar or Kubernetes-native probes:
HEALTHCHECK NONE
Images that exist solely to export Prometheus metrics check their own metrics endpoint:
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost:9101/metrics || exit 1
Images that already expose Prometheus metrics on port 9101 don’t need the health-shim. These include: