use of com.uber.tchannel.api.TChannel in project java by wavefrontHQ.
the class PushAgent method startTraceJaegerListener.
protected void startTraceJaegerListener(String strPort, ReportableEntityHandlerFactory handlerFactory, @Nullable WavefrontSender wfSender, SpanSampler sampler) {
if (tokenAuthenticator.authRequired()) {
logger.warning("Port: " + strPort + " is not compatible with HTTP authentication, ignoring");
return;
}
startAsManagedThread(Integer.parseInt(strPort), () -> {
activeListeners.inc();
try {
TChannel server = new TChannel.Builder("jaeger-collector").setServerPort(Integer.parseInt(strPort)).build();
server.makeSubChannel("jaeger-collector", Connection.Direction.IN).register("Collector::submitBatches", new JaegerTChannelCollectorHandler(strPort, handlerFactory, wfSender, () -> entityProps.get(ReportableEntityType.TRACE).isFeatureDisabled(), () -> entityProps.get(ReportableEntityType.TRACE_SPAN_LOGS).isFeatureDisabled(), preprocessors.get(strPort), sampler, proxyConfig.getTraceJaegerApplicationName(), proxyConfig.getTraceDerivedCustomTagKeys()));
server.listen().channel().closeFuture().sync();
server.shutdown(false);
} catch (InterruptedException e) {
logger.info("Listener on port " + strPort + " shut down.");
} catch (Exception e) {
logger.log(Level.SEVERE, "Jaeger trace collector exception", e);
} finally {
activeListeners.dec();
}
}, "listener-jaeger-tchannel-" + strPort);
logger.info("listening on port: " + strPort + " for trace data (Jaeger format over TChannel)");
}
Aggregations