Search in sources :

Example 91 with Span

use of io.opentelemetry.proto.trace.v1.Span in project zipkin by openzipkin.

the class StrictTraceIdTest method filterTraces_skipsOnNoClash.

@Test
public void filterTraces_skipsOnNoClash() {
    Span oneOne = Span.newBuilder().traceId(1, 1).id(1).build();
    Span oneTwo = Span.newBuilder().traceId(1, 2).id(1).build();
    List<List<Span>> traces = asList(asList(oneOne), asList(oneTwo));
    assertThat(StrictTraceId.filterTraces(requestBuilder().spanName("11").build()).map(traces)).isSameAs(traces);
}
Also used : List(java.util.List) Arrays.asList(java.util.Arrays.asList) ArrayList(java.util.ArrayList) Span(zipkin2.Span) Test(org.junit.Test)

Example 92 with Span

use of io.opentelemetry.proto.trace.v1.Span in project zipkin by openzipkin.

the class StrictTraceIdTest method hasClashOnLowerTraceId.

@Test
public void hasClashOnLowerTraceId() {
    Span oneOne = Span.newBuilder().traceId(1, 1).id(1).build();
    Span twoOne = Span.newBuilder().traceId(2, 1).id(1).build();
    Span zeroOne = Span.newBuilder().traceId(0, 1).id(1).build();
    Span oneTwo = Span.newBuilder().traceId(1, 2).id(1).build();
    assertThat(StrictTraceId.hasClashOnLowerTraceId(asList(asList(oneOne), asList(oneTwo)))).isFalse();
    assertThat(StrictTraceId.hasClashOnLowerTraceId(asList(asList(oneOne), asList(twoOne)))).isTrue();
    assertThat(StrictTraceId.hasClashOnLowerTraceId(asList(asList(oneOne), asList(zeroOne)))).isTrue();
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 93 with Span

use of io.opentelemetry.proto.trace.v1.Span 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 94 with Span

use of io.opentelemetry.proto.trace.v1.Span 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 95 with Span

use of io.opentelemetry.proto.trace.v1.Span 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)335 Test (org.junit.Test)237 Test (org.junit.jupiter.api.Test)84 ArrayList (java.util.ArrayList)47 Endpoint (zipkin2.Endpoint)43 TestObjects.newClientSpan (zipkin2.TestObjects.newClientSpan)41 Span (io.opentelemetry.proto.trace.v1.Span)35 List (java.util.List)23 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)20 V1Span (zipkin2.v1.V1Span)17 Span (com.google.devtools.cloudtrace.v2.Span)16 Map (java.util.Map)14 AggregateCall (zipkin2.internal.AggregateCall)13 ResourceSpans (io.opentelemetry.proto.trace.v1.ResourceSpans)11 Arrays.asList (java.util.Arrays.asList)11 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)11 Annotation (wavefront.report.Annotation)11 Trace (com.google.devtools.cloudtrace.v1.Trace)10 TraceSpan (com.google.devtools.cloudtrace.v1.TraceSpan)10 AttributeValue (com.google.devtools.cloudtrace.v2.AttributeValue)10