Search in sources :

Example 1 with HttpSender

use of com.uber.jaeger.senders.HttpSender in project cxf by apache.

the class Client method main.

public static void main(final String[] args) throws Exception {
    final Metrics metrics = new Metrics(new StatsFactoryImpl(new NullStatsReporter()));
    final Tracer.Builder builder = new Tracer.Builder("cxf-client", new RemoteReporter(new HttpSender("http://localhost:14268/api/traces"), 1000, 100, metrics), new ConstSampler(true));
    final OpenTracingClientProvider provider = new OpenTracingClientProvider(builder.build());
    final javax.ws.rs.client.Client client = ClientBuilder.newClient().register(provider);
    final Response response = client.target("http://localhost:8084/catalog").request().accept(MediaType.APPLICATION_JSON).get();
    LOG.info("Response: {}", response.readEntity(String.class));
    response.close();
    // Allow Tracer to flush
    Thread.sleep(1000);
}
Also used : NullStatsReporter(com.uber.jaeger.metrics.NullStatsReporter) Tracer(com.uber.jaeger.Tracer) ClientBuilder(javax.ws.rs.client.ClientBuilder) OpenTracingClientProvider(org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider) HttpSender(com.uber.jaeger.senders.HttpSender) Response(javax.ws.rs.core.Response) RemoteReporter(com.uber.jaeger.reporters.RemoteReporter) Metrics(com.uber.jaeger.metrics.Metrics) ConstSampler(com.uber.jaeger.samplers.ConstSampler) StatsFactoryImpl(com.uber.jaeger.metrics.StatsFactoryImpl)

Example 2 with HttpSender

use of com.uber.jaeger.senders.HttpSender in project cxf by apache.

the class Server method tracer.

@Bean
Tracer tracer() {
    final Metrics metrics = new Metrics(new StatsFactoryImpl(new NullStatsReporter()));
    final Tracer.Builder builder = new Tracer.Builder("camel-server", new RemoteReporter(new HttpSender("http://localhost:14268/api/traces"), 1000, 100, metrics), new ConstSampler(true)).registerExtractor(Builtin.TEXT_MAP, new TextMapCodec(true));
    return builder.build();
}
Also used : RemoteReporter(com.uber.jaeger.reporters.RemoteReporter) Metrics(com.uber.jaeger.metrics.Metrics) NullStatsReporter(com.uber.jaeger.metrics.NullStatsReporter) Tracer(com.uber.jaeger.Tracer) ConstSampler(com.uber.jaeger.samplers.ConstSampler) TextMapCodec(com.uber.jaeger.propagation.TextMapCodec) StatsFactoryImpl(com.uber.jaeger.metrics.StatsFactoryImpl) HttpSender(com.uber.jaeger.senders.HttpSender) Bean(org.springframework.context.annotation.Bean)

Example 3 with HttpSender

use of com.uber.jaeger.senders.HttpSender 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)

Aggregations

HttpSender (com.uber.jaeger.senders.HttpSender)3 Tracer (com.uber.jaeger.Tracer)2 Metrics (com.uber.jaeger.metrics.Metrics)2 NullStatsReporter (com.uber.jaeger.metrics.NullStatsReporter)2 StatsFactoryImpl (com.uber.jaeger.metrics.StatsFactoryImpl)2 RemoteReporter (com.uber.jaeger.reporters.RemoteReporter)2 ConstSampler (com.uber.jaeger.samplers.ConstSampler)2 TextMapCodec (com.uber.jaeger.propagation.TextMapCodec)1 Sender (com.uber.jaeger.senders.Sender)1 ClientBuilder (javax.ws.rs.client.ClientBuilder)1 Response (javax.ws.rs.core.Response)1 OpenTracingClientProvider (org.apache.cxf.tracing.opentracing.jaxrs.OpenTracingClientProvider)1 Test (org.junit.Test)1 Bean (org.springframework.context.annotation.Bean)1