RepletoryLib.HealthChecks 1.0.0

dotnet add package RepletoryLib.HealthChecks --version 1.0.0
                    
NuGet\Install-Package RepletoryLib.HealthChecks -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RepletoryLib.HealthChecks" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RepletoryLib.HealthChecks" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="RepletoryLib.HealthChecks" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RepletoryLib.HealthChecks --version 1.0.0
                    
#r "nuget: RepletoryLib.HealthChecks, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RepletoryLib.HealthChecks@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RepletoryLib.HealthChecks&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=RepletoryLib.HealthChecks&version=1.0.0
                    
Install as a Cake Tool

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.

NuGet .NET 10 License: MIT


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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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