Skip to content

feat(ingestion): add health endpoints with publisher initialization retry#15

Draft
Bafbi wants to merge 1 commit intomainfrom
feat/service-probing
Draft

feat(ingestion): add health endpoints with publisher initialization retry#15
Bafbi wants to merge 1 commit intomainfrom
feat/service-probing

Conversation

@Bafbi
Copy link
Collaborator

@Bafbi Bafbi commented Feb 17, 2026

Summary

  • Add /healthz/live and /healthz/ready endpoints to ingestion service
  • Implement HealthService with exponential backoff retry for publisher initialization
  • Add Docker healthcheck and restart policy to docker-compose

Changes

New Files

  • services/ingestion/src/ingestion/api/v1/endpoints/health.py - Health endpoints
  • services/ingestion/src/ingestion/services/health.py - HealthService with retry logic

Modified Files

  • services/ingestion/src/ingestion/main.py - Add lifespan for startup init
  • infra/local/docker-compose.yml - Add healthcheck configuration

Behavior

  • /healthz/live returns {"status": "alive"} (always 200)
  • /healthz/ready returns {"status": "ready", "publisher": "ok"} when publisher is initialized, 503 otherwise
  • Publisher initialization retries in background with exponential backoff (1s → 2s → 4s → ... → 30s max)
  • Docker healthcheck polls /healthz/ready every 10s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant