I want to configure healthcheckers to work with HealthChecksUI. But the HealthChecksUI page display a empty list of configured HealthChecks.
Here is code from ConfigureServices Method:
services.AddHealthChecksUI();
services.AddHealthChecks()
//.AddAzureTableStorage(Configuration["AzureTableStorage"])
.AddAzureServiceBusQueue(Configuration["NServiceBusParameters"], "CAPIMSPurchaseAPI")
.AddAzureServiceBusTopic(Configuration["NServiceBusParameters"], "CAPIMSPurchaseAPI")
.AddCheck("self", c => { return HealthCheckResult.Healthy(); })
.AddCheck<MailerHealthCheck>("mailer")
.AddDocumentDb(c =>
{
c.UriEndpoint = Configuration["xxxxx"];
c.PrimaryKey = Configuration["yyyyy"];
});
here is the code from Configure Method:
app.UseHealthChecks("/health", new Microsoft.AspNetCore.Diagnostics.HealthChecks.HealthCheckOptions
{
Predicate = registration => true,
ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
}
);
app.UseHealthChecksUI();
Here is the json configuration for HealthChecks-UI:
"HealthChecks-UI": {
"HealthChecks": [
{
"Name": "HTTP-Api-Basic",
"Uri": "http://localhost:4020/health"
}
],
"Webhooks": [
{
"Name": "",
"Uri": "",
"Payload": "",
"RestoredPayload": ""
}
],
"EvaluationTimeOnSeconds": 10,
"MinimumSecondsBetweenFailureNotifications": 60
}
When I access the link /health, it show the following result:
{"status":"Healthy",
"totalDuration":"00:00:02.1671415",
"entries":{
"azurequeue":{
"data":{
},
"duration":"00:00:01.0486138",
"status":"Healthy"
},
"azuretopic":{
"data":{
},
"duration":"00:00:00.1572862",
"status":"Healthy"
},
"self":{
"data":{
},
"duration":"00:00:00.0001244",
"status":"Healthy"
},
"mailer":{
"data":{
},
"duration":"00:00:00.1451047",
"status":"Healthy"
},
"documentdb":{
"data":{
},
"duration":"00:00:00.8158108",
"status":"Healthy"
}
}
}
Anyway, the healthcheckers-ui link show an empty list:
What I observed as well is that the healthchecksdb tables are empty. So it can be that there is a problem with configurations of healthcheckers