/** * Handles outgoing request. * * @param adapter The adapter deals with implementation specific details. */ public void handle(ClientRequestAdapter adapter) { SpanId spanId = clientTracer.startNewSpan(adapter.getSpanName()); if (spanId == null) { // We will not trace this request. adapter.addSpanIdToRequest(null); } else { adapter.addSpanIdToRequest(spanId); for (KeyValueAnnotation annotation : adapter.requestAnnotations()) { clientTracer.submitBinaryAnnotation(annotation.getKey(), annotation.getValue()); } recordClientSentAnnotations(adapter.serverAddress()); } }
/** * Handles outgoing request. * * @param adapter The adapter deals with implementation specific details. */ public void handle(ClientRequestAdapter adapter) { SpanId context = clientTracer.startNewSpan(adapter.getSpanName()); if (context == null) { // We will not trace this request. adapter.addSpanIdToRequest(null); } else { adapter.addSpanIdToRequest(context); for (KeyValueAnnotation annotation : adapter.requestAnnotations()) { clientTracer.submitBinaryAnnotation(annotation.getKey(), annotation.getValue()); } recordClientSentAnnotations(adapter.serverAddress()); } }