0

In jaeger-client-cpp when I connect my Tracer variable to jaeger backend (I m using jaeger-all-in-one server) then upon successful connection LOG INFO message is shown telling me the connection is successful, but when connection is unsuccessful is just shows LOG ERROR message telling me that connection with server not successful.

So is there any way to check this programatically about the status of connection of Tracer with server.

OS-ubuntu 18.04 jaeger-client-cpp-v0.5.0

Abhinav Singh
  • 302
  • 3
  • 15

1 Answers1

0
#include <jaegertracing/net/IPAddress.h>
#include <jaegertracing/net/Socket.h>
void check(){
try{
jaegertracing::net::Socket socket;
        socket.open(AF_INET, SOCK_STREAM);
        const std::string serverURL = configuration.sampler().kDefaultSamplingServerURL; 
        socket.connect(serverURL);
}catch(...){}
}

if it throws error then it is unable to reach host, this method is costly I agree but this is the only viable solution I find

Abhinav Singh
  • 302
  • 3
  • 15