RepletoryLib.HealthChecks
1.0.0
dotnet add package RepletoryLib.HealthChecks --version 1.0.0
NuGet\Install-Package RepletoryLib.HealthChecks -Version 1.0.0
<PackageReference Include="RepletoryLib.HealthChecks" Version="1.0.0" />
<PackageVersion Include="RepletoryLib.HealthChecks" Version="1.0.0" />
<PackageReference Include="RepletoryLib.HealthChecks" />
paket add RepletoryLib.HealthChecks --version 1.0.0
#r "nuget: RepletoryLib.HealthChecks, 1.0.0"
#:package RepletoryLib.HealthChecks@1.0.0
#addin nuget:?package=RepletoryLib.HealthChecks&version=1.0.0
#tool nuget:?package=RepletoryLib.HealthChecks&version=1.0.0
RepletoryLib.HealthChecks
Health check configuration for SQL Server, PostgreSQL, Redis, RabbitMQ, and external URIs.
Part of the RepletoryLib ecosystem -- standalone, reusable .NET 10 libraries with zero business logic.
Overview
RepletoryLib.HealthChecks provides a configuration-driven approach to health checks for ASP.NET Core applications. Enable checks for your infrastructure dependencies via appsettings.json and get a detailed JSON health report at /health.
Key Features
- SQL Server -- Connection check
- PostgreSQL -- Connection check
- Redis -- Connection check
- RabbitMQ -- Connection check
- External URIs -- HTTP reachability check for any URL
- JSON response -- Detailed health report with per-check status and duration
- Configuration-driven -- Enable/disable checks via config
Installation
dotnet add package RepletoryLib.HealthChecks
Dependencies
| Package | Type |
|---|---|
RepletoryLib.Common |
RepletoryLib |
AspNetCore.HealthChecks.SqlServer |
NuGet |
AspNetCore.HealthChecks.NpgSql |
NuGet |
AspNetCore.HealthChecks.Redis |
NuGet |
AspNetCore.HealthChecks.RabbitMQ |
NuGet |
AspNetCore.HealthChecks.Uris |
NuGet |
Quick Start
using RepletoryLib.HealthChecks;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRepletoryHealthChecks(builder.Configuration);
var app = builder.Build();
app.UseRepletoryHealthChecks();
{
"HealthChecks": {
"EnableSqlServer": true,
"SqlServerConnection": "Server=localhost,1433;Database=MyApp;User Id=sa;Password=Repletory@123!;TrustServerCertificate=true",
"EnablePostgres": true,
"PostgresConnection": "Host=localhost;Port=5432;Database=myapp;Username=repletory;Password=Repletory@123!",
"EnableRedis": true,
"RedisConnection": "localhost:6379",
"EnableRabbitMq": true,
"RabbitMqConnection": "amqp://repletory:Repletory@123!@localhost:5672",
"ExternalUrls": ["https://api.example.com/health"]
}
}
Configuration
HealthCheckOptions
| Property | Type | Default | Description |
|---|---|---|---|
EnableSqlServer |
bool |
false |
Enable SQL Server health check |
SqlServerConnection |
string? |
null |
SQL Server connection string |
EnablePostgres |
bool |
false |
Enable PostgreSQL health check |
PostgresConnection |
string? |
null |
PostgreSQL connection string |
EnableRedis |
bool |
false |
Enable Redis health check |
RedisConnection |
string? |
null |
Redis connection string |
EnableRabbitMq |
bool |
false |
Enable RabbitMQ health check |
RabbitMqConnection |
string? |
null |
RabbitMQ AMQP connection string |
ExternalUrls |
List<string> |
[] |
External URLs to check |
Usage Examples
Health Check Response
GET /health returns:
{
"status": "Healthy",
"totalDuration": "00:00:00.1234567",
"entries": {
"sqlserver": {
"status": "Healthy",
"duration": "00:00:00.0234567",
"description": null,
"tags": ["database", "sqlserver"]
},
"redis": {
"status": "Healthy",
"duration": "00:00:00.0012345",
"description": null,
"tags": ["cache", "redis"]
},
"rabbitmq": {
"status": "Degraded",
"duration": "00:00:05.0000000",
"description": "Connection timed out",
"tags": ["messaging", "rabbitmq"]
}
}
}
Kubernetes / Docker Health Probes
# docker-compose.yml
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
# Kubernetes
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 30
Integration with Other RepletoryLib Packages
| Package | Relationship |
|---|---|
RepletoryLib.Common |
Direct dependency |
RepletoryLib.Caching.Redis |
Redis health check |
RepletoryLib.Messaging.RabbitMQ |
RabbitMQ health check |
RepletoryLib.Data.EntityFramework |
SQL Server / PostgreSQL health check |
RepletoryLib.Metrics |
Health status can be exposed as Prometheus gauge |
License
This project is licensed under the MIT License.
Copyright (c) 2024-2026 Repletory.
For complete documentation, infrastructure setup, and configuration reference, see the RepletoryLib main repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AspNetCore.HealthChecks.NpgSql (>= 8.0.2)
- AspNetCore.HealthChecks.Rabbitmq (>= 8.0.2)
- AspNetCore.HealthChecks.Redis (>= 9.0.0)
- AspNetCore.HealthChecks.SqlServer (>= 8.0.2)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- RepletoryLib.Common (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 160 | 3/2/2026 |