Skip to content

Commit

Permalink
feat: export detailed health checks data
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicGD committed Jul 4, 2024
1 parent 96594f3 commit 842ba20
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,6 @@
<PackageVersion Include="AspNetCore.HealthChecks.Aws.S3" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.OpenIdConnectServer" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.Hangfire" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/Sitko.Core.App.Web/Sitko.Core.App.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PackageReference Include="Razor.Templating.Core"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson"/>
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis"/>
<PackageReference Include="AspNetCore.HealthChecks.UI.Client"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Sitko.Core.App\Sitko.Core.App.csproj"/>
Expand Down
9 changes: 7 additions & 2 deletions src/Sitko.Core.App.Web/WebApplicationBuilderExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Builder;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
Expand Down Expand Up @@ -69,7 +70,11 @@ public static WebApplication MapSitkoCore(this WebApplication webApplication)
}
}

webApplication.MapHealthChecks("/health/all");
webApplication.MapHealthChecks("/health/all",
new HealthCheckOptions
{
Predicate = _ => true, ResponseWriter = UIResponseWriter.WriteHealthCheckUIResponse
});
webApplication.MapHealthChecks("/health/startup",
new HealthCheckOptions
{
Expand Down

0 comments on commit 842ba20

Please sign in to comment.