Add Wolverine.HealthChecks for ASP.NET Core IHealthCheck integration (CritterWatch#73)#2687
Merged
jeremydmiller merged 1 commit intomainfrom May 7, 2026
Merged
Conversation
Introduces a new thin extension package WolverineFx.HealthChecks that
plugs Wolverine into the standard Microsoft.Extensions.Diagnostics
health-check pipeline.
API:
services.AddHealthChecks()
.AddWolverine() // bus health: started + not cancelling
.AddWolverineListeners(); // listener health: Accepting/TooBusy/...
Both extensions accept the conventional name/tags/failureStatus/timeout
parameters so operators can split Kubernetes liveness vs. readiness
probes and alias checks however they like. AddWolverineListeners also
takes an optional Func<IListeningAgent,bool> filter for scoping a check
to a subset of listeners (e.g. by URI scheme).
Listener status mapping:
- all Accepting -> Healthy
- any TooBusy/GloballyLatched -> Degraded
- all Stopped -> Unhealthy
Per-listener counts and a URI-keyed status map are exposed via
HealthCheckResult.Data so dashboards can render detail without a
second probe.
Per-broker connectivity checks (RabbitMQ / Azure Service Bus / etc.)
are intentionally out of scope here.
Includes 13 tests (NSubstitute unit tests + an in-process TestServer
integration test that exercises the registered checks via /health).
Adds a docs page under docs/guide/health-checks.md and wires it into
the sidebar.
Refs CritterWatch#73.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new thin extension package,
WolverineFx.HealthChecks, that plugs Wolverine into the standard ASP.NET Corehealth-check pipeline. Two checks ship in the box:
WolverineBusHealthCheck— Healthy when the runtime has finished starting and the runtime cancellation token has not been signalled.HealthCheckResult.DataexposesserviceName,uniqueNodeId,started,cancellationRequested.WolverineListenerHealthCheck— WalksIWolverineRuntime.Endpoints.ActiveListeners()and reports:Healthy— all listenersAcceptingDegraded— any listenerTooBusyorGloballyLatchedUnhealthy— all listenersStoppedHealthCheckResult.Dataso dashboards can render detail without a second probe.API shape
Conventional
IHealthChecksBuilderextensions (mirrorsMicrosoft.Extensions.Diagnostics.HealthChecks+ community packages):Both extensions accept
name/failureStatus/tags/timeout.AddWolverineListenersalso takes an optionalFunc<IListeningAgent, bool>filter for scoping a check to a subset of listeners — useful when you want a separate readiness probe per transport.Out of scope
Per-broker connectivity health checks (RabbitMQ, Azure Service Bus, Kafka, etc.) are deliberately not part of this PR — they live with each transport package and will be addressed by transport-specific helpers (tracked separately under CritterWatch#70).
Implementation notes
src/Wolverine.HealthChecks/. It depends only onWolverinecore +Microsoft.Extensions.Diagnostics.HealthChecks(.Abstractions). Microsoft.Extensions.* health-check packages are real dependencies, so we did not fold these checks into Wolverine.Http where they would weigh down every Wolverine.Http consumer.Directory.Packages.propsagainst the existing TFM-conditional Microsoft.Extensions.* version ranges.wolverine.slnx.wolverine_slim.slnxis unchanged.docs/guide/health-checks.mdand wired into the VitePress sidebar next to the existing Diagnostics page.Test plan
IWolverineRuntimesubstitute cover started / not-started / cancellation-requested for the bus check, and Healthy / Degraded / Unhealthy / scope-filter cases for the listener check (NSubstitute, already a dev dependency).Microsoft.AspNetCore.TestHosthost with.AddWolverine().AddWolverineListeners()and asserts/health,/health/live,/health/readyall return 200.dotnet build wolverine.slnx— clean (0 errors).dotnet test src/Wolverine.HealthChecks.Tests/Wolverine.HealthChecks.Tests.csproj— 13/13 passing.Refs CritterWatch#73.