From the course: ASP.NET Core: Health Checks and Logging

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding health checks

Adding health checks - ASP.NET Core Tutorial

From the course: ASP.NET Core: Health Checks and Logging

Start my 1-month free trial

Adding health checks

- [Instructor] How do we add our own custom logic to those health checks because so far the health check hasn't really been that impressive. Well, we have our services.AddHealthChecks call and what we can do there is we can add individual checks and there are different ways of doing it. I'll show you the most, let's say direct one. I add a check by providing a name which is nice later if we have specific output of those checks and then we have the implementations. This is really the easiest implementation I could think of that fits on a slide, just use a random number and if it's even then the application is healthy and if not, it's degraded. Let's try this out. Here we go. This is the AddHealthChecks call and that's where add check comes in. So my random health check and then the implementation will be that if new random number is even then we return health check result which comes from…

Contents