Description
Is your feature request related to a problem? Please describe.
I am trying to use the Microsoft.Extensions.Diagnostics.HealthChecks
library in a project but I don't want to register the default HealthCheckPublisherHostedService
which is automatically registered when the AddHealthChecks
extension method is used. I still would like to use the DefaultHealthCheckService
and the HealthChecksBuilder
which unfortunately are all marked as internal
which means that I would have to implement them again in my code.
What I want to do is running my health checks manually with the help of the DefaultHealthCheckService
inside of an Orleans cluster. The reason why I don't want to register the HealthCheckPublisherHostedService
is that it would execute and publish all health checks on each node periodically which is unnecessary.
Describe the solution you'd like
I would like a method similar to AddHealthChecks
or a parameter for AddHealthChecks
to control if the HealthCheckPublisherHostedService
gets registered or not.
Additional context
The corresponding code which registers the HealthCheckPublisherHostedService
can be found here: