Search in sources :

Example 1 with SenderConfiguration

use of io.jaegertracing.Configuration.SenderConfiguration 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 2 with SenderConfiguration

use of io.jaegertracing.Configuration.SenderConfiguration in project jaeger-client-java by jaegertracing.

the class ConfigurationTest method testSenderInstanceIsCached.

@Test
public void testSenderInstanceIsCached() {
    SenderConfiguration senderConfiguration = SenderConfiguration.fromEnv();
    assertEquals(senderConfiguration.getSender(), senderConfiguration.getSender());
}
Also used : SenderConfiguration(io.jaegertracing.Configuration.SenderConfiguration) Test(org.junit.Test)

Aggregations

SenderConfiguration (io.jaegertracing.Configuration.SenderConfiguration)2 Slf4jLogSender (demo.jaxrs.tracing.Slf4jLogSender)1 Configuration (io.jaegertracing.Configuration)1 ReporterConfiguration (io.jaegertracing.Configuration.ReporterConfiguration)1 SamplerConfiguration (io.jaegertracing.Configuration.SamplerConfiguration)1 Sender (io.jaegertracing.spi.Sender)1 Tracer (io.opentracing.Tracer)1 Response (javax.ws.rs.core.Response)1 OpenTracingClientProvider (org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider)1 Test (org.junit.Test)1