Dinaup.HealthCheck 1.0.1

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

Dinaup.HealthCheck

A lightweight health check library for ASP.NET Core and Blazor Server applications. Provides detailed system metrics, memory information, runtime details, and optional Blazor circuit tracking.

Features

  • System metrics (uptime, hostname, version)
  • Memory usage (working set, GC heap, collection counts)
  • Runtime information (.NET version, OS, CPU count)
  • Integration with ASP.NET Core Health Checks
  • Optional Blazor Server circuit tracking
  • Simple configuration

Installation

dotnet add package Dinaup.HealthCheck

Quick Start

ASP.NET Core / Blazor WebAssembly

// Program.cs
using Dinaup.HealthCheck.Extensions;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddDinaupHealthCheck();

var app = builder.Build();

app.MapControllers();

app.Run();

Blazor Server (with circuit tracking)

// Program.cs
using Dinaup.HealthCheck.Extensions;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddDinaupHealthCheck(options =>
{
    options.EnableCircuitTracking = true;
});

var app = builder.Build();

app.MapControllers();

app.Run();

Configuration Options

builder.Services.AddDinaupHealthCheck(options =>
{
    // Custom version string (defaults to entry assembly version)
    options.Version = "2.0.0.0";

    // Enable Blazor Server circuit tracking (default: false)
    options.EnableCircuitTracking = true;

    // Custom route (default: "/dinaupHealthCheck")
    options.Route = "/health";
});

Endpoint

Once configured, the health check endpoint is available at:

GET /dinaupHealthCheck

Response Example

{
  "version": "1.2.3.0",
  "environment": "Production",
  "hostname": "dinaup-web-01",
  "uptime": "3.14:22:05",
  "startedAt": "2025-01-11T08:30:00Z",
  "activeCircuits": 42,
  "memory": {
    "workingSetMb": 512,
    "gcHeapMb": 380,
    "gen0Collections": 150,
    "gen1Collections": 42,
    "gen2Collections": 5
  },
  "runtime": {
    "dotnetVersion": "9.0.0",
    "os": "Linux 6.1.0",
    "cpuCount": 4
  },
  "health": {
    "status": "Healthy",
    "totalDurationMs": 45.2,
    "checks": [
      {
        "name": "database",
        "status": "Healthy",
        "durationMs": 12.5,
        "description": "Database connection is healthy"
      },
      {
        "name": "redis",
        "status": "Healthy",
        "durationMs": 3.2
      }
    ]
  }
}

Note: The activeCircuits field is only included when EnableCircuitTracking is set to true.

Integration with ASP.NET Core Health Checks

The library automatically integrates with any registered ASP.NET Core health checks:

// Add your health checks
builder.Services.AddHealthChecks()
    .AddDbContextCheck<MyDbContext>("database")
    .AddRedis("redis-connection-string", name: "redis");

// Add Dinaup Health Check (will include all registered health checks)
builder.Services.AddDinaupHealthCheck();

Response Fields

Field Description
version Application version
environment Current environment (Production, Development, etc.)
hostname Server hostname
uptime Time since application start (format: d.hh:mm:ss)
startedAt UTC timestamp when application started
activeCircuits Number of active Blazor circuits (only if enabled)
memory.workingSetMb Process working set in MB
memory.gcHeapMb GC heap size in MB
memory.gen0Collections Number of Gen 0 garbage collections
memory.gen1Collections Number of Gen 1 garbage collections
memory.gen2Collections Number of Gen 2 garbage collections
runtime.dotnetVersion .NET runtime version
runtime.os Operating system description
runtime.cpuCount Number of available CPU cores
health.status Overall health status (Healthy, Degraded, Unhealthy)
health.totalDurationMs Total time for all health checks in ms
health.checks Array of individual health check results

HTTP Status Codes

  • 200 OK - All health checks passed (status is "Healthy")
  • 503 Service Unavailable - One or more health checks failed (status is "Degraded" or "Unhealthy")

License

MIT

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.
  • net10.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
1.0.1 188 1/14/2026
1.0.0 105 1/14/2026