zipkin.reporter.okhttp3.OkHttpSender Java Examples

The following examples show how to use zipkin.reporter.okhttp3.OkHttpSender. 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: TracersGenerator.java    From spark-dependencies with Apache License 2.0 6 votes vote down vote up
public static Tuple<Tracing, Flushable> createZipkin(String serviceName, String collectorUrl) {
  Sender sender = OkHttpSender.builder()
    .endpoint(collectorUrl + "/api/v1/spans")
    .encoding(Encoding.JSON)
    .build();

  AsyncReporter<Span> reporter = AsyncReporter.builder(sender)
      .closeTimeout(1, TimeUnit.MILLISECONDS)
      .build();
  return new Tuple<>(Tracing.newBuilder()
      .localServiceName(serviceName)
      .sampler(Sampler.ALWAYS_SAMPLE)
      .traceId128Bit(true)
      .reporter(reporter)
      .build(), () -> reporter.flush());
}
 
Example #2
Source File: BraveProducer.java    From hawkular-apm with Apache License 2.0 5 votes vote down vote up
@Produces
@Singleton
public Brave getBrave() {
    String port = System.getenv("TRACING_PORT");
    if (port == null) {
        throw new IllegalStateException("Environmental variable TRACING_PORT is not set!");
    }

    return new Brave.Builder("wildfly-swarm")
            .reporter(AsyncReporter.builder(OkHttpSender.builder()
                    .endpoint("http://tracing-server:" + port + "/api/v1/spans")
                    .build())
                .build())
            .build();
}
 
Example #3
Source File: BaseETest.java    From jaeger-kubernetes with Apache License 2.0 4 votes vote down vote up
protected Tracing createZipkinTracer(String serviceName) {
  return Tracing.newBuilder()
          .localServiceName(serviceName)
          .reporter(AsyncReporter.builder(OkHttpSender.create(zipkinUrl + "api/v1/spans"))
                  .build()).build();
}