Observe Filter Start and Stop

Issue gh-11911
This commit is contained in:
Josh Cummings 2022-11-17 15:09:11 -07:00
parent 9d876fce82
commit 24860d9fb0
No known key found for this signature in database
GPG Key ID: A306A51F43B8E5A5
1 changed files with 2 additions and 0 deletions

View File

@ -181,12 +181,14 @@ public final class ObservationFilterChainDecorator implements FilterChainProxy.F
parentBefore.setChainSize(this.size);
parentBefore.setFilterName(this.name);
parentBefore.setChainPosition(this.position);
parent.before().event(Observation.Event.of(this.name + " before"));
this.filter.doFilter(request, response, chain);
parent.start();
FilterChainObservationContext parentAfter = (FilterChainObservationContext) parent.after().getContext();
parentAfter.setChainSize(this.size);
parentAfter.setFilterName(this.name);
parentAfter.setChainPosition(this.size - this.position + 1);
parent.after().event(Observation.Event.of(this.name + " after"));
}
private AroundFilterObservation parent(HttpServletRequest request) {