HealthCheckr 2.0.0

dotnet add package HealthCheckr --version 2.0.0
                    
NuGet\Install-Package HealthCheckr -Version 2.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="HealthCheckr" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HealthCheckr" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="HealthCheckr" />
                    
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 HealthCheckr --version 2.0.0
                    
#r "nuget: HealthCheckr, 2.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 HealthCheckr@2.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=HealthCheckr&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=HealthCheckr&version=2.0.0
                    
Install as a Cake Tool

HealthCheckr

A lightweight health check library for .NET and Azure Functions that runs asynchronous checks in parallel, preserves execution order and returns a clean JSON response with status, durations and optional error details.

The library is framework-agnostic and has no dependency on ASP.NET, making it suitable for console apps, background services, Azure Functions and any .NET runtime.

CI Build NuGet

Features

  • Async and concurrent execution with cancellation support
  • Order-preserving results for consistent logging and dashboards
  • Configurable HTTP return codes and optional diagnostics
  • Attach arbitrary metadata at the global or per-check level (for example region, version, dependency info)
  • Tag-based filtering with include and exclude semantics
  • Works well in Azure Functions, serverless, worker services and web APIs
  • Minimal dependencies and easy to integrate
  • Optional �simple� sequential check returning only HealthStatus without JSON

Installation

Install via NuGet:

dotnet add package HealthCheckr

Or via the NuGet Package Manager:

PM> Install-Package HealthCheckr

Usage

using HealthCheckr;

HealthChecker healthChecker = new()
{
    IncludeErrors = true,
    Data = new Dictionary<string, object?>
    {
        ["Environment"] = "Production",
        ["Id"] = 42
    }
};

// Add checks
healthChecker.AddCheck("Check 1",
    async () =>
    {
        return await Task.FromResult(new HealthCheckResult { Status = HealthStatus.Healthy });
    }
);

healthChecker.AddCheck("Check 2",
    async () =>
    {
        return await Task.FromResult(new HealthCheckResult
        {
            Status = HealthStatus.Degraded,
            Data = new Dictionary<string, object?> { ["Metadata1"] = 123 }
        });
    },
    tags: ["external"]
);

healthChecker.AddCheck("Check 3",
    async () =>
    {
        return await Task.FromResult(new HealthCheckResult { Status = HealthStatus.Unhealthy });
    },
    tags: ["external", "critical"]
);

// Full JSON health report
var result = await healthChecker.CheckAsync(
    includeTags: ["external"]
);

Console.WriteLine(result.ToJson());

// Simple sequential check returning only HealthStatus
var simpleStatus = await healthChecker.CheckSimpleAsync(
    includeTags: ["external"],
    excludeTags: null
);

Console.WriteLine(simpleStatus);

Tag filtering semantics

HealthCheckr supports include and exclude tag filters to control which checks run.

Rules

  1. Exclude always wins
    If a check has any excluded tag it will not run even if it also matches include tags.

  2. Include acts as an allow list
    When include tags are specified only checks that contain at least one included tag will run.

  3. Untagged checks are excluded when filters are present
    If a check has no tags it will only run when no include or exclude filters are provided.


Example JSON Output


{
  "status": "Unhealthy",
  "checks": [
    {
      "name": "Check 2",
      "status": "Degraded",
      "durationMs": 2,
      "data": {
        "Metadata1": 123
      },
      "tags": [
        "external"
      ]
    },
    {
      "name": "Check 3",
      "status": "Unhealthy",
      "durationMs": 1,
      "tags": [
        "external",
        "critical"
      ]
    }
  ],
  "totalDurationMs": 11,
  "timestamp": "2026-01-22T02:08:25.2082994+00:00",
  "data": {
    "Environment": "Production",
    "Id": 42
  }
}

Configuration

  • IncludeErrors – Include exception details for failing checks
  • IncludeDuration – Include execution duration per check
  • HealthyHttpStatusCode / DegradedHttpStatusCode / UnhealthyHttpStatusCode – Customize HTTP response codes for the overall status

Contributing

Contributions are welcome. Please open an issue or pull request on GitHub.


License

© Kirill Polishchuk

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net8.0

    • No dependencies.

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
2.0.0 90 1/22/2026
1.0.1 85 1/19/2026
1.0.0 98 1/19/2026