Skip to content

Health Checks - #31

Merged
adeutscher merged 36 commits into
developfrom
issue/26/health-api-host-zpages-httplistener
Aug 7, 2026
Merged

Health Checks#31
adeutscher merged 36 commits into
developfrom
issue/26/health-api-host-zpages-httplistener

Conversation

@adeutscher

@adeutscher adeutscher commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Implement a health-check system, re-organization

  • If enabled (on by default, disabled by setting HEALTH__ENABLED=false), then the JobWorker shall host a basic HTTP listener that supports 3 pages:
    • /live, which shall always return an HTTP 200
    • /health, which shall return an HTTP 200 if there has not been a serious exception caught in the Core project within the configured time period (default: 60 seconds, configured by HEALTH__RECENT_INCIDENT_THRESHOLD_SECONDS). If there has been a recent exception, then an HTTP 503 shall be returned.
    • /statistics, which shall return a JSON containing basic lifetime statistics on the worker instance.
  • In order to facilitate this health system, the JobWorker application now executes through an IHost created by a HostApplicationBuilder in the main project, as opposed to directly invoking IHandler.RunAsync
  • Added a RedShirt.Example.JobWorker.HealthCheck application that is bundled into the container. Its only purpose is to ping the /health endpoint and confirm an HTTP 200. A usage example of this is present in test/local/docker-compose.yaml.
  • Encourage Core.Logic implementations to not access Core directly by placing minimally-necessary items in a new RedShirt.Example.JobWorker.Common project that is referenced by both Core and Core.Logic
  • IJobLogicRunner shall now return an object (containing a value of the JobResult enum as a property), in case of future expansion.
  • Rename Broken jobs to InvalidData, in order to be more indicative.

adeutscher and others added 29 commits August 4, 2026 21:36
Expose loader started/finished and shutdown state so livez/readyz implementations can share readiness rules across host shapes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Run the worker via BackgroundService and expose /livez, /healthz, and /readyz at the host edge using IWorkerReadiness, keeping Core free of AspNetCore.

Co-authored-by: Cursor <cursoragent@cursor.com>
Serve /livez, /healthz, and /readyz from a Generic Host IHostedService
using System.Net.HttpListener and DI-resolved IWorkerReadiness, removing
AspNetCore health checks from the executable host.

Co-authored-by: Cursor <cursoragent@cursor.com>
@adeutscher adeutscher linked an issue Aug 7, 2026 that may be closed by this pull request
@adeutscher adeutscher self-assigned this Aug 7, 2026
@adeutscher
adeutscher merged commit 5619b1b into develop Aug 7, 2026
1 check passed
@adeutscher
adeutscher deleted the issue/26/health-api-host-zpages-httplistener branch August 7, 2026 06:55
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.

IJobRunner should return an object Statistics v1 Stronger library divisions for business logic Health Checking / Major Error Handling

1 participant