ejacobg / eShopOnContainers

A reference project for when I forget how to do something.
MIT License
0 stars 0 forks source link

Import `HealthCheckOptions`? #3

Closed ejacobg closed 2 months ago

ejacobg commented 2 months ago

This comes from the Microsoft.Extensions.Diagnostics.HealthChecks package.

Related reading: https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/monitor-app-health

ejacobg commented 2 months ago

Remember to also install the AspNetCore.HealthChecks.SqlServer package from AspNetCore.Diagnostics.HealthChecks.

var hcBuilder = services.AddHealthChecks();

hcBuilder
    .AddSqlServer(
        configuration["ConnectionString"],
        name: "CatalogDB-check",
        tags: new string[] { "catalogdb" });
ejacobg commented 2 months ago

The diagnostics package actually contains health checks for several services. We need to install a few more packages: