FilterChain chain) throws IOException, ServletException {
TeeHttpServletResponse resp = new TeeHttpServletResponse(
(HttpServletResponse) response);
chain.doFilter(request, resp);
Status status = Status.fromStatusCode(resp.getStatus());
if (status.getFamily() == Status.Family.SUCCESSFUL) {
eventSinkProvider.get().sendEvents();
}
else {
log.debug("Request failed, skipping event sending, status={}", status);
}