use of zipkin2.storage.SpanConsumer in project zipkin by openzipkin.
the class ScribeSpanConsumerTest method entriesWithoutSpansAreSkipped.
@Test
void entriesWithoutSpansAreSkipped() throws Exception {
SpanConsumer consumer = (callback) -> {
// as we shouldn't get here.
throw new AssertionError();
};
ScribeSpanConsumer scribe = newScribeSpanConsumer("zipkin", consumer);
LogEntry entry = new LogEntry();
entry.category = "notzipkin";
entry.message = "hello world";
expectSuccess(scribe, entry);
// Storage finishes after callback so wait for it.
await().untilAsserted(() -> assertThat(scribeMetrics.messages()).isEqualTo(1));
assertThat(scribeMetrics.messagesDropped()).isZero();
assertThat(scribeMetrics.bytes()).isZero();
assertThat(scribeMetrics.spans()).isZero();
assertThat(scribeMetrics.spansDropped()).isZero();
}
use of zipkin2.storage.SpanConsumer 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.storage.SpanConsumer in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method searchDisabled_doesntIndex.
@Test
public void searchDisabled_doesntIndex() {
consumer = spanConsumer(CassandraStorage.newBuilder().searchEnabled(false));
Span span = spanWithoutAnnotationsOrTags.toBuilder().addAnnotation(TODAY * 1000L, "annotation").putTag("foo", "bar").duration(10000L).build();
assertThat(consumer.accept(singletonList(span))).extracting("input.annotation_query").satisfies(q -> assertThat(q).isNull());
}
Aggregations