use of com.uber.jaeger.SpanContext in project cxf by apache.
the class OpenTracingTracingTest method testThatOuterSpanIsCreatedUsingAsyncInvocation.
@Test
public void testThatOuterSpanIsCreatedUsingAsyncInvocation() {
final SpanContext spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/books/async/notrace"), spanId).get();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(TestSender.getAllSpans().size(), equalTo(1));
assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("GET /bookstore/books/async/notrace"));
}
use of com.uber.jaeger.SpanContext in project cxf by apache.
the class OpenTracingTracingTest method testThatNewInnerSpanIsCreated.
@Test
public void testThatNewInnerSpanIsCreated() {
final SpanContext spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/books"), spanId).get();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(TestSender.getAllSpans().size(), equalTo(2));
assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("Get Books"));
assertThat(TestSender.getAllSpans().get(1).getOperationName(), equalTo("GET /bookstore/books"));
}
use of com.uber.jaeger.SpanContext in project jaeger-client-java by jaegertracing.
the class B3TextMapCodecTest method testExtract_childSpan.
@Test
public void testExtract_childSpan() throws Exception {
SpanId spanId = SpanId.builder().spanId(2L).traceId(1L).parentId(1L).build();
TextMap textMap = makeRequestWithSpanId(spanId);
SpanContext context = b3Codec.extract(textMap);
assertEquals(1, context.getTraceId());
assertEquals(1, context.getParentId());
assertEquals(2, context.getSpanId());
// sampled
assertEquals(1, context.getFlags());
}
use of com.uber.jaeger.SpanContext in project jaeger-client-java by jaegertracing.
the class B3TextMapCodecTest method testInject_unsampled.
@Test
public void testInject_unsampled() throws Exception {
DelegatingTextMap textMap = new DelegatingTextMap();
b3Codec.inject(new SpanContext(1, 1, 0, (byte) 0), textMap);
TraceData data = takeRequestFromTextMap(textMap);
assertEquals(Boolean.FALSE, data.getSample());
}
use of com.uber.jaeger.SpanContext in project jaeger-client-java by jaegertracing.
the class B3TextMapCodecTest method testExtract_rootSpan.
@Test
public void testExtract_rootSpan() throws Exception {
SpanId spanId = SpanId.builder().spanId(1L).traceId(1L).parentId(null).build();
TextMap textMap = makeRequestWithSpanId(spanId);
SpanContext context = b3Codec.extract(textMap);
assertEquals(1, context.getTraceId());
// parentID==0 means root span
assertEquals(0, context.getParentId());
assertEquals(1, context.getSpanId());
// sampled
assertEquals(1, context.getFlags());
}
Aggregations