Include Ordering.BackgroundTasks in webstatus check
This commit is contained in:
parent
49ec9beff4
commit
794be31f53
@ -177,6 +177,7 @@ services:
|
||||
- ASPNETCORE_URLS=http://0.0.0.0:80
|
||||
- CatalogUrl=http://catalog.api/hc
|
||||
- OrderingUrl=http://ordering.api/hc
|
||||
- OrderingBackgroundTasksUrl=http://ordering.backgroundtasks/hc
|
||||
- BasketUrl=http://basket.api/hc
|
||||
- IdentityUrl=http://identity.api/hc
|
||||
- LocationsUrl=http://locations.api/hc
|
||||
|
@ -180,6 +180,7 @@ services:
|
||||
- ASPNETCORE_URLS=http://0.0.0.0:80
|
||||
- CatalogUrl=http://catalog.api/hc
|
||||
- OrderingUrl=http://ordering.api/hc
|
||||
- OrderingBackgroundTasksUrl=http://ordering.backgroundtasks/hc
|
||||
- BasketUrl=http://basket.api/hc
|
||||
- IdentityUrl=http://identity.api/hc
|
||||
- LocationsUrl=http://locations.api/hc
|
||||
|
@ -39,6 +39,7 @@ namespace WebStatus
|
||||
}
|
||||
|
||||
checks.AddUrlCheckIfNotNull(Configuration["OrderingUrl"], TimeSpan.FromMinutes(minutes));
|
||||
checks.AddUrlCheckIfNotNull(Configuration["OrderingBackgroundTasksUrl"], TimeSpan.FromMinutes(minutes));
|
||||
checks.AddUrlCheckIfNotNull(Configuration["BasketUrl"], TimeSpan.Zero); //No cache for this HealthCheck, better just for demos
|
||||
checks.AddUrlCheckIfNotNull(Configuration["CatalogUrl"], TimeSpan.FromMinutes(minutes));
|
||||
checks.AddUrlCheckIfNotNull(Configuration["IdentityUrl"], TimeSpan.FromMinutes(minutes));
|
||||
|
@ -1,13 +1,29 @@
|
||||
@model WebStatus.Viewmodels.HealthStatusViewModel
|
||||
@using Microsoft.AspNetCore.Html
|
||||
@using Microsoft.Extensions.HealthChecks
|
||||
@model WebStatus.Viewmodels.HealthStatusViewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "System Status";
|
||||
|
||||
}
|
||||
|
||||
@functions
|
||||
{
|
||||
static readonly string[] LabelClass = new[] { "default", "danger", "success", "warning" };
|
||||
|
||||
public HtmlString StatusLabel(CheckStatus status)
|
||||
{
|
||||
return new HtmlString($@"<span class=""label label-{LabelClass[(int) status]}"">{status}</span>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<style>.label {font-size: 100%}</style>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2 class="overall-status-title">Overall Status: @Model.OverallStatus</h2>
|
||||
<h2 class="overall-status-title">Overall Status: @StatusLabel(Model.OverallStatus)</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -15,33 +31,21 @@
|
||||
@foreach (var result in Model.Results)
|
||||
{
|
||||
<div class="row list-group-status-item">
|
||||
<div class="col-md-10">
|
||||
<div class="col-md-9">
|
||||
<h4 class="list-group-status-item-title">@result.Name</h4>
|
||||
<p class="list-group-item-text">
|
||||
@if (result.Result.Data.ContainsKey("url")) {
|
||||
<p>@result.Result.Data["url"]</p>
|
||||
@if (result.Result.Data.ContainsKey("url"))
|
||||
{
|
||||
<p>@result.Result.Data["url"]</p>
|
||||
}
|
||||
@result.Result.Description
|
||||
<p class="text-@(LabelClass[(int)result.Result.CheckStatus])" style="font-weight:bold">
|
||||
@result.Result.Description
|
||||
</p>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-2 list-group-status-item-label">
|
||||
@if (@result.Result.CheckStatus == Microsoft.Extensions.HealthChecks.CheckStatus.Healthy)
|
||||
{
|
||||
<span class="label label-success">@result.Result.CheckStatus</span>
|
||||
}
|
||||
else if (@result.Result.CheckStatus == Microsoft.Extensions.HealthChecks.CheckStatus.Unhealthy)
|
||||
{
|
||||
<span class="label label-danger">@result.Result.CheckStatus</span>
|
||||
}
|
||||
else if (@result.Result.CheckStatus == Microsoft.Extensions.HealthChecks.CheckStatus.Warning)
|
||||
{
|
||||
<span class="label label-warning">@result.Result.CheckStatus</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="label label-default">@result.Result.CheckStatus</span>
|
||||
}
|
||||
<div class="col-md-3">
|
||||
<h3>@StatusLabel(result.Result.CheckStatus)</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
@ -8,6 +8,7 @@
|
||||
}
|
||||
},
|
||||
"OrderingUrl": "http://localhost:5102/hc",
|
||||
"OrderingBackgroundTasksUrl": "http://localhost:5111/hc",
|
||||
"BasketUrl": "http://localhost:5103/hc",
|
||||
"CatalogUrl": "http://localhost:5101/hc",
|
||||
"IdentityUrl": "http://localhost:5105/hc",
|
||||
|
Loading…
x
Reference in New Issue
Block a user