use of zipkin2.TestObjects.FRONTEND in project zipkin by openzipkin.
the class SpanConverterTest method client_missingCs.
/**
* Fix a v1 reported half in new style and half in old style, ex via a bridge
*/
@Test
public void client_missingCs() {
Span v2 = Span.newBuilder().traceId("1").id("2").name("get").kind(Kind.CLIENT).localEndpoint(FRONTEND).timestamp(1472470996199000L).duration(207000L).build();
V1Span v1 = V1Span.newBuilder().traceId("1").id("2").name("get").timestamp(1472470996199000L).duration(207000L).addAnnotation(1472470996406000L, "cs", FRONTEND).build();
assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
use of zipkin2.TestObjects.FRONTEND in project zipkin by openzipkin.
the class SpanConverterTest method redundantServiceNameOnAddressAnnotations_server.
/**
* On server spans, ignore service name on remote address binary annotation that appear loopback
* based on the service name. This could happen when finagle service labels are used incorrectly,
* which as common in early instrumentation.
*
* <p>This prevents an uncorrectable scenario which results in extra (loopback) links on server
* spans.
*/
@Test
public void redundantServiceNameOnAddressAnnotations_server() {
Span v2 = Span.newBuilder().traceId("1").parentId("2").id("3").kind(Kind.SERVER).name("get").localEndpoint(FRONTEND).timestamp(1472470996199000L).duration(207000L).build();
V1Span v1 = V1Span.newBuilder().traceId(1L).parentId(2L).id(3L).name("get").timestamp(1472470996199000L).duration(207000L).addAnnotation(1472470996199000L, "sr", FRONTEND).addAnnotation(1472470996406000L, "ss", FRONTEND).addBinaryAnnotation("ca", FRONTEND).addBinaryAnnotation("sa", FRONTEND).build();
assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
use of zipkin2.TestObjects.FRONTEND in project zipkin by openzipkin.
the class V1SpanConverterTest method convert_sa_incorrect_value.
@Test
public void convert_sa_incorrect_value() {
V1Span v1 = V1Span.newBuilder().traceId(1L).id(2L).addAnnotation(1472470996199000L, "cs", FRONTEND).addBinaryAnnotation("sa", "1", BACKEND).build();
Span v2 = Span.newBuilder().traceId("1").id("2").kind(Kind.CLIENT).timestamp(1472470996199000L).localEndpoint(FRONTEND).remoteEndpoint(BACKEND).build();
assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
use of zipkin2.TestObjects.FRONTEND in project zipkin by openzipkin.
the class V1SpanConverterTest method convert_sa.
@Test
public void convert_sa() {
V1Span v1 = V1Span.newBuilder().traceId(1L).id(2L).addAnnotation(1472470996199000L, "cs", FRONTEND).addBinaryAnnotation("sa", BACKEND).build();
Span v2 = Span.newBuilder().traceId("1").id("2").kind(Kind.CLIENT).timestamp(1472470996199000L).localEndpoint(FRONTEND).remoteEndpoint(BACKEND).build();
assertThat(v1SpanConverter.convert(v1)).containsExactly(v2);
}
use of zipkin2.TestObjects.FRONTEND in project zipkin by openzipkin.
the class ITDependencies method notInstrumentedClientAndServer.
/**
* This test confirms that the span store can detect dependency indicated by local and remote
* endpoint. Specifically, this detects an uninstrumented client before the trace and an
* uninstrumented server at the end of it.
*/
@Test
protected void notInstrumentedClientAndServer(TestInfo testInfo) throws Exception {
String testSuffix = testSuffix(testInfo);
String traceId = newTraceId();
Endpoint kafka = suffixServiceName(TestObjects.KAFKA, testSuffix);
Endpoint frontend = suffixServiceName(TestObjects.FRONTEND, testSuffix);
Endpoint backend = suffixServiceName(TestObjects.BACKEND, testSuffix);
Endpoint db = suffixServiceName(TestObjects.DB, testSuffix);
List<Span> trace = asList(Span.newBuilder().traceId(traceId).id("20").name("get").timestamp(TODAY * 1000L).duration(350L * 1000L).kind(Kind.SERVER).localEndpoint(frontend).remoteEndpoint(kafka).build(), Span.newBuilder().traceId(traceId).parentId("20").id("21").name("get").timestamp((TODAY + 50L) * 1000L).duration(250L * 1000L).kind(Kind.CLIENT).localEndpoint(frontend).build(), Span.newBuilder().traceId(traceId).parentId("20").id("21").name("get").shared(true).timestamp((TODAY + 250) * 1000L).duration(50L * 1000L).kind(Kind.SERVER).localEndpoint(backend).build(), Span.newBuilder().traceId(traceId).parentId("21").id("22").name("get").timestamp((TODAY + 150L) * 1000L).duration(50L * 1000L).kind(Kind.CLIENT).localEndpoint(backend).remoteEndpoint(db).build());
processDependencies(trace);
assertThat(store().getDependencies(endTs(trace), DAY).execute()).containsOnly(DependencyLink.newBuilder().parent(kafka.serviceName()).child(frontend.serviceName()).callCount(1).build(), DependencyLink.newBuilder().parent(frontend.serviceName()).child(backend.serviceName()).callCount(1).build(), DependencyLink.newBuilder().parent(backend.serviceName()).child(db.serviceName()).callCount(1).build());
}
Aggregations