I would like to implement custom metric or statistics to my spring boot rest web service using actuator but i am not able to find simple tutorials. For example:
For point two the solution is to create an endpoint class (it can be or not a rest controller class). For example:
@Component
@RestControllerEndpoint(id = "pfm-statistics")
public class StatisticsEndpoint {
@GetMapping(value = "/", produces = "application/vnd.openxmlformats-
officedocument.spreadsheetml.sheet")
@ResponseBody
public byte[] generateStatisticsAsExcel() {
...
Note that the ID is the path to be called from URL. We can create a simple endpoint too and just return a string if we want. In this case instead of @RestControllerEndpoint annotation we can use @Endpoint, as a side note, the id should always contain dash