AspNetCore.Diagnostics.HealthChecks
AspNetCore.Diagnostics.HealthChecks copied to clipboard
HealthChecks-UI Shows blank screen, error in console logged
What happened: Setup HealthChecksUI in NET 7 project
What you expected to happen: View Healthcheck status through UI.
How to reproduce it (as minimally and precisely as possible):
Navigate to the /health-ui/ page
App then navigates to /health-ui#/healthchecks
See API Call retrieve status from /healthz/ successfully.
Check the error in the browser console
Source code sample:
app.UseEndpoints(
endpoints =>
{
endpoints.MapHealthChecks("/health", new HealthCheckOptions
{
ResultStatusCodes =
{
[HealthStatus.Healthy] = StatusCodes.Status200OK,
[HealthStatus.Degraded] = StatusCodes.Status200OK,
[HealthStatus.Unhealthy] = StatusCodes.Status503ServiceUnavailable
},
});
endpoints.MapHealthChecks("/healthz", new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
endpoints.MapControllers();
});
app.UseResponseCaching();
app.UseHealthChecksUI(config =>
{
config.UIPath = "/health-ui";
config.ApiPath = "/healthz";
config.AsideMenuOpened = false;
});
Anything else we need to know?: it's a copy of https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/issues/774, the difference is looks like my API paths are different for general health check call and for the UI. Response from /healthz could be found below
{
"status": "Healthy",
"totalDuration": "00:00:00.1139819",
"entries": {
"azure_cosmosdb": {
"data": {
},
"duration": "00:00:00.1131929",
"status": "Healthy",
"tags": [
]
}
}
}
Environment:
- .NET version 7
- Healthchecks version - 7.0.2
- Operative system: windows
- Others:
Rel #1839