Open chivandikwa opened 1 week ago
Ok, so finally found a working answer
services
.AddHealthChecksUI(opt =>
{
opt.AddHealthCheckEndpoint("API", "/api/health");
})
.AddInMemoryStorage();
services
.AddHealthChecks()
.AddApplicationStatus(name: "Application Status")
...
app.UseHealthChecks("/api/health", new HealthCheckOptions
{
Predicate = _ => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
app.UseEndpoints(endpoints =>
{
endpoints.MapHealthChecksUI(opt =>
{
opt.UIPath = "/healthcheck-ui";
});
});
EDIT - Resolved
Not clear how to consume the UI
What happened:
I am unable to setup the health check UI and even after browsing open and closed issues, the answer is not clear.
I have health checks setup in my startup, sample
I then setup the UI as documented
The same for the rest of the bootstrapping
Now if I leave the default for MapHealthChecksUI, the UI is empty even though /healthz returns data formatted for the UI.
If I then update the Api URL to point to /healthz then I get a console error saying map is not a function and nothing is loaded in the UI again.
What is the correct way to configure the UI
What you expected to happen:
To be able to get the UI to show the health checks.
Thanks for looking into this
Environment: