Counter Metrics for Rest Api’s in SpringBoot

What would be the best approach to count how many times an API is being triggered with its successful/failure response in spring boot.

What I have in my mind is using a post construct to start a new thread when application comes up and when an api is being called and then using a counter service for each new unique request to count how many api’s is being triggered by that particular request and how many of them are successful or failed.

Recommend some new approaches if you guys have any.