Search in sources :

Example 1 with Sender

use of com.uber.jaeger.senders.Sender in project jaeger-client-java by jaegertracing.

the class ConfigurationTest 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 : HttpSender(com.uber.jaeger.senders.HttpSender) Sender(com.uber.jaeger.senders.Sender) HttpSender(com.uber.jaeger.senders.HttpSender) Test(org.junit.Test)

Example 2 with Sender

use of com.uber.jaeger.senders.Sender in project jaeger-client-java by jaegertracing.

the class RemoteReporterTest method testFlushIsCalledOnSender.

@Test
public void testFlushIsCalledOnSender() throws InterruptedException {
    CountDownLatch latch = new CountDownLatch(1);
    Sender sender = new InMemorySender() {

        @Override
        public int flush() throws SenderException {
            latch.countDown();
            return super.flush();
        }
    };
    reporter = new RemoteReporter(sender, flushInterval, maxQueueSize, metrics);
    tracer = new Tracer.Builder("test-remote-reporter", reporter, new ConstSampler(true)).withMetrics(metrics).build();
    tracer.buildSpan("mySpan").start().finish();
    latch.await(1, TimeUnit.SECONDS);
    assertEquals("Should have called the custom sender flush", 0, latch.getCount());
}
Also used : Sender(com.uber.jaeger.senders.Sender) Tracer(com.uber.jaeger.Tracer) ConstSampler(com.uber.jaeger.samplers.ConstSampler) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.Test)

Aggregations

Sender (com.uber.jaeger.senders.Sender)2 Test (org.junit.Test)2 Tracer (com.uber.jaeger.Tracer)1 ConstSampler (com.uber.jaeger.samplers.ConstSampler)1 HttpSender (com.uber.jaeger.senders.HttpSender)1 CountDownLatch (java.util.concurrent.CountDownLatch)1