BitzOrcas provides two-tier health checks via Aspire ServiceDefaults — liveness for process health and readiness for dependency availability.
Two tiers
Liveness (/health/live)
Proves the process is running and responding. No external dependencies checked.
builder.Services.AddHealthChecks() .AddCheck("self", () => HealthCheckResult.Healthy("alive"), tags: [LivenessTag]);K8s usage: livenessProbe → restart pod if failing.
Readiness (/health/ready)
Checks critical external dependencies. Fails gracefully — won’t restart the process, but signals the load balancer to stop routing traffic.
K8s usage: readinessProbe → remove from service endpoint pool.
Production readiness checks are registered by infrastructure adapters:
| Dependency | Registered by | Check |
|---|---|---|
| SQL Server | PersistenceAdapters | Connection + query |
| RabbitMQ | PersistenceAdapters | Connection |
| (Future) Redis | Caching adapter | Connection + ping |
Tags
public const string LivenessTag = "live";public const string ReadinessTag = "ready";Endpoints
GET /health/live → 200 OK (always, if process is alive)GET /health/ready → 200 OK (all dependencies healthy) or 503 (dependency down)GET /health → All registered checks (unfiltered)Configuration
Health check endpoints are registered by Aspire’s AddServiceDefaults():
// In Program.cs — already includedbuilder.AddServiceDefaults();
// Map health endpointsapp.MapHealthChecks("/health");app.MapHealthChecks("/health/live", new HealthCheckOptions{ Predicate = check => check.Tags.Contains("live")});app.MapHealthChecks("/health/ready", new HealthCheckOptions{ Predicate = check => check.Tags.Contains("ready")});Adding custom health checks
Register additional readiness checks in your adapter:
services.AddHealthChecks() .AddNpgSql(connectionString, name: "postgres", tags: ["ready"]);services.AddHealthChecks() .AddRabbitMQ(rabbitMqConnectionString, name: "rabbitmq", tags: ["ready"]);See also
- Observability — OpenTelemetry integration
- Deployment — Container health configuration