We have selected to use Jaeger API is used for tracing. There , we have setup the Jaeger locally using docker as mentioned below.
sudo docker run -d --name jaeger \
-p 5775:5775/udp \
-p 6831:6831/udp \
-p 6832:6832/udp \
-p 5778:5778 \
-p 16686:16686 \
-p 14268:14268 \
jaegertracing/all-in-one:latest
In the ServletContextListener
, we created new cofigurations like below.
@WebListener
public class TracingContextListener implements ServletContextListener {
@Inject
private io.opentracing.Tracer tracer;
public void contextInitialized(ServletContextEvent servletContextEvent) {
GlobalTracer.register(tracer);
}
public void contextDestroyed(ServletContextEvent servletContextEvent) {
}
@Produces
@Singleton
public static io.opentracing.Tracer jaegerTracer() {
return new Configuration("MyApplication", new Configuration.SamplerConfiguration(
ProbabilisticSampler.TYPE, 1),
new Configuration.ReporterConfiguration())
.getTracer();
}
}
Now this works fine and I can see the tracing in http://localhost:16686
Problem : I want to make the Jager setup in an external environment and connect from another application server (application server is running on wildfly 10 docker under host mode). In future that Jaeger instance may used by more than one server instances for tracings.
After looking at the source and various references as mentioned below I tried below options. But it connects to local always. I tried various ports like 5775, 6831, 6832 also but result was same.
return new Configuration("MyApplication", new Configuration.SamplerConfiguration(
ProbabilisticSampler.TYPE, 1, "server2.mycompany.com:5778"),
new Configuration.ReporterConfiguration())
.getTracer();
Further I tried setting JAEGER_ENDPOINT and JAEGER_SAMPLER_MANAGER_HOST_PORT as environment variables also. But failed.
In one reference I found that "Jaeger client libraries expect jaeger-agent process to run locally on each host...".
Is that means I can't use it in cebtrelized manner and I need to setup Jaeger in each application server instances? Otherwise how to do that?