Search in sources :

Example 41 with FRONTEND

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

the class SpanConverterTest method lateRemoteEndpoint_cr.

@Test
public void lateRemoteEndpoint_cr() {
    Span v2 = Span.newBuilder().traceId("1").parentId("2").id("3").name("get").kind(Kind.CLIENT).localEndpoint(FRONTEND).remoteEndpoint(BACKEND).addAnnotation(1472470996199000L, "cr").build();
    V1Span v1 = V1Span.newBuilder().traceId(1L).parentId(2L).id(3L).name("get").addAnnotation(1472470996199000L, "cr", FRONTEND).addBinaryAnnotation("sa", 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 42 with FRONTEND

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

the class SpanConverterTest method lateRemoteEndpoint_ca.

/**
 * Late flushed data on a v1 v1
 */
@Test
public void lateRemoteEndpoint_ca() {
    Span v2 = Span.newBuilder().traceId("1").id("2").kind(Kind.SERVER).remoteEndpoint(FRONTEND).build();
    V1Span v1 = V1Span.newBuilder().traceId(1L).id(2L).addBinaryAnnotation("ca", FRONTEND).build();
    assertThat(v2SpanConverter.convert(v2)).usingRecursiveComparison().isEqualTo(v1);
    assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 43 with FRONTEND

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

the class SpanConverterTest method redundantAddressAnnotations_client.

/**
 * Intentionally create service loopback endpoints as dependency linker can correct it later if
 * incorrect, provided the server is instrumented.
 */
@Test
public void redundantAddressAnnotations_client() {
    Span v2 = Span.newBuilder().traceId("1").parentId("2").id("3").kind(Kind.CLIENT).name("get").localEndpoint(FRONTEND).remoteEndpoint(FRONTEND).timestamp(1472470996199000L).duration(207000L).build();
    V1Span v1 = V1Span.newBuilder().traceId(1L).parentId(2L).id(3L).name("get").timestamp(1472470996199000L).duration(207000L).addAnnotation(1472470996199000L, "cs", FRONTEND).addAnnotation(1472470996406000L, "cr", FRONTEND).addBinaryAnnotation("ca", FRONTEND).addBinaryAnnotation("sa", FRONTEND).build();
    assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 44 with FRONTEND

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

the class SpanConverterTest method client_kindInferredFromAnnotation.

@Test
public void client_kindInferredFromAnnotation() {
    Span v2 = Span.newBuilder().traceId("1").parentId("2").id("3").name("get").localEndpoint(FRONTEND).timestamp(1472470996199000L).duration(1472470996238000L - 1472470996199000L).addAnnotation(1472470996199000L, "cs").build();
    V1Span v1 = V1Span.newBuilder().traceId(1L).parentId(2L).id(3L).name("get").timestamp(1472470996199000L).duration(1472470996238000L - 1472470996199000L).addAnnotation(1472470996199000L, "cs", FRONTEND).addAnnotation(1472470996238000L, "cr", FRONTEND).build();
    assertThat(v2SpanConverter.convert(v2)).usingRecursiveComparison().isEqualTo(v1);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 45 with FRONTEND

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

the class BulkIndexWriterTest method spanSearchFields_skipsWhenNoData.

@Test
public void spanSearchFields_skipsWhenNoData() {
    Span span = Span.newBuilder().traceId("20").id("22").parentId("21").timestamp(0L).localEndpoint(FRONTEND).kind(Kind.CLIENT).build();
    BulkIndexWriter.SPAN.writeDocument(span, buffer);
    assertThat(buffer.buffer().toString(StandardCharsets.UTF_8)).startsWith("{\"traceId\":\"");
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Aggregations

Span (zipkin2.Span)50 Test (org.junit.Test)35 Endpoint (zipkin2.Endpoint)21 Test (org.junit.jupiter.api.Test)17 V1Span (zipkin2.v1.V1Span)12 TestObjects.newClientSpan (zipkin2.TestObjects.newClientSpan)6 NoopHealthCheckManager (com.wavefront.agent.channel.NoopHealthCheckManager)4 SpanSampler (com.wavefront.agent.sampler.SpanSampler)4 ByteBuf (io.netty.buffer.ByteBuf)4 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)4 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)4 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)4 Span (wavefront.report.Span)4 SpanBytesEncoder (zipkin2.codec.SpanBytesEncoder)4 Annotation (wavefront.report.Annotation)3 DurationSampler (com.wavefront.sdk.entities.tracing.sampling.DurationSampler)2 RateSampler (com.wavefront.sdk.entities.tracing.sampling.RateSampler)2 ArrayList (java.util.ArrayList)2 Arrays.asList (java.util.Arrays.asList)2 List (java.util.List)2