Lyo.Health 2.0.0

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

Lyo.Health

Contract for services that report their own health. Implement IHealth. There is no central health service. A check returns HealthResult with status, timings, and optional metadata.

Examples

How to use it

// File storage
var fileStorage = app.Services.GetRequiredService<IFileStorageService>();
var result = await fileStorage.CheckHealthAsync();
// result.IsHealthy, result.Duration, result.Metadata, result.Message

// Cache
var cache = app.Services.GetRequiredService<ICacheService>();
var result = await cache.CheckHealthAsync();

// RabbitMQ
var mq = app.Services.GetRequiredService<IMqService>();
var result = await mq.CheckHealthAsync();

The contract

public interface IHealth
{
    string HealthCheckName { get; }
    Task<HealthResult> CheckHealthAsync(CancellationToken ct = default);
}

HealthResult

HealthResult.Healthy(sw.Elapsed, message: null, metadata: new Dictionary<string, object?> { ["database"] = "audit" });
HealthResult.Unhealthy(sw.Elapsed, "Database connection failed", metadata: null, exception: ex);

The contract

  • Hosts label probe output with HealthCheckName, a short identifier, for example "filestorage", "cache", "rabbitmq", "audit-postgres", "change-tracker-postgres".
  • The live probe is CheckHealthAsync. Keep it cheap and short-circuiting, and honor the supplied CancellationToken.

HealthResult

A probe outcome is an immutable, sealed HealthResult:

Member Type Notes
IsHealthy bool true when healthy, false when not.
Duration TimeSpan Elapsed probe time (usually from Stopwatch).
CheckedAt DateTime UTC instant the probe finished (set by the factory helpers).
Message string? Optional human-readable summary; filled with the exception message on failure.
Metadata IReadOnlyDictionary<string, object?>? Schema, version, connection info, key-id, and similar.
Exception Exception? Exception captured when the probe threw.

Prefer the static factories over constructing the type yourself:

How to use it

Ask the service for health directly. Service interfaces (IFileStorageService, ICacheService, IMqService) extend IHealth. Health comes from the service. No separate registration. Hosts that want an aggregate view typically resolve IEnumerable<IHealth> and fan out CheckHealthAsync in parallel, then publish the resulting HealthResult collection.

Dependencies

Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).

  • Lyo.Exceptions (direct, lyo)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (19)

Showing the top 5 NuGet packages that depend on Lyo.Health:

Package Downloads
Lyo.Cache

Cache service abstractions and local IMemoryCache implementation.

Lyo.Postgres

Shared PostgreSQL infrastructure for Lyo libraries: schema-scoped DbContext registration, startup migrations, design-time factory helpers, and connectivity health checks.

Lyo.MessageQueue

Message queue service interface and base implementation for asynchronous messaging.

Lyo.FileStorage

File storage service interface and base implementation for file operations.

Lyo.FileMetadataStore.Postgres

PostgreSQL implementation of the Lyo FileMetadataStore service using Entity Framework Core.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 334 9/9/2026
1.0.13 978 8/25/2026
1.0.11 1,156 8/23/2026
1.0.9 1,249 8/22/2026
1.0.6 1,670 8/20/2026
1.0.4 1,530 8/20/2026
1.0.3 1,114 8/19/2026
1.0.2 1,178 8/19/2026
1.0.1 1,069 8/18/2026
1.0.0 686 8/16/2026