Skip to content
Discussion options

You must be logged in to vote

There is currently no shared “current health state” in the built-in implementation. The endpoint and the publisher are intentionally separate executions.

The health-check middleware calls HealthCheckService.CheckHealthAsync for every request:
https://github.com/dotnet/aspnetcore/blob/main/src/Middleware/HealthChecks/src/HealthCheckMiddleware.cs#L47-L72

The publisher hosted service independently calls CheckHealthAsync on its timer and then passes that report to every registered IHealthCheckPublisher:
https://github.com/dotnet/aspnetcore/blob/main/src/HealthChecks/HealthChecks/src/HealthCheckPublisherHostedService.cs#L146-L178

The IHealthCheckPublisher documentation also explicitly says tha…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lkurzyniec
Comment options

Answer selected by lkurzyniec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
area-healthchecks Includes: Healthchecks (some bugs also in Extensions repo)
2 participants