fix: Sometimes requests are not logged when api response time is not correct
fix gravitee-io/issues#2644
@@ -200,8 +200,11 @@ public class ApiReactorHandler extends AbstractReactorHandler implements Initial
private void handleError(ExecutionContext context, ProcessorFailure failure) {
+ if (context.request().metrics().getApiResponseTimeMs() > 0) {
+ context.request().metrics().setApiResponseTimeMs(System.currentTimeMillis() -
+ context.request().metrics().getApiResponseTimeMs());
+ }
context.setAttribute(ExecutionContext.ATTR_PREFIX + "failure", failure);
-
errorProcessorChain
.create()
.handler(__ -> handler.handle(context))
