Search in sources :

Example 61 with Endpoint

use of org.pjsip.pjsua2.Endpoint in project zipkin by openzipkin.

the class ITSpanStore method getTraces_multipleAnnotationsBecomeAndFilter.

@Test
protected void getTraces_multipleAnnotationsBecomeAndFilter(TestInfo testInfo) throws Exception {
    String testSuffix = testSuffix(testInfo);
    Endpoint frontend = suffixServiceName(TestObjects.FRONTEND, testSuffix);
    Span foo = Span.newBuilder().traceId(newTraceId()).name("call1").id(1).timestamp((TODAY + 1) * 1000L).localEndpoint(frontend).addAnnotation((TODAY + 1) * 1000L, "foo").build();
    // would be foo bar, except lexicographically bar precedes foo
    Span barAndFoo = Span.newBuilder().traceId(newTraceId()).name("call2").id(2).timestamp((TODAY + 2) * 1000L).localEndpoint(frontend).addAnnotation((TODAY + 2) * 1000L, "bar").addAnnotation((TODAY + 2) * 1000L, "foo").build();
    Span fooAndBazAndQux = Span.newBuilder().traceId(newTraceId()).name("call3").id(3).timestamp((TODAY + 3) * 1000L).localEndpoint(frontend).addAnnotation((TODAY + 3) * 1000L, "foo").putTag("baz", "qux").build();
    Span barAndFooAndBazAndQux = Span.newBuilder().traceId(newTraceId()).name("call4").id(4).timestamp((TODAY + 4) * 1000L).localEndpoint(frontend).addAnnotation((TODAY + 4) * 1000L, "bar").addAnnotation((TODAY + 4) * 1000L, "foo").putTag("baz", "qux").build();
    accept(foo, barAndFoo, fooAndBazAndQux, barAndFooAndBazAndQux);
    assertGetTracesReturns(requestBuilder().serviceName(frontend.serviceName()).parseAnnotationQuery("foo").build(), asList(foo), asList(barAndFoo), asList(fooAndBazAndQux), asList(barAndFooAndBazAndQux));
    assertGetTracesReturns(requestBuilder().serviceName(frontend.serviceName()).parseAnnotationQuery("foo and bar").build(), asList(barAndFoo), asList(barAndFooAndBazAndQux));
    assertGetTracesReturns(requestBuilder().serviceName(frontend.serviceName()).parseAnnotationQuery("foo and bar and baz=qux").build(), asList(barAndFooAndBazAndQux));
    // ensure we can search only by tag key
    assertGetTracesReturns(requestBuilder().serviceName(frontend.serviceName()).parseAnnotationQuery("baz").build(), asList(fooAndBazAndQux), asList(barAndFooAndBazAndQux));
}
Also used : Endpoint(zipkin2.Endpoint) TestObjects.newClientSpan(zipkin2.TestObjects.newClientSpan) Span(zipkin2.Span) Test(org.junit.jupiter.api.Test)

Aggregations

Endpoint (zipkin2.Endpoint)55 Span (zipkin2.Span)27 Test (org.junit.jupiter.api.Test)18 V1Span (zipkin2.v1.V1Span)16 Test (org.junit.Test)10 ArrayList (java.util.ArrayList)5 TestObjects.newClientSpan (zipkin2.TestObjects.newClientSpan)5 List (java.util.List)3 JsonToken (com.fasterxml.jackson.core.JsonToken)2 IOException (java.io.IOException)2 InetAddress (java.net.InetAddress)2 NetworkInterface (java.net.NetworkInterface)2 Arrays.asList (java.util.Arrays.asList)2 Endpoint (org.jboss.remoting3.Endpoint)2 Record (org.jooq.Record)2 Access (org.openstack4j.model.identity.v2.Access)2 V1SpanConverter (zipkin2.v1.V1SpanConverter)2 Tracing (brave.Tracing)1 CloudConnectorException (com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException)1 CrnkClient (io.crnk.client.CrnkClient)1