aspnet / Diagnostics

[Archived] Diagnostics middleware for reporting info and handling exceptions and errors in ASP.NET Core, and diagnosing Entity Framework Core migrations errors. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
213 stars 111 forks source link

Redesign HealthStatus (again) #520

Closed rynowak closed 5 years ago

rynowak commented 5 years ago

This change brings back the ability to return Healthy/Degraded/Unhealthy in a HealthCheckResult. We tried making this pass/fail in 2.2.0-preview3 and folks writing health checks for their own use pointed out (rightly so) that it was too limited.

It's still possible for the app developer to configure the failure status of a health check, but it requires the health check author to cooperate.

I also got rid of HealthStatus.Failed since it raises more questions than it answers. It's really not clear that it's valuable for a health check for behave different when throwing an unhandled exception.

We would still recommend that a health check library handle exceptions that they know about and return context.Registration.FailureStatus.

rynowak commented 5 years ago

/cc @unaizorrilla

unaizorrilla commented 5 years ago

Hi @rynowak

I try to adapt all HealthChecks / UI to this new HealthCheckResult status soon!

unaizorrilla commented 5 years ago

Hi @rynowak

Committed HealthStatus re-design on AspNetcore.Diagnostics.HealthChecks repo.

https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/commit/051947206d4837608de92f84c02979515868a5ce

Versions 2.2.0-rtm-35613 on MyGet right now.