Lyo.Health
1.0.0
dotnet add package Lyo.Health --version 1.0.0
NuGet\Install-Package Lyo.Health -Version 1.0.0
<PackageReference Include="Lyo.Health" Version="1.0.0" />
<PackageVersion Include="Lyo.Health" Version="1.0.0" />
<PackageReference Include="Lyo.Health" />
paket add Lyo.Health --version 1.0.0
#r "nuget: Lyo.Health, 1.0.0"
#:package Lyo.Health@1.0.0
#addin nuget:?package=Lyo.Health&version=1.0.0
#tool nuget:?package=Lyo.Health&version=1.0.0
Lyo.Health
Interface for services that can report their health. Services implement IHealth and expose health directly—no central health service. Health returns HealthResult with status, timings, and optional metadata.
Examples
Usage
// 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();
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);
Contract
HealthCheckNameis a short identifier (e.g."filestorage","cache","rabbitmq","audit-postgres","change-tracker-postgres") used to label probe output in hosts.CheckHealthAsyncis the live probe; it should be cheap, short-circuiting, and honor the suppliedCancellationToken.
HealthResult
HealthResult is an immutable, sealed class that captures the outcome of a probe:
| Member | Type | Notes |
|---|---|---|
IsHealthy |
bool |
true for healthy, false for unhealthy. |
Duration |
TimeSpan |
How long the probe took (typically measured with Stopwatch). |
CheckedAt |
DateTime |
UTC instant the probe completed (set by the factory helpers). |
Message |
string? |
Optional human-readable summary; populated with the exception message on failure. |
Metadata |
IReadOnlyDictionary<string, object?>? |
Connection info, schema, version, key-id, etc. |
Exception |
Exception? |
Captured exception when the probe threw. |
Use the static factories rather than constructing directly:
Usage
Get health from the service directly: Service interfaces (IFileStorageService, ICacheService, IMqService) extend IHealth—health comes from the service, no separate registration. Hosts that need 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 | Versions 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. |
-
.NETStandard 2.0
- Lyo.Exceptions (>= 1.0.0)
-
net10.0
- Lyo.Exceptions (>= 1.0.0)
NuGet packages (18)
Showing the top 5 NuGet packages that depend on Lyo.Health:
| Package | Downloads |
|---|---|
|
Lyo.Cache
Cache service abstractions and local IMemoryCache implementation. |
|
|
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.Job.Scheduler
Job scheduling and execution service dispatching jobs via RabbitMQ message queue. |
|
|
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 |
|---|---|---|
| 1.0.0 | 148 | 8/16/2026 |