io.jaegertracing.spi.Sender Java Examples

The following examples show how to use io.jaegertracing.spi.Sender. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JaegerAutoConfiguration.java    From java-spring-jaeger with Apache License 2.0 6 votes vote down vote up
private Reporter createReporter(Metrics metrics,
                                RemoteReporter remoteReporter, Sender udpSender) {
  io.jaegertracing.internal.reporters.RemoteReporter.Builder builder =
      new io.jaegertracing.internal.reporters.RemoteReporter.Builder()
          .withSender(udpSender)
          .withMetrics(metrics);

  if (remoteReporter.getFlushInterval() != null) {
    builder.withFlushInterval(remoteReporter.getFlushInterval());
  }
  if (remoteReporter.getMaxQueueSize() != null) {
    builder.withMaxQueueSize(remoteReporter.getMaxQueueSize());
  }

  return builder.build();
}
 
Example #2
Source File: Client.java    From cxf with Apache License 2.0 6 votes vote down vote up
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();
}
 
Example #3
Source File: JaegerAllInOne.java    From jaeger-analytics-java with Apache License 2.0 5 votes vote down vote up
public JaegerTracer createTracer(String serviceName) {
  String endpoint = String.format("http://localhost:%d/api/traces", getCollectorThriftPort());
  Sender sender = new HttpSender.Builder(endpoint)
      .build();
  Reporter reporter = new RemoteReporter.Builder()
      .withSender(sender)
      .build();
  Builder tracerBuilder = new Builder(serviceName)
      .withSampler(new ConstSampler(true))
      .withReporter(reporter);
  return tracerBuilder.build();
}
 
Example #4
Source File: Server.java    From cxf with Apache License 2.0 5 votes vote down vote up
protected Server() throws Exception {
    org.eclipse.jetty.server.Server server = new org.eclipse.jetty.server.Server(9000);

    // Register and map the dispatcher servlet
    final ServletHolder servletHolder = new ServletHolder(new CXFNonSpringJaxrsServlet());
    final ServletContextHandler context = new ServletContextHandler();
    context.setContextPath("/");
    context.addServlet(servletHolder, "/*");

    servletHolder.setInitParameter("javax.ws.rs.Application",
        CatalogApplication.class.getName());

    final Tracer tracer = new Configuration("tracer-server")
        .withSampler(new SamplerConfiguration().withType(ConstSampler.TYPE).withParam(1))
        .withReporter(new ReporterConfiguration().withSender(
            new SenderConfiguration() {
                @Override
                public Sender getSender() {
                    return new Slf4jLogSender();
                }
            }
        ))
        .getTracer();
    GlobalTracer.registerIfAbsent(tracer);
    
    server.setHandler(context);
    server.start();
    server.join();
}
 
Example #5
Source File: Target_SenderResolver.java    From quarkus with Apache License 2.0 4 votes vote down vote up
@Substitute
public static Sender resolve(Configuration.SenderConfiguration senderConfiguration) {
    return new ThriftSenderFactory().getSender(senderConfiguration);
}
 
Example #6
Source File: CatalogSenderConfiguration.java    From cxf with Apache License 2.0 4 votes vote down vote up
@Override
public Sender getSender() {
    return new ThriftSenderFactory().getSender(this);
}