use of io.opencensus.proto.trace.v1.Span in project zipkin by openzipkin.
the class ZipkinRuleTest method getTraces_whenMissingTimestamps.
/**
* The rule is here to help debugging. Even partial spans should be returned
*/
@Test
public void getTraces_whenMissingTimestamps() throws IOException {
Span span = Span.newBuilder().traceId("1").id("1").name("foo").build();
// write the span to the zipkin using http
assertThat(postSpansV1(asList(span)).code()).isEqualTo(202);
// read the traces directly
assertThat(zipkin.getTraces()).containsOnly(asList(span));
}
use of io.opencensus.proto.trace.v1.Span 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 io.opencensus.proto.trace.v1.Span 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 io.opencensus.proto.trace.v1.Span in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method serviceSpanKeys_emptyWhenNoEndpoints.
@Test
public void serviceSpanKeys_emptyWhenNoEndpoints() {
Span span = spanWithoutAnnotationsOrTags.toBuilder().localEndpoint(null).build();
assertThat(consumer.accept(singletonList(span))).isInstanceOf(ResultSetFutureCall.class);
}
use of io.opencensus.proto.trace.v1.Span 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()));
}
Aggregations