Search in sources :

Example 6 with Shared

use of com.navercorp.pinpoint.profiler.context.id.Shared in project pinpoint by naver.

the class GrpcSpanMessageConverter method newAcceptEvent.

private PAcceptEvent newAcceptEvent(Span span) {
    PAcceptEvent.Builder builder = PAcceptEvent.newBuilder();
    builder.setRemoteAddr(span.getRemoteAddr());
    final Shared shared = span.getTraceRoot().getShared();
    builder.setRpc(shared.getRpcName());
    builder.setEndPoint(shared.getEndPoint());
    PParentInfo pParentInfo = newParentInfo(span);
    if (pParentInfo != null) {
        builder.setParentInfo(pParentInfo);
    }
    return builder.build();
}
Also used : PParentInfo(com.navercorp.pinpoint.grpc.trace.PParentInfo) PAcceptEvent(com.navercorp.pinpoint.grpc.trace.PAcceptEvent) Shared(com.navercorp.pinpoint.profiler.context.id.Shared)

Example 7 with Shared

use of com.navercorp.pinpoint.profiler.context.id.Shared in project pinpoint by naver.

the class SpanThriftMessageConverter method buildTSpan.

@VisibleForTesting
TSpan buildTSpan(Span span) {
    final TSpan tSpan = new TSpan();
    // tSpan.setVersion(span.getVersion());
    tSpan.setApplicationName(applicationName);
    tSpan.setAgentId(agentId);
    tSpan.setAgentStartTime(agentStartTime);
    tSpan.setApplicationServiceType(applicationServiceType);
    final TraceRoot traceRoot = span.getTraceRoot();
    final TraceId traceId = traceRoot.getTraceId();
    final ByteBuffer transactionId = transactionIdEncoder.encodeTransactionId(traceId);
    tSpan.setTransactionId(transactionId);
    tSpan.setSpanId(traceId.getSpanId());
    tSpan.setParentSpanId(traceId.getParentSpanId());
    tSpan.setStartTime(span.getStartTime());
    tSpan.setElapsed(span.getElapsedTime());
    tSpan.setServiceType(span.getServiceType());
    tSpan.setRemoteAddr(span.getRemoteAddr());
    final Shared shared = traceRoot.getShared();
    tSpan.setRpc(shared.getRpcName());
    tSpan.setEndPoint(shared.getEndPoint());
    tSpan.setFlag(traceId.getFlags());
    tSpan.setErr(shared.getErrorCode());
    tSpan.setParentApplicationName(span.getParentApplicationName());
    tSpan.setParentApplicationType(span.getParentApplicationType());
    tSpan.setAcceptorHost(span.getAcceptorHost());
    tSpan.setApiId(span.getApiId());
    final IntStringValue exceptionInfo = span.getExceptionInfo();
    if (exceptionInfo != null) {
        TIntStringValue tIntStringValue = buildTIntStringValue(exceptionInfo);
        tSpan.setExceptionInfo(tIntStringValue);
    }
    tSpan.setLoggingTransactionInfo(shared.getLoggingInfo());
    final List<Annotation<?>> annotations = span.getAnnotations();
    if (CollectionUtils.hasLength(annotations)) {
        final List<TAnnotation> tAnnotations = buildTAnnotation(annotations);
        tSpan.setAnnotations(tAnnotations);
    }
    spanPostProcessor.preProcess(span, tSpan);
    final List<SpanEvent> spanEventList = span.getSpanEventList();
    if (CollectionUtils.hasLength(spanEventList)) {
        final List<TSpanEvent> tSpanEvents = buildTSpanEventList(spanEventList);
        tSpan.setSpanEventList(tSpanEvents);
    }
    spanPostProcessor.postProcess(span, tSpan);
    return tSpan;
}
Also used : TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) Shared(com.navercorp.pinpoint.profiler.context.id.Shared) ByteBuffer(java.nio.ByteBuffer) TAnnotation(com.navercorp.pinpoint.thrift.dto.TAnnotation) Annotation(com.navercorp.pinpoint.profiler.context.Annotation) TAnnotation(com.navercorp.pinpoint.thrift.dto.TAnnotation) IntStringValue(com.navercorp.pinpoint.common.util.IntStringValue) TIntStringValue(com.navercorp.pinpoint.thrift.dto.TIntStringValue) SpanEvent(com.navercorp.pinpoint.profiler.context.SpanEvent) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) TSpan(com.navercorp.pinpoint.thrift.dto.TSpan) TraceId(com.navercorp.pinpoint.bootstrap.context.TraceId) TraceRoot(com.navercorp.pinpoint.profiler.context.id.TraceRoot) TSpanEvent(com.navercorp.pinpoint.thrift.dto.TSpanEvent) VisibleForTesting(com.navercorp.pinpoint.common.annotations.VisibleForTesting)

Aggregations

Shared (com.navercorp.pinpoint.profiler.context.id.Shared)7 SpanEvent (com.navercorp.pinpoint.profiler.context.SpanEvent)5 TraceRoot (com.navercorp.pinpoint.profiler.context.id.TraceRoot)5 TraceId (com.navercorp.pinpoint.bootstrap.context.TraceId)4 VisibleForTesting (com.navercorp.pinpoint.common.annotations.VisibleForTesting)4 IntStringValue (com.navercorp.pinpoint.common.util.IntStringValue)3 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)3 PAcceptEvent (com.navercorp.pinpoint.grpc.trace.PAcceptEvent)2 PSpanEvent (com.navercorp.pinpoint.grpc.trace.PSpanEvent)2 PTransactionId (com.navercorp.pinpoint.grpc.trace.PTransactionId)2 Annotation (com.navercorp.pinpoint.profiler.context.Annotation)2 AsyncSpanChunk (com.navercorp.pinpoint.profiler.context.AsyncSpanChunk)2 LocalAsyncId (com.navercorp.pinpoint.profiler.context.LocalAsyncId)2 TSpan (com.navercorp.pinpoint.thrift.dto.TSpan)2 ByteBuffer (java.nio.ByteBuffer)2 PAnnotation (com.navercorp.pinpoint.grpc.trace.PAnnotation)1 PIntStringValue (com.navercorp.pinpoint.grpc.trace.PIntStringValue)1 PLocalAsyncId (com.navercorp.pinpoint.grpc.trace.PLocalAsyncId)1 PParentInfo (com.navercorp.pinpoint.grpc.trace.PParentInfo)1 PSpan (com.navercorp.pinpoint.grpc.trace.PSpan)1