AspNetCore.Diagnostics.HealthChecks icon indicating copy to clipboard operation
AspNetCore.Diagnostics.HealthChecks copied to clipboard

HealthChecks-UI Shows blank screen, error in console logged

Open ShvetsovZE opened this issue 2 years ago • 1 comments

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 image

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:

ShvetsovZE avatar Oct 09 '23 05:10 ShvetsovZE

Rel #1839

sungam3r avatar Dec 03 '23 21:12 sungam3r