diff --git a/collector/src/main/java/com/navercorp/pinpoint/collector/receiver/grpc/service/SpanService.java b/collector/src/main/java/com/navercorp/pinpoint/collector/receiver/grpc/service/SpanService.java index ea3398c763d6..2b0ca758390b 100644 --- a/collector/src/main/java/com/navercorp/pinpoint/collector/receiver/grpc/service/SpanService.java +++ b/collector/src/main/java/com/navercorp/pinpoint/collector/receiver/grpc/service/SpanService.java @@ -20,6 +20,7 @@ import com.navercorp.pinpoint.grpc.MessageFormatUtils; import com.navercorp.pinpoint.grpc.StatusError; import com.navercorp.pinpoint.grpc.StatusErrors; +import com.navercorp.pinpoint.grpc.server.ServerContext; import com.navercorp.pinpoint.grpc.trace.PSpan; import com.navercorp.pinpoint.grpc.trace.PSpanChunk; import com.navercorp.pinpoint.grpc.trace.PSpanMessage; @@ -82,16 +83,21 @@ public void onNext(PSpanMessage spanMessage) { @Override public void onError(Throwable throwable) { + com.navercorp.pinpoint.grpc.Header header = ServerContext.getAgentInfo(); + final StatusError statusError = StatusErrors.throwable(throwable); if (statusError.isSimpleError()) { - logger.info("Failed to span stream, cause={}", statusError.getMessage()); + logger.info("Failed to span stream, {} cause={}", header, statusError.getMessage(), statusError.getThrowable()); } else { - logger.warn("Failed to span stream, cause={}", statusError.getMessage(), statusError.getThrowable()); + logger.warn("Failed to span stream, {} cause={}", header, statusError.getMessage(), statusError.getThrowable()); } } @Override public void onCompleted() { + com.navercorp.pinpoint.grpc.Header header = ServerContext.getAgentInfo(); + logger.info("onCompleted {}", header); + Empty empty = Empty.newBuilder().build(); responseObserver.onNext(empty); responseObserver.onCompleted();