Below is my endpoint.
@Path("/data")
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Timed("rest.request.timer")
public Multi<***> getData(***) {
\\ app logic
return x;
}
Micrometer by default times the HTTP requests and http_server_requests_seconds_sum is giving the right value for how long it takes to respond to a request.
I have added custom metric on the method with @Timed annotation, I am expecting the value of this metric to be same as that of http_server_requests_seconds_sum
, but they are not same.
I have also tried recording the time taken without annotation like below , still the values are not same. Any clue why they not same ?
Timer timer = Timer.builder("rest.request.timer").register(Metrics.globalRegistry);
public Uni<***> getData(* request) throws IOException
{
return this.timer.record(()-> {
return serviceObject.get();
});
}
```