Search in sources :

Example 1 with Slf4jLogSender

use of demo.jaxrs.tracing.Slf4jLogSender 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)

Aggregations

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 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