When would you use filter health checks?

Viewed 496
2 Answers

In the same page you shared, you can see the following:

Health probes can be used by container orchestrators and load balancers to check an app's status. For example, a container orchestrator may respond to a failing health check by halting a rolling deployment or restarting a container. A load balancer might react to an unhealthy app by routing traffic away from the failing instance to a healthy instance.

Use of memory, disk, and other physical server resources can be monitored for healthy status.

Health checks can test an app's dependencies, such as databases and external service endpoints, to confirm availability and normal functioning.

As you can see, there are multiple different types of health checks.

I can see two reasons:

  1. Different reporting purposes
  • Group items for specific monitoring client. One could be a systems division and one a database division
  1. Performance reasons
  • Assesing the health of the database might take time. You might need to raise these during the nighttime, while others every 5 minutes. Filtering will execute the proper ones.

There are multiple health check types that can be used. Most of them are mentioned in the link you provided. Some of the more popular ones include checking database connection or if an endpoint is available.

As for a real life situation:

I add my services to kubernetes. In case you don't know what kubernetes is think of it as guy that is keeping track of my service. Now in kubernetes you can specify the endpoints of your health checks so kubernetes can gather information to what the state of your application is. kubernetes can be configured to do specific operations in relations to the status of your healthchecks. For example kubernities asks for general healthcheck of your service. Lets say database connection and another service you communicate through endpoint. At some interval it gets a degraded(cant do what i need it to do) status because nothing is working. At that point I can precondition kubernities to shut down the service or restart it.

Now if you scale up the service to multiple services that communicate with each other and multiple databases. Then you can see how with kubernetes and healthchecks you can keep a good monitoring outlook of the entire system. As you can imagine the complexity of some of the health checks scales up also.

This is a real life situation that takes place today with healthchecks on micro service systems. Really helpful.

I hope this helps you :D

Related