Search in sources :

Example 41 with Span

use of io.opentelemetry.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()));
}
Also used : AggregateCall(zipkin2.internal.AggregateCall) Span(zipkin2.Span) Test(org.junit.Test)

Example 42 with Span

use of io.opentelemetry.proto.trace.v1.Span 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()));
}
Also used : AggregateCall(zipkin2.internal.AggregateCall) InsertEntry(zipkin2.storage.cassandra.internal.call.InsertEntry) Span(zipkin2.Span) Test(org.junit.Test)

Example 43 with Span

use of io.opentelemetry.proto.trace.v1.Span 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();
}
Also used : AggregateCall(zipkin2.internal.AggregateCall) Span(zipkin2.Span) Test(org.junit.Test)

Example 44 with Span

use of io.opentelemetry.proto.trace.v1.Span in project zipkin by openzipkin.

the class CassandraSpanConsumerTest method doesntIndexWhenOnlyIncludesTimestamp.

@Test
public void doesntIndexWhenOnlyIncludesTimestamp() {
    Span span = Span.newBuilder().traceId("a").id("1").timestamp(TODAY * 1000L).build();
    assertThat(consumer.accept(singletonList(span))).isInstanceOf(ResultSetFutureCall.class);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Example 45 with Span

use of io.opentelemetry.proto.trace.v1.Span in project zipkin by openzipkin.

the class CassandraUtilTest method annotationKeys_skipsTagsLongerThan256chars.

@Test
public void annotationKeys_skipsTagsLongerThan256chars() {
    // example long value
    String arn = "arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012";
    // example too long value
    String url = "http://webservices.amazon.com/onca/xml?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&AssociateTag=mytag-20&ItemId=0679722769&Operation=ItemLookup&ResponseGroup=Images%2CItemAttributes%2COffers%2CReviews&Service=AWSECommerceService&Timestamp=2014-08-18T12%3A00%3A00Z&Version=2013-08-01&Signature=j7bZM0LXZ9eXeZruTqWm2DIvDYVUU3wxPPpp%2BiXxzQc%3D";
    Span span = TestObjects.CLIENT_SPAN.toBuilder().putTag("aws.arn", arn).putTag("http.url", url).build();
    assertThat(CassandraUtil.annotationQuery(span)).contains("aws.arn", "aws.arn=" + arn).doesNotContain("http.url").doesNotContain("http.url=" + url);
}
Also used : Span(zipkin2.Span) Test(org.junit.Test)

Aggregations

Span (zipkin2.Span)335 Test (org.junit.Test)237 Test (org.junit.jupiter.api.Test)84 ArrayList (java.util.ArrayList)47 Endpoint (zipkin2.Endpoint)43 TestObjects.newClientSpan (zipkin2.TestObjects.newClientSpan)41 Span (io.opentelemetry.proto.trace.v1.Span)35 List (java.util.List)23 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)20 V1Span (zipkin2.v1.V1Span)17 Span (com.google.devtools.cloudtrace.v2.Span)16 Map (java.util.Map)14 AggregateCall (zipkin2.internal.AggregateCall)13 ResourceSpans (io.opentelemetry.proto.trace.v1.ResourceSpans)11 Arrays.asList (java.util.Arrays.asList)11 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)11 Annotation (wavefront.report.Annotation)11 Trace (com.google.devtools.cloudtrace.v1.Trace)10 TraceSpan (com.google.devtools.cloudtrace.v1.TraceSpan)10 AttributeValue (com.google.devtools.cloudtrace.v2.AttributeValue)10