public void destroyed(REQ request, final Throwable throwable, final int statusCode) {
        if (isDebug) {
            // An error may occur when the request variable is output to the log.
            logger.debug("Destroyed requestEvent. throwable={}, statusCode={}", throwable, statusCode);
        }

        final Trace trace = this.traceContext.currentRawTraceObject();
        if (trace == null) {
            return;
        }

        try {
            this.httpStatusCodeRecorder.record(trace.getSpanRecorder(), statusCode);
            final SpanEventRecorder recorder = trace.currentSpanEventRecorder();
            if (trace.canSampled()) {
                recorder.recordException(throwable);
                // Must be executed in destroyed()
                this.parameterRecorder.record(recorder, request, throwable);
            }
        } finally {
            trace.traceBlockEnd();
            this.traceContext.removeTraceObject();
            trace.close();
        }
    }
@param request    request
@param throwable  error
@param statusCode status code
agent-module/bootstraps/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/plugin/request/ServletRequestListener.java