SetNet.HealthChecks 1.1.0

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

<p align="center"> <img src="https://raw.githubusercontent.com/Povstalez/SetNet/master/assets/icon.png" alt="SetNet" width="96"> </p>

SetNet.HealthChecks

ASP.NET Core health check for a SetNet server.

Exposes a SetNet server's liveness and its active connection count through the standard IHealthCheck pipeline, so Kubernetes liveness/readiness probes, load balancers, and monitoring can watch the realtime server the same way they watch the rest of your app. Optionally reports Degraded once the connection count crosses a warning threshold, which a load balancer can use to shed new traffic before the node is saturated.

Designed to sit alongside SetNet.Hosting (which registers the server as a singleton you can resolve here).

Install

dotnet add package SetNet
dotnet add package SetNet.HealthChecks

Usage

using SetNet.HealthChecks;

builder.Services.AddHealthChecks()
    .AddSetNet(server, name: "setnet", degradedAtConnections: 4500);

// later, map the endpoint:
app.MapHealthChecks("/healthz");

When the server is registered in DI (e.g. via SetNet.Hosting), resolve the same instance:

builder.Services.AddHealthChecks()
    .Add(new HealthCheckRegistration(
        "setnet",
        sp => new SetNetHealthCheck(sp.GetRequiredService<BaseServer>(), degradedAtConnections: 4500),
        failureStatus: default,
        tags: default));

The check always attaches an activeConnections datum, so /healthz responses (with the detailed writer) carry the live count:

{
  "status": "Healthy",
  "entries": {
    "setnet": {
      "status": "Healthy",
      "description": "SetNet server healthy (128 active connections).",
      "data": { "activeConnections": 128 }
    }
  }
}

API

Member Purpose
IHealthChecksBuilder.AddSetNet(server, name = "setnet", degradedAtConnections = 0) Registers the check
SetNetHealthCheck(server, degradedAtConnections = 0) The IHealthCheck itself, if you register it manually

Result:

Condition Status Data
Always (unless degraded) Healthy activeConnections = current count
degradedAtConnections > 0 and ActiveConnections >= degradedAtConnections Degraded activeConnections = current count

Notes

  • Threshold is opt-in. degradedAtConnections = 0 (the default) means the check never reports Degraded — it only ever returns Healthy with the connection count.
  • Liveness, not deep health. The check reports Healthy as long as the server object is alive and reachable; it reflects BaseServer.ActiveConnections, not per-transport internals. Combine with SetNet.Inspector or NetworkMetrics for richer diagnostics.
  • The count comes from BaseServer.ActiveConnections, so it tracks whatever transports (TCP / UDP / Both) the server is running.

Documentation & source

License

MIT

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 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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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

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.1.0 136 7/2/2026