use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method traceByServiceSpan_indexesLocalServiceNameAndEmptySpanName.
/**
* To allow lookups w/o a span name, we index "". "" is used instead of null to avoid creating
* tombstones.
*/
@Test
public void traceByServiceSpan_indexesLocalServiceNameAndEmptySpanName() {
Span span = spanWithoutAnnotationsOrTags;
AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
assertThat(call.delegate()).filteredOn(c -> c instanceof InsertTraceByServiceSpan).extracting("input.service", "input.span").containsExactly(tuple(FRONTEND.serviceName(), span.name()), tuple(FRONTEND.serviceName(), ""));
}
use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method strictTraceIdFalse_setsTraceIdHigh.
@Test
public void strictTraceIdFalse_setsTraceIdHigh() {
consumer = spanConsumer(CassandraStorage.newBuilder().strictTraceId(false));
Span span = spanWithoutAnnotationsOrTags.toBuilder().traceId("77fcac3d4c5be8d2a037812820c65f28").build();
AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
assertThat(call.delegate()).filteredOn(c -> c instanceof InsertSpan).extracting("input.trace_id_high", "input.trace_id").containsExactly(tuple("77fcac3d4c5be8d2", "a037812820c65f28"));
}
use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method doesntSetTraceIdHigh_128.
@Test
public void doesntSetTraceIdHigh_128() {
Span span = spanWithoutAnnotationsOrTags.toBuilder().traceId("77fcac3d4c5be8d2a037812820c65f28").build();
AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
assertThat(call.delegate()).filteredOn(c -> c instanceof InsertSpan).extracting("input.trace_id_high", "input.trace_id").containsExactly(tuple(null, span.traceId()));
}
use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method serviceRemoteServiceKeys_addsRemoteServiceName.
@Test
public void serviceRemoteServiceKeys_addsRemoteServiceName() {
Span span = spanWithoutAnnotationsOrTags.toBuilder().remoteEndpoint(BACKEND).build();
AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
assertThat(call.delegate()).filteredOn(c -> c instanceof InsertEntry).extracting("input").containsExactly(entry(FRONTEND.serviceName(), span.name()), entry(FRONTEND.serviceName(), BACKEND.serviceName()));
}
use of zipkin2.internal.AggregateCall in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method traceByServiceSpan_skipsOnNoTimestamp.
@Test
public void traceByServiceSpan_skipsOnNoTimestamp() {
Span span = spanWithoutAnnotationsOrTags.toBuilder().timestamp(null).build();
AggregateCall<?, Void> call = (AggregateCall<?, Void>) consumer.accept(singletonList(span));
assertThat(call.delegate()).filteredOn(c -> c instanceof InsertTraceByServiceSpan).extracting("input.service", "input.span").isEmpty();
}
Aggregations