use of com.uber.jaeger.SpanContext in project cxf by apache.
the class OpenTracingTracingTest method testThatCurrentSpanIsAnnotatedWithKeyValue.
@Test
public void testThatCurrentSpanIsAnnotatedWithKeyValue() {
final SpanContext spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/book/1"), spanId).get();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(TestSender.getAllSpans().size(), equalTo(1));
assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("GET /bookstore/book/1"));
assertThat(TestSender.getAllSpans().get(0).getTags(), hasItem("book-id", "1"));
}
use of com.uber.jaeger.SpanContext in project cxf by apache.
the class OpenTracingTracingTest method testThatInnerSpanIsCreatedUsingPseudoAsyncInvocation.
@Test
public void testThatInnerSpanIsCreatedUsingPseudoAsyncInvocation() {
final SpanContext spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/books/pseudo-async"), spanId).get();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(TestSender.getAllSpans().size(), equalTo(2));
assertThat(TestSender.getAllSpans().get(1).getOperationName(), equalTo("GET /bookstore/books/pseudo-async"));
assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("Processing books"));
}
use of com.uber.jaeger.SpanContext in project cxf by apache.
the class OpenTracingTracingTest method testThatParallelSpanIsAnnotatedWithTimeline.
@Test
public void testThatParallelSpanIsAnnotatedWithTimeline() {
final SpanContext spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/process"), spanId).put("");
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(TestSender.getAllSpans().size(), equalTo(2));
assertThat(TestSender.getAllSpans(), hasSpan("Processing books", hasItem("Processing started")));
assertThat(TestSender.getAllSpans(), hasSpan("PUT /bookstore/process"));
}
use of com.uber.jaeger.SpanContext in project cxf by apache.
the class OpenTracingTracingTest method testThatNewInnerSpanIsCreatedUsingAsyncInvocation.
@Test
public void testThatNewInnerSpanIsCreatedUsingAsyncInvocation() {
final SpanContext spanId = fromRandom();
final Response r = withTrace(createWebClient("/bookstore/books/async"), spanId).get();
assertEquals(Status.OK.getStatusCode(), r.getStatus());
assertThat(TestSender.getAllSpans().size(), equalTo(2));
assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("GET /bookstore/books/async"));
assertThat(TestSender.getAllSpans().get(1).getOperationName(), equalTo("Processing books"));
assertThat(TestSender.getAllSpans().get(0).getReferences(), not(empty()));
assertThat(TestSender.getAllSpans().get(0).getReferences().get(0).getSpanContext().getSpanId(), equalTo(spanId.getSpanId()));
}
use of com.uber.jaeger.SpanContext in project cxf by apache.
the class OpenTracingTracingTest method testThatNewInnerSpanIsCreated.
@Test
public void testThatNewInnerSpanIsCreated() throws MalformedURLException {
final SpanContext spanId = fromRandom();
final Map<String, List<String>> headers = new HashMap<>();
tracer.inject(spanId, Builtin.HTTP_HEADERS, new TextMapInjectAdapter(headers));
final BookStoreService service = createJaxWsService(headers);
assertThat(service.getBooks().size(), equalTo(2));
assertThat(TestSender.getAllSpans().size(), equalTo(2));
assertThat(TestSender.getAllSpans().get(0).getOperationName(), equalTo("Get Books"));
assertThat(TestSender.getAllSpans().get(1).getOperationName(), equalTo("POST /BookStore"));
}
Aggregations