use of io.jaegertracing.thrift.internal.senders.ThriftSender in project instrumentation-java by census-instrumentation.
the class JaegerTraceExporter method createAndRegister.
/**
* Creates and registers the Jaeger Trace exporter to the OpenCensus library using the provided
* configurations.
*
* @param configuration configurations for this exporter.
* @throws IllegalStateException if a Jaeger exporter is already registered.
* @since 0.22
*/
public static void createAndRegister(JaegerExporterConfiguration configuration) {
synchronized (monitor) {
checkState(handler == null, "Jaeger exporter is already registered.");
ThriftSender sender = configuration.getThriftSender();
if (sender == null) {
sender = new HttpSender.Builder(configuration.getThriftEndpoint()).build();
}
Process process = new Process(configuration.getServiceName());
SpanExporter.Handler newHandler = new JaegerExporterHandler(sender, process, configuration.getDeadline());
JaegerTraceExporter.handler = newHandler;
register(Tracing.getExportComponent().getSpanExporter(), newHandler);
}
}
Aggregations