Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java web application health check good practices [closed]

I have a Java web app running (with Spring) and I wish to have a health check performed every few minutes. I'm not checking the Tomcat or the JVM but strictly on the application level so I have a few ideas for stuff to check.

For example:

  • make a simple query to check DB sanity
  • check that the environment is "production" (cause that's the only one that'll be monitored)

Basically I'm looking for other ideas and suggestions for what to check or some best practices for it.

Any ideas?

like image 240
levtatarov Avatar asked Feb 12 '13 09:02

levtatarov


People also ask

Which mechanism will be used to keep a check on the health of a server?

Health checks are a way of asking a service on a particular server whether or not it is capable of performing work successfully. Load balancers ask each server this question periodically to determine which servers it is safe to direct traffic to.

How would you monitor the health status of a Microservice?

To monitor the availability of your microservices, orchestrators like Kubernetes and Service Fabric periodically perform health checks by sending requests to test the microservices. When an orchestrator determines that a service/container is unhealthy, it stops routing requests to that instance.

What should a health check endpoint return?

The health check API must return the operational status of the component and its ability to connect to the downstream components that it depends on. An advanced health check API can be extended to return performance information, such as connection times.


2 Answers

I'd recommend to try Metrics Framework

like image 105
yegor256 Avatar answered Sep 22 '22 21:09

yegor256


We have developed a special URL that accesses a spring mvc controller that tests various aspects of our application. You just need to return a 500 if your find anything wrong and give that url link to your favorite monitoring tool. We use both pingdom and nagios at our facility.

https://www.pingdom.com/

http://nagios.org/

like image 44
Francois Lacoursiere Avatar answered Sep 24 '22 21:09

Francois Lacoursiere