Search in sources :

Example 36 with SpanRecorder

use of com.navercorp.pinpoint.bootstrap.context.SpanRecorder in project pinpoint by naver.

the class ApacheDubboProviderInterceptor method createTrace.

@Override
protected Trace createTrace(Object target, Object[] args) {
    final Trace trace = readRequestTrace(target, args);
    if (trace.canSampled()) {
        final SpanRecorder recorder = trace.getSpanRecorder();
        // You have to record a service type within Server range.
        recorder.recordServiceType(ApacheDubboConstants.DUBBO_PROVIDER_SERVICE_TYPE);
        recorder.recordApi(DUBBO_PROVIDER_METHOD_DESCRIPTOR);
        recordRequest(recorder, target, args);
    }
    return trace;
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) SpanRecorder(com.navercorp.pinpoint.bootstrap.context.SpanRecorder)

Example 37 with SpanRecorder

use of com.navercorp.pinpoint.bootstrap.context.SpanRecorder in project pinpoint by naver.

the class ServerStreamCreatedInterceptor method createTrace.

private Trace createTrace(final GrpcServerStreamRequest request) {
    Trace trace = requestTraceReader.read(request);
    if (trace.canSampled()) {
        SpanRecorder spanRecorder = trace.getSpanRecorder();
        spanRecorder.recordServiceType(GrpcConstants.SERVER_SERVICE_TYPE);
        spanRecorder.recordApi(GRPC_SERVER_CALL_METHOD_DESCRIPTOR);
        this.serverRequestRecorder.record(spanRecorder, request);
    }
    return trace;
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) SpanRecorder(com.navercorp.pinpoint.bootstrap.context.SpanRecorder)

Example 38 with SpanRecorder

use of com.navercorp.pinpoint.bootstrap.context.SpanRecorder in project pinpoint by naver.

the class PeriodicSchedulerTaskRunMethodInterceptor method createTrace.

@Override
public Trace createTrace(Object target, Object[] args) {
    if (AsyncContextAccessorUtils.getAsyncContext(target) == null) {
        return null;
    }
    final Trace trace = traceContext.newTraceObject();
    if (trace.canSampled()) {
        final SpanRecorder recorder = trace.getSpanRecorder();
        // You have to record a service type within Server range.
        recorder.recordServiceType(ReactorConstants.REACTOR_SCHEDULER);
        recorder.recordApi(REACTOR_PERIODIC_SCHEDULER_METHOD_DESCRIPTOR);
        recorder.recordRemoteAddress("LOCAL");
        recorder.recordRpcName("/schedulePeriodically");
        recorder.recordEndPoint("/");
    }
    return trace;
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) SpanRecorder(com.navercorp.pinpoint.bootstrap.context.SpanRecorder)

Aggregations

SpanRecorder (com.navercorp.pinpoint.bootstrap.context.SpanRecorder)38 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)23 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)10 Test (org.junit.Test)10 WrappedSpanEventRecorder (com.navercorp.pinpoint.profiler.context.recorder.WrappedSpanEventRecorder)8 Storage (com.navercorp.pinpoint.profiler.context.storage.Storage)8 TraceRoot (com.navercorp.pinpoint.profiler.context.id.TraceRoot)6 TraceContext (com.navercorp.pinpoint.bootstrap.context.TraceContext)4 TraceSampler (com.navercorp.pinpoint.bootstrap.sampler.TraceSampler)4 ActiveTraceHandle (com.navercorp.pinpoint.profiler.context.active.ActiveTraceHandle)4 DefaultSpanRecorder (com.navercorp.pinpoint.profiler.context.recorder.DefaultSpanRecorder)4 Span (com.navercorp.pinpoint.profiler.context.Span)3 DefaultTraceId (com.navercorp.pinpoint.profiler.context.id.DefaultTraceId)3 AsyncState (com.navercorp.pinpoint.bootstrap.context.AsyncState)2 SpanEventRecorder (com.navercorp.pinpoint.bootstrap.context.SpanEventRecorder)2 DefaultTraceRoot (com.navercorp.pinpoint.profiler.context.id.DefaultTraceRoot)2 ListenableAsyncState (com.navercorp.pinpoint.profiler.context.id.ListenableAsyncState)2 AMQP (com.rabbitmq.client.AMQP)2 AMQConnection (com.rabbitmq.client.impl.AMQConnection)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2