Span handleStart(Req request, Span span) { if (span.isNoop()) return span; Scope ws = currentTraceContext.maybeScope(span.context()); try { parseRequest(request, span); } finally { ws.close(); } // all of the above parsing happened before a timestamp on the span return span.start(); }
void handleFinish(@Nullable Resp response, @Nullable Throwable error, Span span) { if (span.isNoop()) return; try { Scope ws = currentTraceContext.maybeScope(span.context()); try { parser.response(adapter, response, error, span.customizer()); } finally { ws.close(); // close the scope before finishing the span } } finally { finishInNullScope(span); } }