Has anyone encountered the need to log a response from springboot acutator? I want to use a springboot admin server that will query applications and log the response of each /health request to the application and write it in database.
I googled my problem, but I didn't find anything.
Admin server have url to application
can i get this url from admin server to make rest request?
It is possible to log the response from Spring Boot Actuator endpoints, including the /health endpoint, and then write it to a database using a Spring Boot Admin Server. Spring Boot Actuator provides several endpoints that allow you to monitor and manage your application, and the /health endpoint is one of them, used to check the health status of your application.
In the above example, you have set up the Spring Boot Admin Server. Now you need to configure the client applications to be monitored.
Now, customize the /health response by implementing a custom health indicator:
Finally, in the Spring Boot Admin Server application, implement the logic to query the /health endpoint of the monitored applications and log the responses: