Search in sources :

Example 11 with BACKEND

use of zipkin2.TestObjects.BACKEND in project zipkin by openzipkin.

the class SpanConverterTest method producerAndConsumer.

/**
 * shared v1 IDs for messaging spans isn't supported, but shouldn't break
 */
@Test
public void producerAndConsumer() {
    V1Span v1 = V1Span.newBuilder().traceId(1L).parentId(2L).id(3L).name("whatev").addAnnotation(1472470996199000L, "ms", FRONTEND).addAnnotation(1472470996238000L, "ws", FRONTEND).addAnnotation(1472470996403000L, "wr", BACKEND).addAnnotation(1472470996406000L, "mr", BACKEND).addBinaryAnnotation("ma", kafka).build();
    Span.Builder newBuilder = Span.newBuilder().traceId("1").parentId("2").id("3").name("whatev");
    Span producer = newBuilder.clone().kind(Kind.PRODUCER).localEndpoint(FRONTEND).remoteEndpoint(kafka).timestamp(1472470996199000L).duration(1472470996238000L - 1472470996199000L).build();
    Span consumer = newBuilder.clone().kind(Kind.CONSUMER).shared(true).localEndpoint(BACKEND).remoteEndpoint(kafka).timestamp(1472470996403000L).duration(1472470996406000L - 1472470996403000L).build();
    assertThat(v1SpanConverter.convert(v1)).containsExactly(producer, consumer);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 12 with BACKEND

use of zipkin2.TestObjects.BACKEND in project zipkin by openzipkin.

the class SpanConverterTest method consumer.

@Test
public void consumer() {
    Span v2 = Span.newBuilder().traceId("1").parentId("2").id("3").name("next-message").kind(Kind.CONSUMER).localEndpoint(BACKEND).timestamp(1472470996199000L).build();
    V1Span v1 = V1Span.newBuilder().traceId(1L).parentId(2L).id(3L).name("next-message").timestamp(1472470996199000L).addAnnotation(1472470996199000L, "mr", BACKEND).build();
    assertThat(v2SpanConverter.convert(v2)).usingRecursiveComparison().isEqualTo(v1);
    assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 13 with BACKEND

use of zipkin2.TestObjects.BACKEND in project zipkin by openzipkin.

the class V1SpanConverterTest method convert_sa_incorrect_value.

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

Example 14 with BACKEND

use of zipkin2.TestObjects.BACKEND in project zipkin by openzipkin.

the class V1SpanConverterTest method convert_ma.

@Test
public void convert_ma() {
    V1Span v1 = V1Span.newBuilder().traceId(1L).id(2L).addAnnotation(1472470996199000L, "mr", BACKEND).addBinaryAnnotation("ma", 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 15 with BACKEND

use of zipkin2.TestObjects.BACKEND in project zipkin by openzipkin.

the class V1SpanConverterTest method convert_sa.

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

Aggregations

Span (zipkin2.Span)48 Test (org.junit.Test)31 Endpoint (zipkin2.Endpoint)17 Test (org.junit.jupiter.api.Test)16 V1Span (zipkin2.v1.V1Span)13 TestObjects.newClientSpan (zipkin2.TestObjects.newClientSpan)4 Call (zipkin2.Call)3 AggregateCall (zipkin2.internal.AggregateCall)3 InsertEntry (zipkin2.storage.cassandra.internal.call.InsertEntry)3 ArrayList (java.util.ArrayList)2 Arrays.asList (java.util.Arrays.asList)2 List (java.util.List)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 TraceSpan (com.google.devtools.cloudtrace.v1.TraceSpan)1 NoopHealthCheckManager (com.wavefront.agent.channel.NoopHealthCheckManager)1 SpanSampler (com.wavefront.agent.sampler.SpanSampler)1 RateSampler (com.wavefront.sdk.entities.tracing.sampling.RateSampler)1 ByteBuf (io.netty.buffer.ByteBuf)1 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)1