use of io.opencensus.proto.trace.v1.Span in project zipkin by openzipkin.
the class BulkIndexWriterTest method spanSearchFields_addsTimestampFieldWhenNoTags.
@Test
public void spanSearchFields_addsTimestampFieldWhenNoTags() {
Span span = Span.newBuilder().traceId("20").id("22").name("").parentId("21").timestamp(1000L).localEndpoint(FRONTEND).kind(Kind.CLIENT).build();
BulkIndexWriter.SPAN.writeDocument(span, buffer);
assertThat(buffer.buffer().toString(StandardCharsets.UTF_8)).startsWith("{\"timestamp_millis\":1,\"traceId\":");
}
use of io.opencensus.proto.trace.v1.Span in project zipkin by openzipkin.
the class BulkIndexWriterTest method spanSearchFields_addsQueryFieldForTags.
@Test
public void spanSearchFields_addsQueryFieldForTags() {
Span span = Span.newBuilder().traceId("20").id("22").parentId("21").localEndpoint(FRONTEND).putTag("\"foo", "\"bar").build();
BulkIndexWriter.SPAN.writeDocument(span, buffer);
assertThat(buffer.buffer().toString(StandardCharsets.UTF_8)).startsWith("{\"_q\":[\"\\\"foo\",\"\\\"foo=\\\"bar\"],\"traceId");
}
use of io.opencensus.proto.trace.v1.Span in project zipkin by openzipkin.
the class BulkIndexWriterTest method spanSearchFields_readableByNormalJsonCodec.
@Test
public void spanSearchFields_readableByNormalJsonCodec() {
Span span = Span.newBuilder().traceId("20").id("20").name("get").timestamp(TODAY * 1000).build();
BulkIndexWriter.SPAN.writeDocument(span, buffer);
assertThat(SpanBytesDecoder.JSON_V2.decodeOne(ByteBufUtil.getBytes(buffer.buffer()))).isEqualTo(// ignores timestamp_millis field
span);
}
use of io.opencensus.proto.trace.v1.Span in project zipkin by openzipkin.
the class BulkIndexWriterTest method spanSearchFields_addsQueryFieldForAnnotations.
@Test
public void spanSearchFields_addsQueryFieldForAnnotations() {
Span span = Span.newBuilder().traceId("20").id("22").name("").parentId("21").localEndpoint(FRONTEND).addAnnotation(1L, "\"foo").build();
BulkIndexWriter.SPAN.writeDocument(span, buffer);
assertThat(buffer.buffer().toString(StandardCharsets.UTF_8)).startsWith("{\"_q\":[\"\\\"foo\"],\"traceId");
}
use of io.opencensus.proto.trace.v1.Span in project zipkin by openzipkin.
the class CassandraSpanConsumerTest method serviceSpanKeys.
@Test
public void serviceSpanKeys() {
Span span = spanWithoutAnnotationsOrTags;
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()));
}
Aggregations