Search in sources :

Example 1 with Span

use of com.google.devtools.cloudtrace.v2.Span in project brave by openzipkin.

the class ITSpanCustomizingAsyncHandlerInterceptor method addsControllerTags.

@Test
public void addsControllerTags() throws Exception {
    get("/foo");
    Span span = takeSpan();
    assertThat(span.tags()).containsEntry("mvc.controller.class", "TestController").containsEntry("mvc.controller.method", "foo");
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 2 with Span

use of com.google.devtools.cloudtrace.v2.Span in project brave by openzipkin.

the class ITTracingAsyncHandlerInterceptor method tagsHandler.

@Test
public void tagsHandler() throws Exception {
    get("/foo");
    Span span = takeSpan();
    assertThat(span.tags()).containsEntry("mvc.controller.class", "TestController").containsEntry("mvc.controller.method", "foo");
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 3 with Span

use of com.google.devtools.cloudtrace.v2.Span in project brave by openzipkin.

the class ITTracingHandlerInterceptor method tagsHandler.

@Test
public void tagsHandler() throws Exception {
    get("/foo");
    Span span = takeSpan();
    assertThat(span.tags()).containsEntry("mvc.controller.class", "TestController").containsEntry("mvc.controller.method", "foo");
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 4 with Span

use of com.google.devtools.cloudtrace.v2.Span in project brave by openzipkin.

the class ITTracingFilter_Consumer method onTransportException_addsErrorTag.

@Test
public void onTransportException_addsErrorTag() throws Exception {
    server.stop();
    try {
        client.get().sayHello("jorge");
        failBecauseExceptionWasNotThrown(RpcException.class);
    } catch (RpcException e) {
    }
    Span span = spans.take();
    assertThat(span.tags().get("error")).contains("RemotingException");
}
Also used : RpcException(com.alibaba.dubbo.rpc.RpcException) Span(zipkin2.Span) Test(org.junit.Test)

Example 5 with Span

use of com.google.devtools.cloudtrace.v2.Span in project brave by openzipkin.

the class ITTracingFilter_Consumer method defaultSpanNameIsMethodName.

@Test
public void defaultSpanNameIsMethodName() throws Exception {
    client.get().sayHello("jorge");
    Span span = spans.take();
    assertThat(span.name()).isEqualTo("greeterservice/sayhello");
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Aggregations

Span (zipkin2.Span)290 Test (org.junit.Test)192 Test (org.junit.jupiter.api.Test)67 TestObjects.newClientSpan (zipkin2.TestObjects.newClientSpan)41 Endpoint (zipkin2.Endpoint)37 ArrayList (java.util.ArrayList)24 V1Span (zipkin2.v1.V1Span)17 List (java.util.List)14 AggregateCall (zipkin2.internal.AggregateCall)13 TraceSpan (com.google.devtools.cloudtrace.v1.TraceSpan)12 Arrays.asList (java.util.Arrays.asList)9 Map (java.util.Map)9 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)9 Span (com.google.devtools.cloudtrace.v2.Span)8 LinkedHashMap (java.util.LinkedHashMap)8 Trace (com.google.devtools.cloudtrace.v1.Trace)7 Span (zipkin2.proto3.Span)7 SpanData (io.opencensus.trace.export.SpanData)6 SpanCustomizer (brave.SpanCustomizer)5 IOException (java.io.IOException)5