Search in sources :

Example 56 with Kind

use of zipkin2.Span.Kind in project zipkin by openzipkin.

the class V1SpanConverterTest method convert_ma_incorrect_value.

// Following 3 tests show leniency for old versions of zipkin-ruby which serialized address binary
// annotations as "1" instead of true
@Test
public void convert_ma_incorrect_value() {
    V1Span v1 = V1Span.newBuilder().traceId(1L).id(2L).addAnnotation(1472470996199000L, "mr", BACKEND).addBinaryAnnotation("ma", "1", kafka).build();
    Span v2 = Span.newBuilder().traceId("1").id("2").kind(Kind.CONSUMER).timestamp(1472470996199000L).localEndpoint(BACKEND).remoteEndpoint(kafka).build();
    assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 57 with Kind

use of zipkin2.Span.Kind in project zipkin by openzipkin.

the class V1SpanConverterTest method convert_ca.

@Test
public void convert_ca() {
    V1Span v1 = V1Span.newBuilder().traceId(1L).id(2L).addAnnotation(1472470996199000L, "sr", BACKEND).addBinaryAnnotation("ca", FRONTEND).build();
    Span v2 = Span.newBuilder().traceId("1").id("2").kind(Kind.SERVER).timestamp(1472470996199000L).localEndpoint(BACKEND).remoteEndpoint(FRONTEND).shared(true).build();
    assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 58 with Kind

use of zipkin2.Span.Kind in project zipkin by openzipkin.

the class V1SpanConverterTest method convert_ca_incorrect_value.

@Test
public void convert_ca_incorrect_value() {
    V1Span v1 = V1Span.newBuilder().traceId(1L).id(2L).addAnnotation(1472470996199000L, "sr", BACKEND).addBinaryAnnotation("ca", "1", FRONTEND).build();
    Span v2 = Span.newBuilder().traceId("1").id("2").kind(Kind.SERVER).timestamp(1472470996199000L).localEndpoint(BACKEND).remoteEndpoint(FRONTEND).shared(true).build();
    assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 59 with Kind

use of zipkin2.Span.Kind in project zipkin by openzipkin.

the class SpanConverterTest method producer_remote.

@Test
public void producer_remote() {
    Span v2 = Span.newBuilder().traceId("1").parentId("2").id("3").name("send").kind(Kind.PRODUCER).localEndpoint(FRONTEND).remoteEndpoint(kafka).timestamp(1472470996199000L).build();
    V1Span v1 = V1Span.newBuilder().traceId(1L).parentId(2L).id(3L).name("send").timestamp(1472470996199000L).addAnnotation(1472470996199000L, "ms", FRONTEND).addBinaryAnnotation("ma", kafka).build();
    assertThat(v2SpanConverter.convert(v2)).usingRecursiveComparison().isEqualTo(v1);
    assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 60 with Kind

use of zipkin2.Span.Kind in project zipkin by openzipkin.

the class SpanConverterTest method producer_duration.

@Test
public void producer_duration() {
    Span v2 = Span.newBuilder().traceId("1").parentId("2").id("3").name("send").kind(Kind.PRODUCER).localEndpoint(FRONTEND).timestamp(1472470996199000L).duration(51000L).build();
    V1Span v1 = V1Span.newBuilder().traceId(1L).parentId(2L).id(3L).name("send").timestamp(1472470996199000L).duration(51000L).addAnnotation(1472470996199000L, "ms", FRONTEND).addAnnotation(1472470996250000L, "ws", FRONTEND).build();
    assertThat(v2SpanConverter.convert(v2)).usingRecursiveComparison().isEqualTo(v1);
    assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Aggregations

Span (zipkin2.Span)77 Test (org.junit.Test)54 Endpoint (zipkin2.Endpoint)28 Test (org.junit.jupiter.api.Test)17 V1Span (zipkin2.v1.V1Span)10 TraceSpan (com.google.devtools.cloudtrace.v1.TraceSpan)8 SpanSampler (com.wavefront.agent.sampler.SpanSampler)6 ByteBuf (io.netty.buffer.ByteBuf)6 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)6 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)6 IOException (java.io.IOException)6 Map (java.util.Map)6 Span (wavefront.report.Span)6 NoopHealthCheckManager (com.wavefront.agent.channel.NoopHealthCheckManager)5 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)5 TestObjects.newClientSpan (zipkin2.TestObjects.newClientSpan)5 Trace (com.google.devtools.cloudtrace.v1.Trace)4 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)4 Annotation (wavefront.report.Annotation)4 Annotation (zipkin2.Annotation)3