protected void sendSpans(List<zipkin.Span> spanList) { try { sendSpans(Codec.JSON.writeSpans(spanList)); } catch (IOException e) { Set<String> affectedTraceIds = new HashSet<>(spanList.size()); for (zipkin.Span span : spanList) { affectedTraceIds.add(String.valueOf(span.traceId)); } logger.error("An error occurred attempting to post Zipkin spans to the Zipkin server. affected_trace_ids={}, exception_cause=\"{}\"", affectedTraceIds.toString(), e.toString()); } }
protected void sendSpans(List<zipkin.Span> spanList) { try { sendSpans(Codec.JSON.writeSpans(spanList)); } catch (IOException e) { Set<String> affectedTraceIds = new HashSet<>(spanList.size()); for (zipkin.Span span : spanList) { affectedTraceIds.add(String.valueOf(span.traceId)); } logger.error("An error occurred attempting to post Zipkin spans to the Zipkin server. affected_trace_ids={}, exception_cause=\"{}\"", affectedTraceIds.toString(), e.toString()); } }
@Test public void sendSpans_with_span_list_delegates_to_sendSpans_with_byte_array() throws IOException { // given List<zipkin.Span> zipkinSpans = new ArrayList<>(); for (int i = 0; i < 10; i++) { zipkinSpans.add(zipkinSpan(random.nextLong(), UUID.randomUUID().toString())); } byte[] expectedBytesPayload = Codec.JSON.writeSpans(zipkinSpans); // when implSpy.sendSpans(zipkinSpans); // then verify(implSpy).sendSpans(expectedBytesPayload); }
sentSpans.add(zipkinSpan(random.nextLong(), UUID.randomUUID().toString())); long expectedUncompressedPayloadSize = Codec.JSON.writeSpans(sentSpans).length;