Search in sources :

Example 26 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin by openzipkin.

the class ITDependencies method oneway.

/**
 * Span starts on one host and ends on the other. In both cases, a response is neither sent nor
 * received.
 */
@Test
protected void oneway(TestInfo testInfo) throws Exception {
    String testSuffix = testSuffix(testInfo);
    String traceId = newTraceId();
    Endpoint frontend = suffixServiceName(TestObjects.FRONTEND, testSuffix);
    Endpoint backend = suffixServiceName(TestObjects.BACKEND, testSuffix);
    List<Span> trace = asList(Span.newBuilder().traceId(traceId).id("10").timestamp((TODAY + 50) * 1000).kind(Kind.CLIENT).localEndpoint(frontend).build(), Span.newBuilder().traceId(traceId).id("10").shared(true).timestamp((TODAY + 100) * 1000).kind(Kind.SERVER).localEndpoint(backend).build());
    processDependencies(trace);
    assertThat(store().getDependencies(endTs(trace), DAY).execute()).containsOnly(DependencyLink.newBuilder().parent(frontend.serviceName()).child(backend.serviceName()).callCount(1).build());
}
Also used : Endpoint(zipkin2.Endpoint) Span(zipkin2.Span) V1Span(zipkin2.v1.V1Span) Test(org.junit.jupiter.api.Test)

Example 27 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin by openzipkin.

the class ITDependencies method instrumentedClientAndServer.

@Test
protected void instrumentedClientAndServer(TestInfo testInfo) throws Exception {
    String testSuffix = testSuffix(testInfo);
    String traceId = newTraceId();
    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("10").name("get").timestamp((TODAY + 50L) * 1000L).duration(250L * 1000L).kind(Kind.CLIENT).localEndpoint(frontend).build(), Span.newBuilder().traceId(traceId).id("10").name("get").shared(true).timestamp((TODAY + 100) * 1000L).duration(150L * 1000L).kind(Kind.SERVER).localEndpoint(backend).build(), Span.newBuilder().traceId(traceId).parentId("10").id("11").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(frontend.serviceName()).child(backend.serviceName()).callCount(1).build(), DependencyLink.newBuilder().parent(backend.serviceName()).child(db.serviceName()).callCount(1).build());
}
Also used : Endpoint(zipkin2.Endpoint) Span(zipkin2.Span) V1Span(zipkin2.v1.V1Span) Test(org.junit.jupiter.api.Test)

Example 28 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin by openzipkin.

the class ITDependenciesHeavy method manyLinks.

/**
 * Ensure there's no query limit problem around links
 */
@Test
protected void manyLinks() throws Exception {
    // Larger than 10, which is the default ES search limit that tripped this
    int count = 1000;
    List<Span> spans = new ArrayList<>(count);
    for (int i = 1; i <= count; i++) {
        String traceId = newTraceId();
        Endpoint web = FRONTEND.toBuilder().serviceName("web-" + i).build();
        Endpoint app = BACKEND.toBuilder().serviceName("app-" + i).build();
        Endpoint db = DB.toBuilder().serviceName("db-" + i).build();
        spans.add(Span.newBuilder().traceId(traceId).id("10").name("get").timestamp((TODAY + 50L) * 1000L).duration(250L * 1000L).kind(Kind.CLIENT).localEndpoint(web).build());
        spans.add(Span.newBuilder().traceId(traceId).id("10").name("get").shared(true).timestamp((TODAY + 100) * 1000L).duration(150 * 1000L).kind(Kind.SERVER).localEndpoint(app).build());
        spans.add(Span.newBuilder().traceId(traceId).parentId("10").id("11").name("get").timestamp((TODAY + 150L) * 1000L).duration(50L * 1000L).kind(Kind.CLIENT).localEndpoint(app).remoteEndpoint(db).build());
    }
    processDependencies(spans);
    List<DependencyLink> links = store().getDependencies(endTs(spans), DAY).execute();
    // web-? -> app-?, app-? -> db-?
    assertThat(links).hasSize(count * 2);
    assertThat(links).extracting(DependencyLink::callCount).allSatisfy(callCount -> assertThat(callCount).isEqualTo(1));
}
Also used : Endpoint(zipkin2.Endpoint) ArrayList(java.util.ArrayList) DependencyLink(zipkin2.DependencyLink) Span(zipkin2.Span) Endpoint(zipkin2.Endpoint) Test(org.junit.jupiter.api.Test)

Example 29 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin by openzipkin.

the class ITSpanStore method setupDurationData.

