Xabaril / AspNetCore.Diagnostics.HealthChecks

Enterprise HealthChecks for ASP.NET Core Diagnostics Package
Apache License 2.0
4.06k stars 793 forks source link

ConfigureUIApiEndpointResult isn't configurable #2167

Open clinington opened 7 months ago

clinington commented 7 months ago

What happened: Looking to configure the API endpoint result, but found I wasn't able to

What you expected to happen: I expected to be able to configure this:

https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/src/HealthChecks.UI/Configuration/Settings.cs#L9

Using the function in here:

https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/src/HealthChecks.UI/Extensions/ServiceCollectionExtensions.cs#L15-L42

I have a question to accompany this, the idea is that I can read that endpoint and ensure the status code correctly returns based on the health status (Healthy: 200, Unhealthy: 503, Degrade: 207... or something) - this is so I can drive an availability web test from the ping to the aggregated health endpoint...

Is that possible? reading the code, because of https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/master/src/HealthChecks.UI/Middleware/UIApiEndpointMiddleware.cs#L66-L68 I assumed that we could just inject our response codes in there....