Provides
HealthCheckOptionsand endpoint-registration extensions for wiring CoreEx-standard live, startup, ready, and detailed health check endpoints into an ASP.NET Core application.
CoreEx.AspNetCore.HealthChecks bridges the CoreEx.HealthChecks tag conventions and the CoreEx.Hosting HostedServiceHealthCheck registrations into fully configured ASP.NET Core endpoint middleware. HealthCheckOptions controls which of the standard endpoint paths are enabled, what path each uses, and whether detailed JSON output is served.
The detail endpoint writes a JSON HealthReport body (status, duration, each entry's status/duration/exception/data), making it easy for operations dashboards to consume without custom serialization. Each endpoint uses tag-based filtering (live, ready) aligned with HealthCheckTags from CoreEx.HealthChecks.
- ♥ Standard endpoints: Live (
/health/live), startup (/health/startup), ready (/health/ready), and related detail (e.g./health/ready/detail) are configurable viaHealthCheckOptionsproperties. - 📋 JSON detail report: The detail endpoint writes a structured JSON
HealthReportwith per-entry status, description, duration, exception message, and custom data dictionary. - ⚙️ Per-endpoint enable/disable: Each endpoint can be disabled independently (
IsLiveEndpointEnabled,IsReadyEndpointEnabled,IsStartupEndpointEnabled,AreDetailedEndpointsEnabled) for environments where not all probes are needed. - 🔌 Custom detail writer:
OnWriteDetailedHealthCheckAsync(HttpContext, HealthReport)is a virtual method onHealthCheckOptionsfor full control over the detail response format. - 🔒 Securable detail endpoints:
MapHealthChecks(options, detailedGroupConfigure)accepts an optionalAction<IEndpointConventionBuilder>applied only to the/detailedendpoints (e.g.g => g.RequireAuthorization()), so live/startup/ready probes stay anonymous while the detailed diagnostic payload is protected.
| Type | Description |
|---|---|
HealthCheckOptions |
Configuration for live/startup/ready/detail endpoint paths, enable flags, and the virtual OnWriteDetailedHealthCheckAsync detail writer. |
CoreEx.HealthChecks- DefinesHealthCheckTags.LiveandHealthCheckTags.Readyconstants consumed by the endpoint tag filters.CoreEx.Hosting-HostedServiceHealthCheckandHostedServiceManagerregister health checks that appear in the ready endpoint aggregation.CoreEx.AspNetCore-MapCoreExHealthChecks(HealthCheckOptions)extension method in the root package wires all four endpoints into the application's endpoint routing.