List<List<Span>> setupDurationData(TestInfo testInfo) throws Exception {
    String testSuffix = testSuffix(testInfo);
    Endpoint frontend = suffixServiceName(TestObjects.FRONTEND, testSuffix);
    Endpoint backend = suffixServiceName(TestObjects.BACKEND, testSuffix);
    Endpoint db = suffixServiceName(TestObjects.DB, testSuffix);
    String traceId1 = newTraceId(), traceId2 = newTraceId(), traceId3 = newTraceId();
    // to make sure queries look back properly
    long offsetMicros = (TODAY - 3) * 1000L;
    Span targz = Span.newBuilder().traceId(traceId1).id(1L).name("targz").timestamp(offsetMicros + 100L).duration(200_000L).localEndpoint(frontend).remoteEndpoint(db).putTag("lc", "archiver").build();
    Span tar = Span.newBuilder().traceId(traceId1).id(2L).parentId(1L).name("tar").timestamp(offsetMicros + 200L).duration(150_000L).localEndpoint(backend).remoteEndpoint(backend).putTag("lc", "archiver").build();
    Span gz = Span.newBuilder().traceId(traceId1).id(3L).parentId(1L).name("gz").timestamp(offsetMicros + 250L).duration(50_000L).localEndpoint(db).remoteEndpoint(frontend).putTag("lc", "archiver").build();
    Span zip = Span.newBuilder().traceId(traceId3).id(3L).name("zip").timestamp(offsetMicros + 130L).duration(50_000L).addAnnotation(offsetMicros + 130L, "zip").localEndpoint(backend).remoteEndpoint(backend).putTag("lc", "archiver").build();
    List<Span> trace1 = asList(targz, tar, gz);
    List<Span> trace2 = asList(targz.toBuilder().traceId(traceId2).timestamp(offsetMicros + 110L).localEndpoint(db).remoteEndpoint(frontend).putTag("lc", "archiver-v2").build(), tar.toBuilder().traceId(traceId2).timestamp(offsetMicros + 210L).localEndpoint(backend).remoteEndpoint(backend).putTag("lc", "archiver").build(), gz.toBuilder().traceId(traceId2).timestamp(offsetMicros + 260L).localEndpoint(frontend).remoteEndpoint(backend).putTag("lc", "archiver").build());
    List<Span> trace3 = asList(zip);
    accept(trace1);
    accept(trace2);
    accept(trace3);
    return asList(trace1, trace2, trace3);
}
Also used : Endpoint(zipkin2.Endpoint) TestObjects.newClientSpan(zipkin2.TestObjects.newClientSpan) Span(zipkin2.Span)

Example 30 with Endpoint

use of com.google.cloud.aiplatform.v1.Endpoint in project zipkin by openzipkin.

the class ITSpanStore method getTraces_duration.

/**
 * Shows that duration queries go against the root span, not the child
 */
@Test
protected void getTraces_duration(TestInfo testInfo) throws Exception {
    String testSuffix = testSuffix(testInfo);
    Endpoint frontend = suffixServiceName(TestObjects.FRONTEND, testSuffix);
    Endpoint backend = suffixServiceName(TestObjects.BACKEND, testSuffix);
    Endpoint db = suffixServiceName(TestObjects.DB, testSuffix);
    List<List<Span>> traces = setupDurationData(testInfo);
    List<Span> trace1 = traces.get(0), trace2 = traces.get(1), trace3 = traces.get(2);
    // instead of since epoch
    QueryRequest.Builder q = requestBuilder().endTs(TODAY).lookback(DAY);
    // Min duration is inclusive and is applied by service.
    assertGetTracesReturns(q.serviceName(frontend.serviceName()).minDuration(200_000L).build(), trace1);
    assertGetTracesReturns(q.serviceName(db.serviceName()).minDuration(200_000L).build(), trace2);
    // Duration bounds aren't limited to root spans: they apply to all spans by service in a trace
    assertGetTracesReturns(q.serviceName(backend.serviceName()).minDuration(50_000L).maxDuration(150_000L).build(), trace1, trace2, trace3);
    // Remote service name should apply to the duration filter
    assertGetTracesReturns(q.serviceName(frontend.serviceName()).remoteServiceName(backend.serviceName()).maxDuration(50_000L).build(), trace2);
    // Span name should apply to the duration filter
    assertGetTracesReturns(q.serviceName(backend.serviceName()).spanName("zip").maxDuration(50_000L).build(), trace3);
    // Max duration should filter our longer spans from the same service
    assertGetTracesReturns(q.serviceName(backend.serviceName()).minDuration(50_000L).maxDuration(50_000L).build(), trace3);
}
Also used : Endpoint(zipkin2.Endpoint) Arrays.asList(java.util.Arrays.asList) List(java.util.List) TestObjects.newClientSpan(zipkin2.TestObjects.newClientSpan) Span(zipkin2.Span) Test(org.junit.jupiter.api.Test)

Aggregations

Endpoint (zipkin2.Endpoint)73 Span (zipkin2.Span)33 Test (org.junit.Test)28 Endpoint (org.jboss.remoting3.Endpoint)22 Test (org.junit.jupiter.api.Test)20 V1Span (zipkin2.v1.V1Span)16 NoopHealthCheckManager (com.wavefront.agent.channel.NoopHealthCheckManager)10 SpanSampler (com.wavefront.agent.sampler.SpanSampler)10 ByteBuf (io.netty.buffer.ByteBuf)10 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)10 DefaultFullHttpRequest (io.netty.handler.codec.http.DefaultFullHttpRequest)10 FullHttpRequest (io.netty.handler.codec.http.FullHttpRequest)10 Span (wavefront.report.Span)10 IOException (java.io.IOException)8 URI (java.net.URI)8 HashMap (java.util.HashMap)8 Annotation (wavefront.report.Annotation)8 ServiceName (org.jboss.msc.service.ServiceName)7 RateSampler (com.wavefront.sdk.entities.tracing.sampling.RateSampler)6 SaslAuthenticationFactory (org.wildfly.security.auth.server.SaslAuthenticationFactory)6