0

Right now, I have a REST API built in SpringBoot. I also have a SpringBoot actuator to monitor the health of the app. I have some healthcheck services that either return an empty response with status code 200 or an error if one occurs. Now I would like to also be able to get the response time of the service together (or at least separately somehow) with the status. I can already see it in "/actuator/httptrace/" in the following form:

response: { status: 200, ... } timeTaken: 107 

So ideally, I would like to be able to get exactly the same thing when I make a request to the api endpoint (just the code and timeTaken). Any help would be appreciated.

1

1 Answer 1

2

Spring Boot provides metrics for you that will give you this information. There's no need to do it manually.

See the documentation here:

https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-metrics-spring-mvc

Sign up to request clarification or add additional context in comments.

1 Comment

Please do add a brief summary from the link just in case the link is altered or broken.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.