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);
}
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();
}
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);
}
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);
}
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);
}
Aggregations