private void deleteUserIncludeTrace(final Trace trace) { if (isDebug) { logger.debug("Delete user include trace={}, sampled={}", trace, trace.canSampled()); } traceContext.removeTraceObject(); trace.close(); }
@Override public void after(Object target, Object[] args, Object result, Throwable throwable) { if (isDebug) { logger.afterInterceptor(target, args, result, throwable); } // Unset server markers if (args[0] instanceof AsyncFrameBuffer) { AsyncFrameBuffer frameBuffer = (AsyncFrameBuffer) args[0]; attachMarkersToInputProtocol(frameBuffer.getInputProtocol(), false); } final Trace trace = this.traceContext.currentRawTraceObject(); if (trace == null) { return; } this.traceContext.removeTraceObject(); if (trace.canSampled()) { try { processTraceObject(trace, target, args, throwable); } catch (Throwable t) { logger.warn("Error processing trace object. Cause:{}", t.getMessage(), t); } finally { trace.close(); } } }
@Override public void after(Object target, Object result, Throwable throwable, Object[] args) { super.after(target, result, throwable, args); // End async trace block final Trace trace = super.traceContext.currentTraceObject(); // shouldn't be null if (trace == null) { return; } if (trace.isAsync() && trace.isRootStack()) { trace.close(); super.traceContext.removeTraceObject(); } }
@Override public void after(Object target, Object[] args, Object result, Throwable throwable) { final Trace trace = this.traceContext.currentRawTraceObject(); if (trace == null) { return; } // logging here as some Thrift servers depend on TTransportException being thrown for normal // operations. // log only when current transaction is being traced. if (isDebug) { logger.afterInterceptor(target, args, result, throwable); } this.traceContext.removeTraceObject(); if (trace.canSampled()) { try { processTraceObject(trace, target, args, throwable); } catch (Throwable t) { logger.warn("Error processing trace object. Cause:{}", t.getMessage(), t); } finally { trace.close(); } } }