Search in sources :

Example 6 with Sender

use of io.jaegertracing.spi.Sender in project jaeger-client-java by jaegertracing.

the class SenderResolverTest method testFromServiceLoader.

@Test
public void testFromServiceLoader() {
    CustomSender customSender = new CustomSender();
    SenderFactoryToBeLoaded.sender = customSender;
    Sender sender = SenderResolver.resolve();
    assertEquals(customSender, sender);
}
Also used : Sender(io.jaegertracing.spi.Sender) Test(org.junit.Test)

Example 7 with Sender

use of io.jaegertracing.spi.Sender in project jaeger-client-java by jaegertracing.

the class ThriftSenderFactoryTest method testSenderWithEndpointWithoutAuthData.

@Test
public void testSenderWithEndpointWithoutAuthData() {
    System.setProperty(Configuration.JAEGER_ENDPOINT, "https://jaeger-collector:14268/api/traces");
    Sender sender = Configuration.SenderConfiguration.fromEnv().getSender();
    assertTrue(sender instanceof HttpSender);
}
Also used : Sender(io.jaegertracing.spi.Sender) Test(org.junit.Test)

Example 8 with Sender

use of io.jaegertracing.spi.Sender in project jaeger-client-java by jaegertracing.

the class ThriftSenderFactoryTest method testSenderWithAgentDataFromEnv.

@Test
public void testSenderWithAgentDataFromEnv() {
    System.setProperty(Configuration.JAEGER_AGENT_HOST, "jaeger-agent");
    System.setProperty(Configuration.JAEGER_AGENT_PORT, "6832");
    Sender sender = Configuration.SenderConfiguration.fromEnv().getSender();
    assertTrue(sender instanceof UdpSender);
}
Also used : Sender(io.jaegertracing.spi.Sender) Test(org.junit.Test)

Example 9 with Sender

use of io.jaegertracing.spi.Sender in project cxf by apache.

the class Client method main.

public static void main(final String[] args) throws Exception {
    final Tracer tracer = new Configuration("tracer-client").withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1)).withReporter(new ReporterConfiguration().withSender(new SenderConfiguration() {

        @Override
        public Sender getSender() {
            return new Slf4jLogSender();
        }
    })).getTracer();
    final OpenTracingClientProvider provider = new OpenTracingClientProvider(tracer);
    final Response response = WebClient.create("http://localhost:9000/catalog", Arrays.asList(provider)).accept(MediaType.APPLICATION_JSON).get();
    System.out.println(response.readEntity(String.class));
    response.close();
}
Also used : Slf4jLogSender(demo.jaxrs.tracing.Slf4jLogSender) Sender(io.jaegertracing.spi.Sender) Response(javax.ws.rs.core.Response) SenderConfiguration(io.jaegertracing.Configuration.SenderConfiguration) ReporterConfiguration(io.jaegertracing.Configuration.ReporterConfiguration) Configuration(io.jaegertracing.Configuration) SamplerConfiguration(io.jaegertracing.Configuration.SamplerConfiguration) Tracer(io.opentracing.Tracer) OpenTracingClientProvider(org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider) SamplerConfiguration(io.jaegertracing.Configuration.SamplerConfiguration) Slf4jLogSender(demo.jaxrs.tracing.Slf4jLogSender) SenderConfiguration(io.jaegertracing.Configuration.SenderConfiguration) ReporterConfiguration(io.jaegertracing.Configuration.ReporterConfiguration)

Example 10 with Sender

use of io.jaegertracing.spi.Sender in project jaeger-client-java by jaegertracing.

the class SenderResolverTest method testSpecifiedFactoryNotInList.

@Test
public void testSpecifiedFactoryNotInList() throws Exception {
    System.setProperty(Configuration.JAEGER_SENDER_FACTORY, "SpecifiedFactory");
    SenderFactoryToBeLoaded.sender = new CustomSender();
    Sender sender = getSenderForServiceFileContents("\nio.jaegertracing.internal.senders.InMemorySenderFactory", true);
    assertTrue(sender instanceof NoopSender);
    System.clearProperty(Configuration.JAEGER_SENDER_FACTORY);
}
Also used : Sender(io.jaegertracing.spi.Sender) Test(org.junit.Test)

Aggregations

Sender (io.jaegertracing.spi.Sender)12 Test (org.junit.Test)10 ILoggingEvent (ch.qos.logback.classic.spi.ILoggingEvent)1 Slf4jLogSender (demo.jaxrs.tracing.Slf4jLogSender)1 Configuration (io.jaegertracing.Configuration)1 ReporterConfiguration (io.jaegertracing.Configuration.ReporterConfiguration)1 SamplerConfiguration (io.jaegertracing.Configuration.SamplerConfiguration)1 SenderConfiguration (io.jaegertracing.Configuration.SenderConfiguration)1 Builder (io.jaegertracing.internal.reporters.RemoteReporter.Builder)1 InMemorySender (io.jaegertracing.internal.senders.InMemorySender)1 SenderFactory (io.jaegertracing.spi.SenderFactory)1 Tracer (io.opentracing.Tracer)1 Response (javax.ws.rs.core.Response)1 OpenTracingClientProvider (org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider)1 ArgumentMatcher (org.mockito.ArgumentMatcher)1