Substantive.AspNetCore.HealthChecks 9.17.9-build20260119r1
Substantive.AspNetCore.HealthChecks
Opinionated health-check host helpers for .NET services. The library delivers ready-to-use registration, response formatting, and endpoint helpers so every API in the estate exposes consistent readiness and liveness probes.
Highlights
- Pre-registers liveness, CPU, and memory checks using
AddHealthChecksHost. - Optional drive storage and Entity Framework
DbContextchecks that light up through configuration. - JSON response writer (
HealthReportResponseWriter) that returns detailed status for dashboards and probes. MapHealthCheckEndpointshelper that exposeshealth/readyzandhealth/livezendpoints with consistent tagging.
Getting Started
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHealthChecksHost(options =>
{
options.EnableDriveHealthCheck = builder.Environment.IsDevelopment();
options.EnableDbContextHealthCheck = true;
options.CPUUtilizationUnhealthyThreshold = 90;
});
var app = builder.Build();
app.MapHealthCheckEndpoints();
app.Run();
Service Registration
Call services.AddHealthChecksHost() in Program.cs (after other dependencies). The extension:
- Creates and validates
HealthChecksHostOptionsat startup. - Registers resource monitoring (
IResourceMonitor) required by CPU/memory checks. - Adds health checks:
LivenessHealthChecktagged withliveness.CpuHealthCheckandMemoryHealthChecktagged withreadiness.- Optional drive storage checks per mounted drive when
EnableDriveHealthCheckistrue. - Optional
AddDbContextCheck<TContext>for every registeredDbContextwhenEnableDbContextHealthCheckistrue.
Options Reference
| Option | Description | Default |
|---|---|---|
EnableDriveHealthCheck |
Adds disk checks for each drive. Avoid when running inside container images. | false |
EnableDbContextHealthCheck |
Adds EF DbContext connectivity checks. |
false |
CPUUtilizationDegradedThreshold |
Percentage that triggers degraded result. | 80 |
CPUUtilizationUnhealthyThreshold |
Percentage that triggers unhealthy result. Must be ≥ degraded threshold. | 90 |
MemoryDegradedThreshold |
Memory usage percentage for degraded status. | 90 |
MemoryUnhealthyThreshold |
Memory usage percentage for unhealthy status. Must be ≥ degraded threshold. | 95 |
MinimumDiskRemainingThresholdMB |
Minimum free space (MB) per drive when drive checks are enabled. | 500 |
All thresholds are validated through HealthChecksHostOptionsValidator and IOptionsValidateOnStart, so misconfigurations fail fast during app startup.
Endpoint Mapping
WebApplicationExtensions.MapHealthCheckEndpoints() maps two endpoints:
health/readyz→ filters checks tagged withreadinessorready.health/livez→ filters checks tagged withlivenessorlive.
Both endpoints:
- Use
HealthReportResponseWriterto emit camel-cased JSON with enum values serialized as strings. - Allow response caching by default.
- Can be wrapped in route groups or authorization middleware if needed.
Response Format
HealthReportResponseWriter.WriteDetailResponse serializes the full HealthReport, including individual entry status, description, data, and duration. The writer honors HttpContext.RequestAborted and sets application/json; charset=utf-8.
Customization Tips
- Override thresholds per environment using app configuration (e.g.,
appsettings.Production.json). - Add custom health checks by chaining
services.AddHealthChecks()after callingAddHealthChecksHost(). - For multi-tenant or multi-region deployments, prepend a path segment or require host filtering by wrapping
MapHealthCheckEndpoints()with additional middleware.
Showing the top 20 packages that depend on Substantive.AspNetCore.HealthChecks.
| Packages | Downloads |
|---|---|
|
Substantive.AspNetCore
Substantive ASP.NET Core package.
|
4 |
|
Substantive.AspNetCore
Substantive ASP.NET Core package.
|
5 |
|
Substantive.AspNetCore
Substantive ASP.NET Core package.
|
6 |
|
Substantive.AspNetCore
Substantive ASP.NET Core package.
|
8 |
|
Substantive.AspNetCore
Substantive ASP.NET Core package.
|
19 |
|
Substantive.AspNetCore
Substantive ASP.NET Core package.
|
21 |
|
Substantive.AspNetCore
Substantive ASP.NET Core package.
|
22 |
|
Substantive.AspNetCore
Substantive ASP.NET Core package.
|
23 |
|
Substantive.AspNetCore
Substantive ASP.NET Core package.
|
24 |
|
Substantive.Metapackage.AspNetCoreServer
A metapackage contains all Substantive ASP.NET Core server-side packages.
|
3 |
|
Substantive.Metapackage.Backends
A metapackage contains all Substantive backend building blocks.
|
3 |
.NET 10.0
- AspNetCore.HealthChecks.System (>= 9.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.2)
- Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore (>= 10.0.2)
- Microsoft.Extensions.Diagnostics.ResourceMonitoring (>= 10.2.0)
| Version | Downloads | Last updated |
|---|---|---|
| 9.17.21-build20260204R1 | 0 | 02/04/2026 |
| 9.17.20-build20260203R1 | 2 | 02/03/2026 |
| 9.17.19-build20260130R1 | 8 | 01/30/2026 |
| 9.17.18-build20260129R1 | 19 | 01/29/2026 |
| 9.17.17-build20260129R1 | 23 | 01/29/2026 |
| 9.17.17-build20260128R1 | 21 | 01/28/2026 |
| 9.17.16-build20260127R2 | 22 | 01/27/2026 |
| 9.17.16-build20260123R1 | 4 | 01/23/2026 |
| 9.17.15-build20260122R1 | 6 | 01/22/2026 |
| 9.17.14-build20260122R2 | 6 | 01/22/2026 |
| 9.17.14-build20260122R1 | 2 | 01/22/2026 |
| 9.17.14-build20260121R1 | 2 | 01/21/2026 |
| 9.17.13-build20260121R1 | 2 | 01/21/2026 |
| 9.17.12-build20260120R1 | 6 | 01/20/2026 |
| 9.17.11-build20260120R1 | 5 | 01/20/2026 |
| 9.17.10-build20260120R1 | 4 | 01/20/2026 |
| 9.17.9-build20260119R1 | 5 | 01/19/2026 |
| 9.17.8-build20260119R1 | 4 | 01/19/2026 |
| 9.17.7-build20260115R1 | 2 | 01/15/2026 |
| 9.17.6-build20260115R1 | 1 | 01/15/2026 |
| 9.17.5-build20260119R1 | 4 | 01/19/2026 |
| 9.17.5-build20260115R1 | 2 | 01/15/2026 |
| 9.17.4-build20260115R1 | 4 | 01/15/2026 |
| 9.17.3-build20260115R1 | 1 | 01/15/2026 |
| 9.17.2-build20260115R1 | 1 | 01/15/2026 |
| 9.17.2-build20260113R1 | 24 | 01/13/2026 |