use of com.navercorp.pinpoint.bootstrap.context.AsyncContext in project pinpoint by naver.
the class MQExternalClientHandlerInterceptor method before.
@Override
public void before(Object target, Object[] args) {
final AsyncContext asyncContext = getAsyncContext(args);
if (asyncContext == null) {
return;
}
final Trace trace = getAsyncTrace(asyncContext);
if (trace == null) {
return;
}
if (isDebug) {
logger.beforeInterceptor(target, args);
}
// entry scope.
entryAsyncTraceScope(trace);
try {
// trace event for default & async.
final SpanEventRecorder recorder = trace.traceBlockBegin();
recorder.recordServiceType(ServiceType.INTERNAL_METHOD);
recorder.recordApi(methodDescriptor);
} catch (Throwable th) {
if (logger.isWarnEnabled()) {
logger.warn("BEFORE. Caused:{}", th.getMessage(), th);
}
}
}
use of com.navercorp.pinpoint.bootstrap.context.AsyncContext in project pinpoint by naver.
the class ContextImplRunOnContextInterceptor method doInBeforeTrace.
@Override
protected void doInBeforeTrace(SpanEventRecorder recorder, Object target, Object[] args) {
recorder.recordServiceType(VertxConstants.VERTX_INTERNAL);
if (validate(args)) {
// make asynchronous trace-id
final AsyncContext asyncContext = recorder.recordNextAsyncContext();
((AsyncContextAccessor) args[0])._$PINPOINT$_setAsyncContext(asyncContext);
if (isDebug) {
logger.debug("Set asyncContext {}", asyncContext);
}
}
}
use of com.navercorp.pinpoint.bootstrap.context.AsyncContext in project pinpoint by naver.
the class AsyncContextSpanEventEndPointInterceptor method before.
@Override
public void before(Object target, Object[] args) {
if (isDebug) {
logger.beforeInterceptor(target, args);
}
final AsyncContext asyncContext = getAsyncContext(target);
if (asyncContext == null) {
logger.debug("AsyncContext not found");
return;
}
final Trace trace = getAsyncTrace(asyncContext);
if (trace == null) {
return;
}
if (isDebug) {
logger.debug("Asynchronous invocation. asyncTraceId={}, trace={}", asyncContext, trace);
}
// entry scope.
entryAsyncTraceScope(trace);
try {
// trace event for default & async.
final SpanEventRecorder recorder = trace.traceBlockBegin();
doInBeforeTrace(recorder, asyncContext, target, args);
} catch (Throwable th) {
if (logger.isWarnEnabled()) {
logger.warn("BEFORE. Caused:{}", th.getMessage(), th);
}
}
}
Aggregations