Giter Site home page Giter Site logo

jaegertracing / jaeger-client-cpp Goto Github PK

View Code? Open in Web Editor NEW
138.0 138.0 125.0 485 KB

๐Ÿ›‘ This library is DEPRECATED!

Home Page: https://jaegertracing.io/

License: Apache License 2.0

Python 1.02% CMake 8.19% Shell 0.65% C++ 89.94% Dockerfile 0.03% C 0.17%

jaeger-client-cpp's People

Contributors

aarshiyaguneja avatar albertteoh avatar alek86 avatar andremarianiello avatar ankit-varma10 avatar bedebamu avatar crosscode-nl avatar dqminh avatar goller avatar hugomfernandes avatar isaacbrodsky avatar isaachier avatar johanneswuerbach avatar jorritsalverda avatar leozz37 avatar mdouaihy avatar meastman avatar mikegoldsmith avatar pikbot avatar ringerc avatar rnburn avatar tobiasstadler avatar tudor avatar vadorovsky avatar yurishkuro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jaeger-client-cpp's Issues

Extract() failure returns opentracing::expected with has_value=t and null ptr

Calling jaegertracing::Tracer's Extract(std::istream& reader) ) with an empty stream produces what I'd consider an unexpected result.

Instead of returning a false opentracing::expected i.e. no value, or returning a unique_ptr to a default-initialized context, it returns a unique_ptr<opentracing::Context>(nullptr). This is surprising to me; why use opentracing::expected at all in this case?

https://github.com/jaegertracing/cpp-client/blob/c36adcf7eaf09b548ada784cbb97d40f6b9d6519/src/jaegertracing/Tracer.h#L155

The following test addition illustrates the current behaviour if inserted in src/jaegertracing/TracerTest.cpp:280 after the declaration of the stringstream, i.e.:

        std::stringstream ss;
        opentracing::expected<std::unique_ptr<opentracing::SpanContext>> empty_result = tracer->Extract(ss);
        ASSERT_FALSE(!empty_result);
        ASSERT_EQ(*empty_result, nullptr);
        

AFAICS Extract should return no-value with info on why, such that a passing test would be

        std::stringstream ss;
        opentracing::expected<std::unique_ptr<opentracing::SpanContext>> empty_result = tracer->Extract(ss);
        ASSERT_TRUE(!empty_result);

or return a default context e.g.:

         if (spanContext == SpanContext()) {
            return std::unique_ptr<opentracing::SpanContext>(new SpanContext());
         }

such that a passing test would be

        std::stringstream ss;
        opentracing::expected<std::unique_ptr<opentracing::SpanContext>> empty_result = tracer->Extract(ss);
        ASSERT_FALSE(!empty_result);
        ASSERT_NE(*empty_result, nullptr);
        ASSERT_EQ(static_cast<const jaegertracing::SpanContext&>(*(*empty_result)), jaegertracing::SpanContext());

Or just doc/comment the current behaviour :)

Hunter builds don't install the downloaded dependencies

When Jaeger does its default "download it from the Internet" build, the resulting install is unusable:

  • there are no opentracing headers installed
  • there's no libyaml-cpp header or library installed

etc.

So it should probably either disable "make install" for Hunter builds and document how to do a normal install, or install all the built dependencies too. I'd suggest complaining if you try to use /usr/local as an install target in this case and suggesting another target.

It'd also be nice to document that hunter writes stuff to ~/.hunter not within the jaeger-cpp builddir. The built dependencies seem to have been dropped in .hunter/_Base/7128985/340d525/3420b24/Install, which of course jaeger-cpp knows to add to the CPATH and LIBRARY_PATH ... but tools using jaeger-cpp don't.

A make dependencies-install or something would probably help.

Propagating B3-Headers

Hi guys

I was able to create new spans on my POC C++ app, now I want the spans to include the b3 headers so jaeger can correlate the span with its originating request trace.

I was doing something like this:

TracingData td = ExtractTraceData(context);
auto span = opentracing::Tracer::Global()->StartSpan("Test B3 in baggage");
span->SetBaggageItem(HEADER_X_REQUEST_ID, td.xRequestId);
span->SetBaggageItem(HEADER_X_TRACE_ID, td.xB3TraceId);
span->SetBaggageItem(HEADER_X_SPAN_ID, td.xB3SpanId);

Should I use the baggage for that? I'm seeing jaeger UI shows the trace ID as a "tag" but the stuff I put into the baggage doesn't appears to be a tag.

At opentracing gitter I was told I need to use a B3 codec and that maybe there isn't one for C++

Do you guys know how could I propagate the B3 headers in a span?

Thanks for your help

Unhandled exception - Abort raised when write to the jaeger-agent fails

An unhandled exception when flushing spans to the local agent is causing the process to abort.

In my local testing setup, I'm using the all-in-one instance to collect the spans emitted by the application. One of my test cases involves simulating a scenario where the local Jaeger agent is unavailable. Unavailability of the Jaeger agent should not have any detrimental impact on the application (except for spans being dropped) but I'm running into an unhandled exception which is causing the application to abort.

0 0x00007f200d1041f7 in raise () from /lib64/libc.so.6
1 0x00007f200d1058e8 in abort () from /lib64/libc.so.6
2 0x00007f200d708ac5 in __gnu_cxx::__verbose_terminate_handler() () from /lib64/libstdc++.so.6
3 0x00007f200d706a36 in ?? () from /lib64/libstdc++.so.6
4 0x00007f200d706a63 in std::terminate() () from /lib64/libstdc++.so.6
5 0x000000000082d005 in jaegertracing::reporters::RemoteReporter::flush (this=0x108b6a60)
6 0x000000000082cccd in jaegertracing::reporters::RemoteReporter::sweepQueue (this=0x108b6a60)

Upon further investigation, I belive the reason for this is the way the client handles send failures.

UDPClient::emitBatch(...) raises an std::system_error in case the write to the socket fails. This propagates through till it reaches RemoteReporter::flush() which is currently only expecting Transport::Exception.

I have currently patched this by modifying the UDPTransport::flush() to handle std::system_error and std::logic_error.

`
int UDPTransport::flush()
{
if (_spanBuffer.empty()) {
return 0;
}

thrift::Batch batch;
batch.__set_process(_process);
batch.__set_spans(_spanBuffer);
_client->emitBatch(batch);

try {
  _client->emitBatch(batch);
} catch (const std::system_error& ex) {
  std::ostringstream oss;
  oss << "Could not send span " << ex.what() << ", code=" << ex.code().value();
  throw Transport::Exception(oss.str(), _spanBuffer.size());
} catch (const std::logic_error &ex) {
  std::ostringstream oss;
  oss << "Could not send span " << ex.what();
  throw Transport::Exception(oss.str(), _spanBuffer.size());
}
catch (...) {
  throw Transport::Exception("Could not send spans", _spanBuffer.size());
}

resetBuffers();

return batch.spans.size();

}
`

Remove Thrift headers from Jaeger public headers

Hi

The example app works, although one of the unit tests fails, but then when I try to use the library in my projects I get the following error.

In file included from /usr/local/include/jaegertracing/Tag.h:20:0,
                 from /usr/local/include/jaegertracing/LogRecord.h:20,
                 from /usr/local/include/jaegertracing/Span.h:26,
                 from /usr/local/include/jaegertracing/UDPTransport.h:20,
                 from /usr/local/include/jaegertracing/reporters/Config.h:25,
                 from /usr/local/include/jaegertracing/Config.h:23,
                 from /usr/local/include/jaegertracing/Tracer.h:28,
                 from followersServer.cc:11:
/usr/local/include/jaegertracing/thrift-gen/jaeger_types.h:12:27: fatal error: thrift/Thrift.h: No such file or directory
compilation terminated.

So I tried to update the thrift submodule as you mention in the README but doesn't seems to be working fine, I get:

sgarofalo@AR-IT08661:~/dev/jaeger-client-cpp$ find idl/thrift/ -type f -name \*.thrift -exec thrift -gen cpp -out src/jaegertracing/thrift-gen {} \;
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/jaeger.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/zipkincore.thrift:19] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/agent.thrift:21] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/aggregation_validator.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/baggage.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/crossdock/tracetest.thrift:18] No generator named 'netcore' could be found!
[ERROR:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/crossdock/tracetest.thrift:28] (last token was 'Downstream')
Type "Downstream" has not been defined.
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/dependency.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/jaeger.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/sampling.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/zipkincore.thrift:19] No generator named 'netcore' could be found!
sgarofalo@AR-IT08661:~/dev/jaeger-client-cpp$ git apply scripts/thrift-gen.patch
error: patch failed: src/jaegertracing/thrift-gen/tracetest_types.cpp:60
error: src/jaegertracing/thrift-gen/tracetest_types.cpp: patch does not apply
error: patch failed: src/jaegertracing/thrift-gen/tracetest_types.h:61
error: src/jaegertracing/thrift-gen/tracetest_types.h: patch does not apply

And the original error is still present.
Does anyone knows what is going on and how can I solve it?

Thanks

Segfault in localIP function

Segmentation fault {
  libpthread-2.19.so 10330 __restore_rt
  libjaegertracingd.so.0.0.8 258bfa IPAddress.cpp:40 jaegertracing::net::IPAddress::localIP(int)::{lambda(ifaddrs const*)#1}::operator()(ifaddrs const*) const
  libjaegertracingd.so.0.0.8 25974d functional:2058 std::_Function_handler<bool (ifaddrs const*), jaegertracing::net::IPAddress::localIP(int)::{lambda(ifaddrs const*)#1}>::_M_invoke(std::_Any_data const&, ifaddrs const*)
  libjaegertracingd.so.0.0.8 259bc9 functional:2472 std::function<bool (ifaddrs const*)>::operator()(ifaddrs const*) const
  libjaegertracingd.so.0.0.8 258d04 IPAddress.cpp:50 jaegertracing::net::IPAddress::localIP(std::function<bool (ifaddrs const*)>)
  libjaegertracingd.so.0.0.8 258c51 IPAddress.cpp:41 jaegertracing::net::IPAddress::localIP(int)
  libjaegerutils.so 28813 jaegertracing::Tracer::Tracer(std::string const&, std::shared_ptr<jaegertracing::samplers::Sampler> const&, std::shared_ptr<jaegertracing::reporters::Reporter> const&, std::shared_ptr<jaegertracing::logging::Logger> const&, std::shared_ptr<jaegertracing::metrics::Metrics> const&, int)
  libjaegerutils.so 296a8 jaegertracing::Tracer::make(std::string const&, jaegertracing::Config const&, std::shared_ptr<jaegertracing::logging::Logger> const&, jaegertracing::metrics::StatsFactory&, int)
  libjaegerutils.so 1e4f1 jaegertracing::utils::make_jaeger_tracer_for_prod(std::string const&)
  libjaegerutils.so 1e8e1 jaegertracing::utils::make_jaeger_tracer(std::string const&)
  map_api_load_test 406de3 main
  libc-2.19.so 21f45 libc-start.c:321 __libc_start_main
  map_api_load_test 407dd1 _start
}
Segmentation fault (core dumped)

The above occurred when connected via VPN. I believe the issue is here: ifAddr->ifa_addr->sa_family, and I'm assuming ifa_addr is null.

Build error๏ผHelp๏ผ๏ผ๏ผ๏ผ

My main code :
auto config = jaegertracing::Config(
false,
jaegertracing::samplers::Config(jaegertracing::kSamplerTypeConst, 1),
jaegertracing::reporters::Config(
jaegertracing::reporters::Config::kDefaultQueueSize,
std::chrono::seconds(1), true));
std::shared_ptropentracing::Tracer tracer = jaegertracing::Tracer::make("c++", config);
auto span = tracer->StartSpan("abc");
std::this_thread::sleep_for(std::chrono::milliseconds{10});
span->Finish();
std::this_thread::sleep_for(std::chrono::seconds{5});
tracer->Close();

then build error is :
clang++ -D__GXX_EXPERIMENTAL_CXX0X__ -D__cplusplus=201103L -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -stdlib=libc++ -MMD -MP -MF"src/jaegertracing/thrift-gen/Agent.d" -MT"src/jaegertracing/thrift-gen/Agent.o" -o "src/jaegertracing/thrift-gen/Agent.o" "../src/jaegertracing/thrift-gen/Agent.cpp"
../src/jaegertracing/thrift-gen/Agent.cpp:70:10: error: no member named 'incrementRecursionDepth' in 'apache::thrift::protocol::TProtocol'; did you mean 'incrementInputRecursionDepth'?
oprot->incrementRecursionDepth();
^~~~~~~~~~~~~~~~~~~~~~~
incrementInputRecursionDepth
/usr/local/include/thrift/protocol/TProtocol.h:557:8: note: 'incrementInputRecursionDepth' declared here
void incrementInputRecursionDepth() {
^
../src/jaegertracing/thrift-gen/Agent.cpp:87:10: error: no member named 'decrementRecursionDepth' in 'apache::thrift::protocol::TProtocol'; did you mean 'decrementInputRecursionDepth'?
oprot->decrementRecursionDepth();
^~~~~~~~~~~~~~~~~~~~~~~
decrementInputRecursionDepth
/usr/local/include/thrift/protocol/TProtocol.h:562:8: note: 'decrementInputRecursionDepth' declared here
void decrementInputRecursionDepth() { --input_recursion_depth_; }
^
../src/jaegertracing/thrift-gen/Agent.cpp:98:10: error: no member named 'incrementRecursionDepth' in 'apache::thrift::protocol::TProtocol'; did you mean 'incrementInputRecursionDepth'?
oprot->incrementRecursionDepth();
^~~~~~~~~~~~~~~~~~~~~~~
incrementInputRecursionDepth
/usr/local/include/thrift/protocol/TProtocol.h:557:8: note: 'incrementInputRecursionDepth' declared here
void incrementInputRecursionDepth() {
^
../src/jaegertracing/thrift-gen/Agent.cpp:115:10: error: no member named 'decrementRecursionDepth' in 'apache::thrift::protocol::TProtocol'; did you mean 'decrementInputRecursionDepth'?
oprot->decrementRecursionDepth();
^~~~~~~~~~~~~~~~~~~~~~~
decrementInputRecursionDepth
/usr/local/include/thrift/protocol/TProtocol.h:562:8: note: 'decrementInputRecursionDepth' declared here
void decrementInputRecursionDepth() { --input_recursion_depth_; }
^
../src/jaegertracing/thrift-gen/Agent.cpp:166:10: error: no member named 'incrementRecursionDepth' in 'apache::thrift::protocol::TProtocol'; did you mean 'incrementInputRecursionDepth'?
oprot->incrementRecursionDepth();
^~~~~~~~~~~~~~~~~~~~~~~
incrementInputRecursionDepth
/usr/local/include/thrift/protocol/TProtocol.h:557:8: note: 'incrementInputRecursionDepth' declared here
void incrementInputRecursionDepth() {
^
../src/jaegertracing/thrift-gen/Agent.cpp:175:10: error: no member named 'decrementRecursionDepth' in 'apache::thrift::protocol::TProtocol'; did you mean 'decrementInputRecursionDepth'?
oprot->decrementRecursionDepth();
^~~~~~~~~~~~~~~~~~~~~~~
decrementInputRecursionDepth
/usr/local/include/thrift/protocol/TProtocol.h:562:8: note: 'decrementInputRecursionDepth' declared here
void decrementInputRecursionDepth() { --input_recursion_depth_; }
^
../src/jaegertracing/thrift-gen/Agent.cpp:186:10: error: no member named 'incrementRecursionDepth' in 'apache::thrift::protocol::TProtocol'; did you mean 'incrementInputRecursionDepth'?
oprot->incrementRecursionDepth();
^~~~~~~~~~~~~~~~~~~~~~~
incrementInputRecursionDepth
/usr/local/include/thrift/protocol/TProtocol.h:557:8: note: 'incrementInputRecursionDepth' declared here
void incrementInputRecursionDepth() {
^
../src/jaegertracing/thrift-gen/Agent.cpp:195:10: error: no member named 'decrementRecursionDepth' in 'apache::thrift::protocol::TProtocol'; did you mean 'decrementInputRecursionDepth'?
oprot->decrementRecursionDepth();
^~~~~~~~~~~~~~~~~~~~~~~
decrementInputRecursionDepth
/usr/local/include/thrift/protocol/TProtocol.h:562:8: note: 'decrementInputRecursionDepth' declared here
void decrementInputRecursionDepth() { --input_recursion_depth_; }
^
8 errors generated.
make: *** [src/jaegertracing/thrift-gen/Agent.o] Error 1

my local thrift version is 0.9.3

The C++ Jaeger client always populates the "ip" tag with 127.0.0.1

Requirement - what kind of business use case are you trying to solve?

The C++ Jaeger client always populates the "ip" tag with 127.0.0.1 in my environment (Docker containers running on a local machine), which makes the tag useless.

Problem - what in Jaeger blocks you from solving the requirement?

Incorrect implementation in

IPAddress IPAddress::localIP(std::function<bool(const ifaddrs*)> filter)
: Looking at the implementation, this will return the address of the first encountered AF_INET interface, which could be the loopback interface.

Proposal - what do you suggest to solve the problem or improve the existing situation?

I know that getting a node's IP address is an ambiguous question with no right answer -- which interface do you use? Many nodes have more than one IP address, especially in the network-virtualized environments of Kube clusters, but the loopback interface is almost definitely the wrong answer.

A better solution would allow overriding the IP address via environment variables and/or the tracer config, as per #105.

Thrift IDL not in main repository, no build support

In the jaeger cpp-client source dir:

$ find . -name \*.thrift
$

and a git grep emitZipkinBatch finds only generated output from Thrift + references in UDPClient.h, UDPClientTest.cpp, and MockAgent.h.

Where are the Thrift sources to re-generate what's in thrift-gen ?

It's necessary for #38 to work since the local Thrift may not be the same version as the Thrift compiler used to check in the sources. Plus it's not great to carry generated sources in git when you can avoid it.

Error "fatal error: yaml-cpp/yaml.h2" building library. JAEGERTRACING_WITH_YAML_CPP=OFF is ignored?

Cloning the repository and building the client fails because of a missing dependency.

tempDir="$(mktemp -d)" \
&& chmod 777 "$tempDir" \
&& cd "$tempDir" \
&& git clone https://github.com/jaegertracing/cpp-client.git jaeger-cpp-client \
&& cd jaeger-cpp-client \
&& mkdir .build && cd .build \
&& cmake -DCMAKE_BUILD_TYPE=Release \
           -DBUILD_TESTING=OFF \
           -DJAEGERTRACING_WITH_YAML_CPP=OFF ..
In file included from /tmp/tmp.hHLAaO/jaeger-cpp-client/src/jaegertracing/Config.h:21:0,
                 from /tmp/tmp.hHLAaO/jaeger-cpp-client/src/jaegertracing/Config.cpp:17:
/tmp/tmp.hHLAaO/jaeger-cpp-client/src/jaegertracing/baggage/RestrictionsConfig.h:24:27: fatal error: yaml-cpp/yaml.h: No such file or directory
 #include <yaml-cpp/yaml.h>
                           ^

Full output
https://gist.github.com/carlosjgp/d58b744cc699e0e19ba8718ec359e7d1

I have tried to clone and build yaml-cpp before with the same output :(

tempDir="$(mktemp -d)" \
&& chmod 777 "$tempDir" \
&& cd "$tempDir" \
&& git clone https://github.com/jbeder/yaml-cpp.git \
&& cd yaml-cpp \
&& mkdir .build && cd .build \
&& cmake -DBUILD_SHARED_LIBS=ON .. \
&& cd "$tempDir" \
&& git clone https://github.com/jaegertracing/cpp-client.git jaeger-cpp-client \
&& cd jaeger-cpp-client \
&& mkdir .build && cd .build \
&& cmake -DCMAKE_BUILD_TYPE=Release \
           -DBUILD_TESTING=OFF \
           -DJAEGERTRACING_WITH_YAML_CPP=OFF ..

Span shared_ptr to Tracer causes deadlock in RemoteReporter

Problem

I am experiencing random failures of the test Tracer, testTracer.

After investigation, here is what I found:

  • Tracer, testTracer starts a Reporter in a separate thread. Note that on a busy machine, this thread might be slow to consume the reported span
  • Sometimes, the test finishes quickly before the reported had a chance to report the span
  • In this case
    • the test replace the tracer with the Noop one at the end. At this point, the already reported spans become the only references to the previous tracer
    • When the reporter finally has a chance to run, it sends the spans and destroys them
    • Once the last span is destroyed, the tracer gets destroyed also. Among other resources , the tracer tries to destroy the reporter that is being running.

I observed here two different behaviors

  • Under Windows, the mutex are recursives. The attempt to destroy the reporter succeed. The sweep method then reads dangling data
  • Under macOS, Linux, the mutex is not recursive. When calling RemoteReporter::close() blocks when called from RemoteReporter::sweepQueue. The reporter thread indefinitely.

For additional analysis, below are the stack traces under Windows and macOS.

Under Windows. [External Code] is the standard library for which I didnt load the symbols.

``

jaegertracingd.dll!jaegertracing::utils::ErrorUtil::logError'::1'::catch$7() Line 41 C++
[External Code]
jaegertracingd.dll!jaegertracing::utils::ErrorUtil::logError(jaegertracing::logging::Logger &, const std::basic_string<char,std::char_traits,std::allocator > & {...}) Line 33 C++
jaegertracingd.dll!jaegertracing::reporters::RemoteReporter::close'::1'::catch$2() Line 77 C++
[External Code]
jaegertracingd.dll!jaegertracing::reporters::RemoteReporter::close() Line 67 C++
jaegertracingd.dll!jaegertracing::reporters::RemoteReporter::~RemoteReporter() Line 47 C++
[External Code]
jaegertracingd.dll!jaegertracing::Tracer::~Tracer() Line 89 C++
[External Code]
jaegertracingd.dll!jaegertracing::Span::~Span() Line 84 C++
jaegertracingd.dll!jaegertracing::reporters::RemoteReporter::sweepQueue() Line 100 C++
jaegertracingd.dll!jaegertracing::reporters::RemoteReporter::{ctor}::__l2::() Line 45 C++
[External Code]
``

Under macOS

``

__psynch_mutexwait + 10
_pthread_mutex_lock_wait + 83
_pthread_mutex_lock_slow + 253
std::__1::mutex::lock() + 9
jaegertracing::reporters::RemoteReporter::close() [inlined] std::__1::lock_guardstd::__1::mutex::lock_guard(this=0x000070000969c438, __m=0x00007feab6000370) at __mutex_base:104
jaegertracing::reporters::RemoteReporter::close() [inlined] std::__1::lock_guardstd::__1::mutex::lock_guard(this=0x000070000969c438, __m=0x00007feab6000370) at __mutex_base:104
jaegertracing::reporters::RemoteReporter::close(this=0x00007feab60002d0) at RemoteReporter.cpp:67
jaegertracing::Tracer::Close(this=0x00007feab680fe00) at Tracer.h:170
jaegertracing::Tracer::~Tracer(this=0x00007feab680fe00) at Tracer.h:89
jaegertracing::Tracer::~Tracer(this=0x00007feab680fe00) at Tracer.h:89
jaegertracing::Tracer::~Tracer(this=0x00007feab680fe00) at Tracer.h:89
std::__1::__shared_ptr_pointer<jaegertracing::reporters::RemoteReporter* >::__on_zero_shared()
std::__1::__shared_ptr_pointer<jaegertracing::reporters::RemoteReporter* >::__on_zero_shared(this=0x00007feab6000400) at memory:3540
std::__1::shared_ptr<jaegertracing::Tracer const>::~shared_ptr() [inlined] std::__1::__shared_count::__release_shared(this=0x00007feab6000400) at memory:3444
std::__1::shared_ptr<jaegertracing::Tracer const>::~shared_ptr() [inlined] std::__1::__shared_weak_count::__release_shared(this=0x00007feab6000400) at memory:3486
std::__1::shared_ptr<jaegertracing::Tracer const>::~shared_ptr(this=0x000070000969cb08) at memory:4412
std::__1::shared_ptr<jaegertracing::Tracer const>::~shared_ptr(this=0x000070000969cb08) at memory:4410
jaegertracing::Span::~Span(this=0x000070000969cb00) at Span.h:86
jaegertracing::Span::~Span(this=0x000070000969cb00) at Span.h:86
jaegertracing::reporters::RemoteReporter::sweepQueue(this=0x00007feab60002d0) at RemoteReporter.cpp:100
jaegertracing::reporters::RemoteReporter::RemoteReporter(this=0x00007feab60003f8)::$_0::operator()() const at RemoteReporter.cpp:45
...
_pthread_body + 340
_pthread_start + 377
thread_start + 13

``

Overflow bug in ProbabilisticSampler.

The ProbabilisticSampler uses the following logic to determine a sampling bound:

    explicit ProbabilisticSampler(double samplingRate)
        : _samplingRate(std::max(0.0, std::min(samplingRate, 1.0)))
        , _samplingBoundary(
              static_cast<uint64_t>(kMaxRandomNumber * _samplingRate))
        , _tags({ { kSamplerTypeTagKey, kSamplerTypeProbabilistic },
                  { kSamplerParamTagKey, _samplingRate } })
    {
    }

kMaxRandomNumber * _samplingRate gets converted to a double which rounds to a higher value than kMaxRandomNumber so that when it's casted back to a uint64_t it overflows to zero and nothing is sampled.

This short program will demonstrate the problem

#include <limits>
#include <cstddef>
#include <iostream>

int main() {
  constexpr auto max = std::numeric_limits<uint64_t>::max();
  std::cout << max << "\n";
  auto t = max*1.0;
  std::cout << t << "\n";
  auto x = static_cast<uint64_t>(t);
  std::cout << x << "\n";
  return 0;
}

It outputs

18446744073709551615
1.84467e+19
0

Support nlohmann json 2.0.x?

I realise everyone loves adding support for old versions of libraries, so this isn't exactly a priority.

But nlohmann json 2.0.x is only currently found "in the wild" on Debian Testing and Unstable. It's not in Fedora 27, which carries 2.0.2, or in Debian stable or AFAICS in backports. Nor in Ubuntu Artful; it'll be in Bionic in April. Certainly not RHEL etc.

The build fails against 2.0.x even once I work around the issue with the header renaming from json.hpp to nlohmann/json.hpp.

I just don't have the c++-fu to understand what's going on here. Feel free to ignore if you don't care about compat with older widely deployed libs; that's fair enough.

Error spam:

In file included from /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/baggage/RemoteRestrictionJSON.cpp:17:0:
/home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/baggage/RemoteRestrictionJSON.h: In function โ€˜void jaegertracing::thrift::to_json(nlohmann::json&, const BaggageRestrictionList&)โ€™:
/home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/baggage/RemoteRestrictionJSON.h:56:17: error: no match for โ€˜operator=โ€™ (operand types are โ€˜nlohmann::json {aka nlohmann::basic_json<>}โ€™ and โ€˜const std::vector<jaegertracing::thrift::BaggageRestriction>โ€™)
     json = list.success;
                 ^~~~~~~
In file included from /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/baggage/RemoteRestrictionJSON.h:27:0,
                 from /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/baggage/RemoteRestrictionJSON.cpp:17:
/usr/include/json.hpp:2125:16: note: candidate: nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::operator=(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type = nlohmann::basic_json<>]
     reference& operator=(basic_json other) noexcept (
                ^~~~~~~~
/usr/include/json.hpp:2125:16: note:   no known conversion for argument 1 from โ€˜const std::vector<jaegertracing::thrift::BaggageRestriction>โ€™ to โ€˜nlohmann::basic_json<>โ€™
/usr/include/json.hpp: In instantiation of โ€˜ValueType nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get() const [with ValueType = jaegertracing::thrift::BaggageRestriction; typename std::enable_if<(! std::is_pointer<_Ptr>::value), int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]โ€™:
/usr/include/json.hpp:2690:13:   required from โ€˜nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(std::vector<T>*) const::<lambda(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>)> [with T = jaegertracing::thrift::BaggageRestriction; typename std::enable_if<(std::is_convertible<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, T>::value && (! std::is_same<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, T>::value)), int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]โ€™
/usr/include/json.hpp:2687:72:   required from โ€˜struct nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(std::vector<T>*) const [with T = jaegertracing::thrift::BaggageRestriction; typename std::enable_if<(std::is_convertible<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, T>::value && (! std::is_same<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, T>::value)), int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]::<lambda(class nlohmann::basic_json<>)>โ€™
/usr/include/json.hpp:2686:27:   required from โ€˜std::vector<T> nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(std::vector<T>*) const [with T = jaegertracing::thrift::BaggageRestriction; typename std::enable_if<(std::is_convertible<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, T>::value && (! std::is_same<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, T>::value)), int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]โ€™
/usr/include/json.hpp:2946:24:   required from โ€˜ValueType nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get() const [with ValueType = std::vector<jaegertracing::thrift::BaggageRestriction>; typename std::enable_if<(! std::is_pointer<_Ptr>::value), int>::type <anonymous> = 0; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]โ€™
/home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/baggage/RemoteRestrictionJSON.h:61:62:   required from here
/usr/include/json.hpp:2946:24: error: no matching function for call to โ€˜nlohmann::basic_json<>::get_impl(jaegertracing::thrift::BaggageRestriction*) constโ€™
         return get_impl(static_cast<ValueType*>(nullptr));
                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/json.hpp:2622:7: note: candidate: template<class T, typename std::enable_if<(std::is_convertible<std::__cxx11::basic_string<char>, typename T::key_type>::value && std::is_convertible<nlohmann::basic_json<>, typename T::mapped_type>::value), int>::type <anonymous> > T nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(T*) const [with T = T; typename std::enable_if<(std::is_convertible<typename ObjectType<StringType, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, std::less<StringType>, AllocatorType<std::pair<const StringType, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType> > > >::key_type, typename T::key_type>::value && std::is_convertible<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, typename T::mapped_type>::value), int>::type <anonymous> = <enumerator>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]
     T get_impl(T*) const
       ^~~~~~~~
/usr/include/json.hpp:2622:7: note:   template argument deduction/substitution failed:
/usr/include/json.hpp:2619:97: error: no type named โ€˜key_typeโ€™ in โ€˜class jaegertracing::thrift::BaggageRestrictionโ€™
                   std::is_convertible<typename object_t::key_type, typename T::key_type>::value and
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
                   std::is_convertible<basic_json_t, typename T::mapped_type>::value
                   ~~~                                                                            
/usr/include/json.hpp:2619:97: error: no type named โ€˜mapped_typeโ€™ in โ€˜class jaegertracing::thrift::BaggageRestrictionโ€™
/usr/include/json.hpp:2621:34: note: invalid template non-type parameter
                   , int>::type = 0>
                                  ^
/usr/include/json.hpp:2635:14: note: candidate: nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::object_t nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::object_t*) const [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::object_t = std::map<std::__cxx11::basic_string<char>, nlohmann::basic_json<>, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > > >]
     object_t get_impl(object_t*) const
              ^~~~~~~~
/usr/include/json.hpp:2635:14: note:   no known conversion for argument 1 from โ€˜jaegertracing::thrift::BaggageRestriction*โ€™ to โ€˜nlohmann::basic_json<>::object_t* {aka std::map<std::__cxx11::basic_string<char>, nlohmann::basic_json<>, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, nlohmann::basic_json<> > > >*}โ€™
/usr/include/json.hpp:2656:7: note: candidate: template<class T, typename std::enable_if<((((std::is_convertible<nlohmann::basic_json<>, typename T::value_type>::value && (! std::is_same<nlohmann::basic_json<>, typename T::value_type>::value)) && (! std::is_arithmetic<_Tp>::value)) && (! std::is_convertible<std::__cxx11::basic_string<char>, T>::value)) && (! nlohmann::{anonymous}::has_mapped_type<T>::value)), int>::type <anonymous> > T nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(T*) const [with T = T; typename std::enable_if<((((std::is_convertible<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, typename T::value_type>::value && (! std::is_same<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, typename T::value_type>::value)) && (! std::is_arithmetic<T>::value)) && (! std::is_convertible<std::__cxx11::basic_string<char>, T>::value)) && (! nlohmann::{anonymous}::has_mapped_type<T>::value)), int>::type <anonymous> = <enumerator>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]
     T get_impl(T*) const
       ^~~~~~~~
/usr/include/json.hpp:2656:7: note:   template argument deduction/substitution failed:
/usr/include/json.hpp:2650:84: error: no type named โ€˜value_typeโ€™ in โ€˜class jaegertracing::thrift::BaggageRestrictionโ€™
                   std::is_convertible<basic_json_t, typename T::value_type>::value and
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
                   not std::is_same<basic_json_t, typename T::value_type>::value and
                   ~~~~~~~                                                           
/usr/include/json.hpp:2651:19: error: no type named โ€˜value_typeโ€™ in โ€˜class jaegertracing::thrift::BaggageRestrictionโ€™
                   not std::is_same<basic_json_t, typename T::value_type>::value and
                   ^~~~~~~
/usr/include/json.hpp:2655:34: note: invalid template non-type parameter
                   , int>::type = 0>
                                  ^
/usr/include/json.hpp:2680:20: note: candidate: template<class T, typename std::enable_if<(std::is_convertible<nlohmann::basic_json<>, T>::value && (! std::is_same<nlohmann::basic_json<>, T>::value)), int>::type <anonymous> > std::vector<T> nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(std::vector<T>*) const [with T = T; typename std::enable_if<(std::is_convertible<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, T>::value && (! std::is_same<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, T>::value)), int>::type <anonymous> = <enumerator>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]
     std::vector<T> get_impl(std::vector<T>*) const
                    ^~~~~~~~
/usr/include/json.hpp:2680:20: note:   template argument deduction/substitution failed:
/usr/include/json.hpp:2946:24: note:   โ€˜jaegertracing::thrift::BaggageRestrictionโ€™ is not derived from โ€˜std::vector<T, std::allocator<_CharT> >โ€™
         return get_impl(static_cast<ValueType*>(nullptr));
                ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/json.hpp:2705:7: note: candidate: template<class T, typename std::enable_if<(std::is_same<nlohmann::basic_json<>, typename T::value_type>::value && (! nlohmann::{anonymous}::has_mapped_type<T>::value)), int>::type <anonymous> > T nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(T*) const [with T = T; typename std::enable_if<(std::is_same<nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>, typename T::value_type>::value && (! nlohmann::{anonymous}::has_mapped_type<T>::value)), int>::type <anonymous> = <enumerator>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]
     T get_impl(T*) const
       ^~~~~~~~
/usr/include/json.hpp:2705:7: note:   template argument deduction/substitution failed:
/usr/include/json.hpp:2702:75: error: no type named โ€˜value_typeโ€™ in โ€˜class jaegertracing::thrift::BaggageRestrictionโ€™
                   std::is_same<basic_json, typename T::value_type>::value and
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
                   not has_mapped_type<T>::value
                   ~~~~~~~~~~~~~~~~~~~~~~                                   
/usr/include/json.hpp:2704:34: note: invalid template non-type parameter
                   , int>::type = 0>
                                  ^
/usr/include/json.hpp:2718:13: note: candidate: nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::array_t nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::array_t*) const [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::array_t = std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >]
     array_t get_impl(array_t*) const
             ^~~~~~~~
/usr/include/json.hpp:2718:13: note:   no known conversion for argument 1 from โ€˜jaegertracing::thrift::BaggageRestriction*โ€™ to โ€˜nlohmann::basic_json<>::array_t* {aka std::vector<nlohmann::basic_json<>, std::allocator<nlohmann::basic_json<> > >*}โ€™
/usr/include/json.hpp:2735:7: note: candidate: template<class T, typename std::enable_if<std::is_convertible<std::__cxx11::basic_string<char>, T>::value, int>::type <anonymous> > T nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(T*) const [with T = T; typename std::enable_if<std::is_convertible<StringType, T>::value, int>::type <anonymous> = <enumerator>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]
     T get_impl(T*) const
       ^~~~~~~~
/usr/include/json.hpp:2735:7: note:   template argument deduction/substitution failed:
/usr/include/json.hpp:2734:34: error: no type named โ€˜typeโ€™ in โ€˜struct std::enable_if<false, int>โ€™
                   , int>::type = 0>
                                  ^
/usr/include/json.hpp:2734:34: note: invalid template non-type parameter
/usr/include/json.hpp:2752:7: note: candidate: template<class T, typename std::enable_if<std::is_arithmetic<_Tp>::value, int>::type <anonymous> > T nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(T*) const [with T = T; typename std::enable_if<std::is_arithmetic<T>::value, int>::type <anonymous> = <enumerator>; ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator]
     T get_impl(T*) const
       ^~~~~~~~
/usr/include/json.hpp:2752:7: note:   template argument deduction/substitution failed:
/usr/include/json.hpp:2751:33: error: no type named โ€˜typeโ€™ in โ€˜struct std::enable_if<false, int>โ€™
                  , int>::type = 0>
                                 ^
/usr/include/json.hpp:2751:33: note: invalid template non-type parameter
/usr/include/json.hpp:2779:25: note: candidate: constexpr nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::boolean_t nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::get_impl(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::boolean_t*) const [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::boolean_t = bool]
     constexpr boolean_t get_impl(boolean_t*) const
                         ^~~~~~~~
/usr/include/json.hpp:2779:25: note:   no known conversion for argument 1 from โ€˜jaegertracing::thrift::BaggageRestriction*โ€™ to โ€˜nlohmann::basic_json<>::boolean_t* {aka bool*}โ€™
CMakeFiles/jaegertracing.dir/build.make:350: recipe for target 'CMakeFiles/jaegertracing.dir/src/jaegertracing/baggage/RemoteRestrictionJSON.cpp.o' failed

Offline builds (reproducibility, security)

Jaeger's c++ bindings seem to leap out to the Internet to build private copies of build dependencies like Boost.

A bit of reading of the build code shows that

cmake -DHUNTER_ENABLED=0

is sufficient to suppress this behaviour, at which point you can configure it with local dependencies. It'd be nice if this were in the README.md.

I got partway with:

sudo dnf install boost-devel thrift-devel  json-devel libyaml-devel gtest-devel

then building the opentracing C++ API from https://github.com/opentracing/opentracing-cpp and installing that first.

It still gets stuck on the rpm packaging for json-devel (nlohmann) since there's no bundled nlohmann_jsonConfig.cmake . Seems it doesn't know how to do discovery for that, I'll see if I can add it. Same with the yaml libraries.

But even when I make configs fro nlohmann and json-devel and then

cmake -DHUNTER_ENABLED=0 -Dnlohmann_json_DIR=. -Dyaml-cpp_DIR=.

it still fails with

Target "UnitTest" links to target "thrift::thrift_static" but the target
was not found.  Perhaps a find_package() call is missing for an IMPORTED
target, or an ALIAS target is missing?

It could be related to version, but the CMake code doesn't do any tests for required versions and there's no documentation on required verisons, so I'm struggling to know what's required. I have:

$ rpm -q  boost-devel thrift-devel  json-devel libyaml-devel gtest-devel
boost-devel-1.60.0-10.fc25.x86_64
thrift-devel-0.9.1-17.fc25.5.x86_64
json-devel-2.0.2-1.fc25.x86_64
libyaml-devel-0.1.6-8.fc24.x86_64
gtest-devel-1.7.0-8.fc25.x86_64

$ cmake -version
cmake version 3.9.0

$  gcc --version|head -1
gcc (GCC) 6.4.1 20170727 (Red Hat 6.4.1-1)

$ lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:	Fedora
Description:	Fedora release 25 (Twenty Five)
Release:	25
Codename:	TwentyFive

Anyway, it'd be nice to document the dependencies and that building without "grab it all from the Internet" is supported in the README.md.

I'll experiment with it for now by letting Hunter do its thing, but I really don't want to do things like build Boost all the time...

Add pluggable shared libraries releases?

I'm working on making self-contained, pluggable, shared libraries releases for tracers where users can download a binary instead of building from source. The steps to produce such a library involve

  • Linking in all dependencies statically
  • Using the -static-libstdc++ and -static-libgcc flags so that the standard C++ library isn't required
  • Applying an export map to avoid dependency clashes and to only expose the minimum required symbols

I recently added this to https://github.com/rnburn/zipkin-cpp-opentracing for amd64-linux. This script shows how the library can be build. You can also use https://github.com/tcnksm/ghr to automatically build and attach these libraries to github releases.

Is this something you'd be interested in adding for Jaeger? An additional benefit is that this will produce a library in a form that's usable by Envoy's dynamic tracing code; so we could add an example to https://github.com/envoyproxy/envoy/tree/master/examples, and envoy users would be able to trace with Jaeger natively instead of using Zipkin with Jaeger.

Traces not showing up in jaeger.

I'm running this small c++ program (matching the go quickstart example).

#include <jaegertracing/Tracer.h>
#include <opentracing/tracer.h>
#include <chrono>
#include <thread>

int main() {
  auto config = jaegertracing::Config(
      false,
      jaegertracing::samplers::Config(jaegertracing::kSamplerTypeConst, 1),
      jaegertracing::reporters::Config(
          jaegertracing::reporters::Config::kDefaultQueueSize,
          std::chrono::seconds(1), true));
  auto tracer = jaegertracing::Tracer::make("wherearemyspans?", config);
  auto span = tracer->StartSpan("abc");
  std::this_thread::sleep_for(std::chrono::milliseconds{10});
  span->Finish();
  std::this_thread::sleep_for(std::chrono::seconds{5});
  tracer->Close();
  return 0;
}

If I start the Jaeger's docker server

docker run -d -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 -p5775:5775/udp -p6831:6831/udp -p6832:6832/udp \
  -p5778:5778 -p16686:16686 -p14268:14268 -p9411:9411 jaegertracing/all-in-one:latest

it shows the service name "wherearemyspans?" (so the server received something); but if I try to find traces, I don't see anything.

Running the go example, the spans show up all the time.

Any idea what could be going on?

Logs supplied in Span::FinishWithOptions are silently discarded

jaegertracing::Span::FinishWithOptions entirely ignores the options.log_records field of opentracing::FinishSpanOptions.

Any logs so passed are discarded.

Not ideal, because the Span::Log method only accepts a std::initializer_list so it's clumsy when you have a dynamic set of keys in your logs.

Will send a pull, this just documents the issue first.

make error

cpp client version is 0.2.0, when i execute โ€œmakeโ€ command after executing "cmake .", has some errors:
/Users/xujie/Desktop/C_Project/cpp-client-0.2.0/src/jaegertracing/TracerTest.cpp:139:27: error:
default initialization of an object of const type 'const
jaegertracing::(anonymous namespace)::FakeSpanContext' without a
user-provided default constructor
const FakeSpanContext fakeCtx;
^
{}
1 error generated.
make[2]: *** [CMakeFiles/UnitTest.dir/src/jaegertracing/TracerTest.cpp.o] Error 1
make[1]: *** [CMakeFiles/UnitTest.dir/all] Error 2
make: *** [all] Error 2

jaeger cpp-client isn't in Hunter

Jaeger cpp-client appears to be intended to be used exclusively from/with Hunter, but it isn't in the Hunter repository/package list (https://docs.hunter.sh/en/latest/packages.html).

Mind posting an example of how you use it in your own codebase? Do you use Hunter to find dependencies then manually link to jaeger-cpp its self?

(I was adding a README explaining how to use jaeger-cpp with Hunter and couldn't figure out how!)

Undefined symbols for architecture x86_64

Hello:
my code :
#include
#include <jaegertracing/tracer.h>
#include <opentracing/tracer.h>
#include <stdio.h>
#include

using namespace std;

int main(){
cout << "Hello world !!!!" << endl;

auto config = jaegertracing::Config(
      false,
      jaegertracing::samplers::Config(jaegertracing::kSamplerTypeConst, 1),
      jaegertracing::reporters::Config(
          jaegertracing::reporters::Config::kDefaultQueueSize,
          std::chrono::seconds(1), true));
std::shared_ptr<opentracing::Tracer> tracer = jaegertracing::Tracer::make("c++", config);
  auto span = tracer->StartSpan("abc");
  std::this_thread::sleep_for(std::chrono::milliseconds{10});
  span->Finish();
  std::this_thread::sleep_for(std::chrono::seconds{5});
  tracer->Close();
return 0;

}
And build error:
make all
Building file: ../src/HelloWorld.cpp
Invoking: GCC C++ Compiler
clang++ -D__GXX_EXPERIMENTAL_CXX0X__ -D__cplusplus=201103L -O0 -g3 -Wall -c -fmessage-length=0 -std=c++11 -stdlib=libc++ -MMD -MP -MF"src/HelloWorld.d" -MT"src/HelloWorld.o" -o "src/HelloWorld.o" "../src/HelloWorld.cpp"
Finished building: ../src/HelloWorld.cpp

Building target: ProjectTest
Invoking: MacOS X C++ Linker
clang++ -stdlib=libc++ -Xlinker /usr/local/lib/libopentracing.a -o "ProjectTest" ./src/HelloWorld.o
Undefined symbols for architecture x86_64:
"jaegertracing::SpanContext::fromStream(std::__1::basic_istream<char, std::__1::char_traits >&)", referenced from:
operator>>(std::__1::basic_istream<char, std::__1::char_traits >&, jaegertracing::SpanContext&) in HelloWorld.o
"jaegertracing::UDPTransport::UDPTransport(jaegertracing::net::IPAddress const&, int)", referenced from:
jaegertracing::reporters::Config::makeReporter(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, jaegertracing::logging::Logger&, jaegertracing::metrics::Metrics&) const in HelloWorld.o
"jaegertracing::net::URI::queryEscape(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
jaegertracing::propagation::HTTPHeaderPropagator::encodeValue(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) const in HelloWorld.o
"jaegertracing::net::URI::queryUnescape(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
jaegertracing::propagation::Propagator<opentracing::v1::TextMapReader const&, opentracing::v1::TextMapWriter const&>::parseCommaSeparatedMap(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in HelloWorld.o
jaegertracing::propagation::HTTPHeaderPropagator::decodeValue(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) const in HelloWorld.o
jaegertracing::propagation::Propagator<opentracing::v1::HTTPHeadersReader const&, opentracing::v1::HTTPHeadersWriter const&>::parseCommaSeparatedMap(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in HelloWorld.o
"jaegertracing::net::IPAddress::versionFromString(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int, int)", referenced from:
jaegertracing::net::IPAddress::v4(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, int) in HelloWorld.o
"jaegertracing::net::IPAddress::localIP(int)", referenced from:
jaegertracing::Tracer::Tracer(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::shared_ptrjaegertracing::samplers::Sampler const&, std::__1::shared_ptrjaegertracing::reporters::Reporter const&, std::__1::shared_ptrjaegertracing::logging::Logger const&, std::__1::shared_ptrjaegertracing::metrics::Metrics const&, int) in HelloWorld.o
"jaegertracing::logging::nullLogger()", referenced from:
jaegertracing::Tracer::make(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, jaegertracing::Config const&) in HelloWorld.o
"jaegertracing::metrics::StatsFactory::createGauge(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
jaegertracing::metrics::Metrics::Metrics(jaegertracing::metrics::StatsFactory&) in HelloWorld.o
"jaegertracing::metrics::StatsFactory::createCounter(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&)", referenced from:
jaegertracing::metrics::Metrics::Metrics(jaegertracing::metrics::StatsFactory&) in HelloWorld.o
"jaegertracing::metrics::Metrics::makeNullMetrics()", referenced from:
jaegertracing::propagation::Propagator<opentracing::v1::TextMapReader const&, opentracing::v1::TextMapWriter const&>::Propagator() in HelloWorld.o
jaegertracing::propagation::Propagator<opentracing::v1::HTTPHeadersReader const&, opentracing::v1::HTTPHeadersWriter const&>::Propagator() in HelloWorld.o
"jaegertracing::metrics::Metrics::Metrics()", referenced from:
std::__1::__shared_ptr_emplace<jaegertracing::metrics::Metrics, std::__1::allocatorjaegertracing::metrics::Metrics >::__on_zero_shared() in HelloWorld.o
std::__1::__libcpp_compressed_pair_imp<std::__1::allocatorjaegertracing::metrics::Metrics, jaegertracing::metrics::Metrics, 1u>::
__libcpp_compressed_pair_imp() in HelloWorld.o
jaegertracing::propagation::Propagator<opentracing::v1::TextMapReader const&, opentracing::v1::TextMapWriter const&>::Propagator() in HelloWorld.o
std::__1::__shared_ptr_pointer<jaegertracing::metrics::Metrics*, std::__1::default_deletejaegertracing::metrics::Metrics, std::__1::allocatorjaegertracing::metrics::Metrics >::__on_zero_shared() in HelloWorld.o
jaegertracing::propagation::Propagator<opentracing::v1::HTTPHeadersReader const&, opentracing::v1::HTTPHeadersWriter const&>::Propagator() in HelloWorld.o
"jaegertracing::samplers::RemotelyControlledSampler::RemotelyControlledSampler(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::shared_ptrjaegertracing::samplers::Sampler const&, int, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&, jaegertracing::logging::Logger&, jaegertracing::metrics::Metrics&)", referenced from:
jaegertracing::samplers::Config::makeSampler(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, jaegertracing::logging::Logger&, jaegertracing::metrics::Metrics&) const in HelloWorld.o
"jaegertracing::reporters::RemoteReporter::RemoteReporter(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&, int, std::__1::unique_ptr<jaegertracing::Transport, std::__1::default_deletejaegertracing::Transport >&&, jaegertracing::logging::Logger&, jaegertracing::metrics::Metrics&)", referenced from:
jaegertracing::reporters::Config::makeReporter(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, jaegertracing::logging::Logger&, jaegertracing::metrics::Metrics&) const in HelloWorld.o
"vtable for jaegertracing::Tracer", referenced from:
jaegertracing::Tracer::Tracer(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::shared_ptrjaegertracing::samplers::Sampler const&, std::__1::shared_ptrjaegertracing::reporters::Reporter const&, std::__1::shared_ptrjaegertracing::logging::Logger const&, std::__1::shared_ptrjaegertracing::metrics::Metrics const&, int) in HelloWorld.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for jaegertracing::reporters::LoggingReporter", referenced from:
jaegertracing::reporters::LoggingReporter::LoggingReporter(jaegertracing::logging::Logger&) in HelloWorld.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ProjectTest] Error 1

16:28:45 Build Finished (took 2s.513ms)

cpp-client loses spans on short-lived processes; Close() not flushing buffers?

If a process:

  • Creates a tracer with a typical configuration (like the following yml)
  • Creates a span
  • Finishes the span
  • Closes the tracer
  • Exits

the span should be reported to the collector. But it isn't unless a short sleep is inserted before the tracer->Close() call.

If the sleep() is added after the tracer close, the spans are not sent. It looks like Close() must be failing to flush buffers, instead dropping any pending buffers on the floor.

Configuration, loaded with the YAML config support:

disabled: false
sampler:
    type: const
    param: 1
reporter:
    queueSize: 100
    bufferFlushInterval: 10
    logSpans: false
    localAgentHostPort: 127.0.0.1:6831
headers:
    jaegerDebugHeader: debug-id
    jaegerBaggageHeader: baggage
    TraceContextHeaderName: trace-id
    traceBaggageHeaderPrefix: "testctx-"
baggage_restrictions:
    denyBaggageOnInitializationFailure: false
    hostPort: 127.0.0.1:5778
    refreshInterval: 60

Propagate opentracing-cpp v1.4.1

Version 1.4.1 of opentracing-cpp fixes some Windows build issues. Can we propagate them here? Also, has anyone tried to build this project on Windows?

C bindings (feature request)

The Jeager client doesn't appear to have any C bindings, making it unusable from pure C programs without a lot of abstraction boilerplate.

It shouldn't be necessary to have separate C bindings, but an API to expose the C++ bindings via extern "C" functions and an opaque context struct would be a huge help.

I was eager to plug this into PostgreSQL and extend our existing dtrace/perf_sdt tracepoints with some context info so we could use them to create spans. But it's going to be pretty hard to do with a pure C++ codebase.

If I get the chance to write some minimal bindings I'll update here.

Expose interface to flush buffered spans

The tracer buffers closed span, only writing them out intermittently.

Sometimes the client will know it has something to send and want to flush it promptly.

I suggest extending the OpenTracing interface to expose an explicit Flush on jaegertracing::Tracer.

Happy to send a patch if you think it's reasonable.

License

Should I be using this license in my source code or is there something I should be changing it to?

/*
 * Copyright (c) 2017, Uber Technologies, Inc
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

traces not show up in jaeger-ui

Hello, everyone, my code:
#include

int main() {
auto config = jaegertracing::Config(
false,
jaegertracing::samplers::Config(jaegertracing::kSamplerTypeConst, 1),
jaegertracing::reporters::Config(
jaegertracing::reporters::Config::kDefaultQueueSize,
std::chrono::seconds(1), true));
auto tracer = jaegertracing::Tracer::make("wherearemyspans?", config);
auto span = tracer->StartSpan("abc");
span->Finish();
tracer->Close();
return 0;
}

Parsing YAML causes a segfault.

This code

#include <jaegertracing/Config.h>
#include <iostream>

const char* config = R"(
sampler:
  type: probabilistic
  param: .9999
)";

int main() {
  auto node = YAML::Load(config);
  try {
    auto c = jaegertracing::Config::parse(node);
  } catch (const std::exception& e) {
    std::cout << e.what() << "\n"; 
  }
  return 0;
}

causes a segfault. Here's the debugger trace

yans-MacBook-Pro:bug ryanburn$ lldb a.out
(lldb) target create "a.out"
Current executable set to 'a.out' (x86_64).
(lldb) run
Process 67113 launched: '/Users/ryanburn/test/dynamic-jaeger/bug/a.out' (x86_64)
Process 67113 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3)
    frame #0: 0x0000000100007540 a.out`boost::shared_ptr<YAML::detail::node_data>::operator->(this=0x0000000000000003) const at shared_ptr.hpp:734
   731
   732 	    typename boost::detail::sp_member_access< T >::type operator-> () const BOOST_SP_NOEXCEPT_WITH_ASSERT
   733 	    {
-> 734 	        BOOST_ASSERT( px != 0 );
   735 	        return px;
   736 	    }
   737
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3)
  * frame #0: 0x0000000100007540 a.out`boost::shared_ptr<YAML::detail::node_data>::operator->(this=0x0000000000000003) const at shared_ptr.hpp:734
    frame #1: 0x0000000100007515 a.out`YAML::detail::node_ref::type(this=0x0000000000000003) const at node_ref.h:24
    frame #2: 0x0000000100002ffd a.out`YAML::detail::node::type(this=0x0000000100503c50) const at node.h:29
    frame #3: 0x0000000100002f6d a.out`YAML::Node::Type(this=0x00007fff5fbfeca0) const at impl.h:79
    frame #4: 0x000000010000bdb5 a.out`YAML::Node::IsScalar(this=0x00007fff5fbfeca0) const at node.h:56
    frame #5: 0x000000010000bd59 a.out`YAML::convert<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >::decode(node=0x00007fff5fbfeca0, rhs="") at convert.h:63
    frame #6: 0x000000010000b5ec a.out`bool YAML::detail::node::equals<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(this=0x0000000100503c50, rhs="disabled", pMemory=YAML::detail::shared_memory_holder @ 0x00007fff5fbfef98) at impl.h:62
    frame #7: 0x000000010000b204 a.out`YAML::detail::node* YAML::detail::node_data::get<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(this=0x00000001005034b0, key="disabled", pMemory=YAML::detail::shared_memory_holder @ 0x00007fff5fbff220) const at impl.h:91
    frame #8: 0x000000010000acd1 a.out`YAML::detail::node* YAML::detail::node_ref::get<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(this=0x0000000100502880, key="disabled", pMemory=YAML::detail::shared_memory_holder @ 0x00007fff5fbff290) const at node_ref.h:63
    frame #9: 0x0000000100009331 a.out`YAML::detail::node* YAML::detail::node::get<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(this=0x0000000100503380, key="disabled", pMemory=YAML::detail::shared_memory_holder @ 0x00007fff5fbff320) const at node.h:126
    frame #10: 0x000000010000234a a.out`YAML::Node const YAML::Node::operator[]<char [9]>(this=0x00007fff5fbff9e8, key=<no value available>) [9]) const at impl.h:378
    frame #11: 0x0000000100001a99 a.out`bool jaegertracing::utils::yaml::findOrDefault<bool, char const (&) [9], bool>(node=0x00007fff5fbff9e8, key=<no value available>, defaultValue=0x00007fff5fbff5fe) [9], bool&&) at YAML.h:35
    frame #12: 0x0000000100000ed7 a.out`jaegertracing::Config::parse(configYAML=0x00007fff5fbff9e8) at Config.h:39
    frame #13: 0x000000010000086f a.out`main at main.cpp:13
    frame #14: 0x00007fff8d53a235 libdyld.dylib`start + 1
    frame #15: 0x00007fff8d53a235 libdyld.dylib`start + 1

Crossdock Java/Python issues

It seems crossdock with C++, Go, and either Java or Python will not pass. But if I use only C++ and Go, it does. A little debugging makes me think the issue is the connection handling. The C++ server is handwritten and does not handle keep-alive connections. It will not read EOF unless the socket is closed. For now, the crossdock docker-compose.yml only contains C++ and Go, but I would like to eventually add the others back once I have a chance to improve the connection handling.

Passing const char* typed nullptr to SetTag crashes tracer during send

Adding a tag with a null string value causes crashes deep in span sending.

The root cause of this crash is the equivalent of:

    const char *val = nullptr;
    span->SetTag("node_group_name", val);

resulting in:

#0  0x00007f3f3c39d286 in opentracing::v1::string_view::string_view (str=0x0, this=<optimized out>) at /usr/local/include/opentracing/string_view.h:59
#1  jaegertracing::Tag::ThriftVisitor::operator() (value=0x0, this=0x7f3f2e81e768) at /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/Tag.h:71
#2  opentracing::v1::util::detail::dispatcher<jaegertracing::Tag::ThriftVisitor&, opentracing::v1::Value, void, char const*, opentracing::v1::util::recursive_wrapper<std::vector<opentracing::v1::Value, std::allocator<opentracing::v1::Value> > >, opentracing::v1::util::recursive_wrapper<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, opentracing::v1::Value, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opentracing::v1::Value> > > > >::apply_const (v=..., f=...) at /usr/local/include/opentracing/variant/variant.hpp:304
#3  0x00007f3f3c39d324 in opentracing::v1::util::detail::dispatcher<jaegertracing::Tag::ThriftVisitor&, opentracing::v1::Value, void, decltype(nullptr), char const*, opentracing::v1::util::recursive_wrapper<std::vector<opentracing::v1::Value, std::allocator<opentracing::v1::Value> > >, opentracing::v1::util::recursive_wrapper<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, opentracing::v1::Value, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opentracing::v1::Value> > > > >::apply_const(opentracing::v1::Value const&, jaegertracing::Tag::ThriftVisitor&) (v=..., f=...) at /usr/local/include/opentracing/variant/variant.hpp:308
#4  0x00007f3f3c39d359 in opentracing::v1::util::detail::dispatcher<jaegertracing::Tag::ThriftVisitor&, opentracing::v1::Value, void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, decltype(nullptr), char const*, opentracing::v1::util::recursive_wrapper<std::vector<opentracing::v1::Value, std::allocator<opentracing::v1::Value> > >, opentracing::v1::util::recursive_wrapper<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, opentracing::v1::Value, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opentracing::v1::Value> > > > >::apply_const(opentracing::v1::Value const&, jaegertracing::Tag::ThriftVisitor&) (v=..., f=...) at /usr/local/include/opentracing/variant/variant.hpp:308
#5  0x00007f3f3c39d406 in opentracing::v1::util::detail::dispatcher<jaegertracing::Tag::ThriftVisitor&, opentracing::v1::Value, void, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, decltype(nullptr), char const*, opentracing::v1::util::recursive_wrapper<std::vector<opentracing::v1::Value, std::allocator<opentracing::v1::Value> > >, opentracing::v1::util::recursive_wrapper<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, opentracing::v1::Value, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opentracing::v1::Value> > > > >::apply_const(opentracing::v1::Value const&, jaegertracing::Tag::ThriftVisitor&) (v=..., f=...) at /usr/local/include/opentracing/variant/variant.hpp:308
#6  0x00007f3f3c39d454 in opentracing::v1::util::detail::dispatcher<jaegertracing::Tag::ThriftVisitor&, opentracing::v1::Value, void, long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, decltype(nullptr), char const*, opentracing::v1::util::recursive_wrapper<std::vector<opentracing::v1::Value, std::allocator<opentracing::v1::Value> > >, opentracing::v1::util::recursive_wrapper<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, opentracing::v1::Value, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opentracing::v1::Value> > > > >::apply_const(opentracing::v1::Value const&, jaegertracing::Tag::ThriftVisitor&) (v=..., f=...) at /usr/local/include/opentracing/variant/variant.hpp:308
#7  0x00007f3f3c39d4a2 in opentracing::v1::util::detail::dispatcher<jaegertracing::Tag::ThriftVisitor&, opentracing::v1::Value, void, double, long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, decltype(nullptr), char const*, opentracing::v1::util::recursive_wrapper<std::vector<opentracing::v1::Value, std::allocator<opentracing::v1::Value> > >, opentracing::v1::util::recursive_wrapper<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, opentracing::v1::Value, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opentracing::v1::Value> > > > >::apply_const(opentracing::v1::Value const&, jaegertracing::Tag::ThriftVisitor&) (v=..., f=...) at /usr/local/include/opentracing/variant/variant.hpp:308
#8  0x00007f3f3c39d4f8 in opentracing::v1::util::detail::dispatcher<jaegertracing::Tag::ThriftVisitor&, opentracing::v1::Value, void, bool, double, long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, decltype(nullptr), char const*, opentracing::v1::util::recursive_wrapper<std::vector<opentracing::v1::Value, std::allocator<opentracing::v1::Value> > >, opentracing::v1::util::recursive_wrapper<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, opentracing::v1::Value, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opentracing::v1::Value> > > > >::apply_const(opentracing::v1::Value const&, jaegertracing::Tag::ThriftVisitor&) (v=..., f=...) at /usr/local/include/opentracing/variant/variant.hpp:308
#9  0x00007f3f3c39d52e in opentracing::v1::util::variant<bool, double, long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, decltype(nullptr), char const*, opentracing::v1::util::recursive_wrapper<std::vector<opentracing::v1::Value, std::allocator<opentracing::v1::Value> > >, opentracing::v1::util::recursive_wrapper<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, opentracing::v1::Value, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opentracing::v1::Value> > > > >::visit<jaegertracing::Tag::ThriftVisitor&, opentracing::v1::Value, void>(opentracing::v1::Value const&, jaegertracing::Tag::ThriftVisitor&) (v=..., f=...) at /usr/local/include/opentracing/variant/variant.hpp:784
#10 0x00007f3f3c39d545 in opentracing::v1::util::apply_visitor<jaegertracing::Tag::ThriftVisitor&, opentracing::v1::Value> (f=..., v=...) at /usr/local/include/opentracing/variant/variant.hpp:863
#11 0x00007f3f3c39d822 in jaegertracing::Tag::thrift (this=0x7f3f28000980) at /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/Tag.h:55
#12 jaegertracing::Span::thrift() const::{lambda(jaegertracing::Tag const&)#2}::operator()(jaegertracing::Tag const&) const (tag=..., __closure=<synthetic pointer>) at /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/Span.h:139
#13 std::transform<__gnu_cxx::__normal_iterator<jaegertracing::Tag const*, std::vector<jaegertracing::Tag, std::allocator<jaegertracing::Tag> > >, std::back_insert_iterator<std::vector<jaegertracing::thrift::Tag, std::allocator<jaegertracing::thrift::Tag> > >, jaegertracing::Span::thrift() const::{lambda(jaegertracing::Tag const&)#2}>(__gnu_cxx::__normal_iterator<jaegertracing::Tag const*, std::vector<jaegertracing::Tag, std::allocator<jaegertracing::Tag> > >, std::back_insert_iterator<std::vector<jaegertracing::thrift::Tag, std::allocator<jaegertracing::thrift::Tag> > >, jaegertracing::Span::thrift() const::{lambda(jaegertracing::Tag const&)#2}, jaegertracing::Span::thrift() const::{lambda(jaegertracing::Tag const&)#2}) (__first=..., __last={_key = "\260\f\000(?\177\000\000\370\000\000(?\177\000\000\002\000\000\000\000\000\000\000h\033*\001", '\000' <repeats 28 times>, "h\n\000(?\177\000\000\006\000\000\000\000\000\000\000status\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\237}\273<?\177", '\000' <repeats 26 times>, "\220\000\000\000\000\000\000\000$\000\000\000\000\000\000\000", _value = {<opentracing::v1::util::variant<bool, double, long, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::nullptr_t, char const*, opentracing::v1::util::recursive_wrapper<std::vector<opentracing::v1::Value, std::allocator<opentracing::v1::Value> > >, opentracing::v1::util::recursive_wrapper<std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, opentracing::v1::Value, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, opentracing::v1::Value> > > > >> = {static data_size = 32, static data_align = 8, type_index = 2, data = {__data = "h\033*\001", '\000' <repeats 27 times>, __align = {<No data fields>}}}, <No data fields>}}, __result=__result@entry=..., __unary_op=...) at /usr/include/c++/6.4.1/bits/stl_algo.h:4177
#14 0x00007f3f3c39a2a3 in jaegertracing::Span::thrift (this=0x7f3f2e81eda0) at /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/Span.h:139
#15 jaegertracing::UDPTransport::append (this=0x12a85b0, span=...) at /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/UDPTransport.cpp:83
#16 0x00007f3f3c3c97c0 in jaegertracing::reporters::RemoteReporter::sendSpan (this=this@entry=0x1288d40, span=...) at /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/reporters/RemoteReporter.cpp:111
#17 0x00007f3f3c3ca2d5 in jaegertracing::reporters::
[gdb.txt](https://github.com/jaegertracing/cpp-client/files/1702162/gdb.txt)
RemoteReporter::sweepQueue (this=0x1288d40) at /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/reporters/RemoteReporter.cpp:94
#18 0x00007f3f3c3ca7c7 in jaegertracing::reporters::RemoteReporter::<lambda()>::operator() (__closure=<optimized out>) at /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/reporters/RemoteReporter.cpp:45
#19 std::_Bind_simple<jaegertracing::reporters::RemoteReporter::RemoteReporter(const duration&, int, std::unique_ptr<jaegertracing::Transport>&&, jaegertracing::logging::Logger&, jaegertracing::metrics::Metrics&)::<lambda()>()>::_M_invoke<> (this=<optimized out>) at /usr/include/c++/6.4.1/functional:1391
#20 std::_Bind_simple<jaegertracing::reporters::RemoteReporter::RemoteReporter(const duration&, int, std::unique_ptr<jaegertracing::Transport>&&, jaegertracing::logging::Logger&, jaegertracing::metrics::Metrics&)::<lambda()>()>::operator() (this=<optimized out>) at /usr/include/c++/6.4.1/functional:1380
#21 std::thread::_State_impl<std::_Bind_simple<jaegertracing::reporters::RemoteReporter::RemoteReporter(const duration&, int, std::unique_ptr<jaegertracing::Transport>&&, jaegertracing::logging::Logger&, jaegertracing::metrics::Metrics&)::<lambda()>()> >::_M_run(void) (this=<optimized out>) at /usr/include/c++/6.4.1/thread:197
#22 0x00007f3f3c04476f in std::execute_native_thread_routine (__p=0x1288eb0) at ../../../../../libstdc++-v3/src/c++11/thread.cc:83
#23 0x00007f3f4482273a in start_thread () from /lib64/libpthread.so.0
#24 0x00007f3f43e47e0f in clone () from /lib64/libc.so.6

(gdb) frame 1
#1  jaegertracing::Tag::ThriftVisitor::operator() (value=0x0, this=0x7f3f2e81e768) at /home/craig/projects/2Q/opentracing-jaeger-cpp-client/src/jaegertracing/Tag.h:71
71	        void operator()(const char* value) const { setString(value); }
(gdb) p this->_tag
$5 = (jaegertracing::thrift::Tag &) @0x7f3f2e81e770: {
  _vptr.Tag = 0x7f3f3c643d08 <vtable for jaegertracing::thrift::Tag+16>, 
  static ascii_fingerprint = 0x7f3f3c41f4c0 "8582F6F2F042EBCA6A59AF229BC83A19", 
  static binary_fingerprint = "\205\202\366\362\360B\353\312jY\257\"\233\310:\031", 
  key = "node_group_name", 
  vType = jaegertracing::thrift::TagType::STRING, 
  vStr = "", 
  vDouble = 0, 
  vBool = false, 
  vLong = 0, 
  vBinary = "", 
  __isset = {
    vStr = false, 
    vDouble = false, 
    vBool = false, 
    vLong = false, 
    vBinary = false
  }
}

TJSONProtocol is not the same as JSON serialization

Need to stop using TJSONProtocol in place of JSON serialization.

Example of serialized Thrift StartTraceRequest in TJSONProtocol:

{"1":{"str":"S1"},"2":{"tf":1},"3":{"str":"30f03cd6cce1ba72"},"4":{"rec":{"1":{"str":"cpp"},"2":{"str":"S2"},"3":{"str":"cpp"},"4":{"str":"8081"},"5":{"i32":0}}}}

Need to migrate to new cache repo

Since this project uses Hunter, every clean build requires a full rebuild of all dependencies (Boost, Thrift, OpenSSL, Bison, Flex, etc.). However, Hunter caches built dependencies and can upload them to a GitHub repository. The next time a user tries a clean build with the same build tools/options, Hunter will detect a cache hit and download the dependency instead of rebuilding it from scratch. Using Hunter's caching significantly speeds up Travis builds. As of now, I have been using https://github.com/isaachier/cpp-client-hunter-cache to cache the dependencies, but it seems more appropriate for jaegertracing to own this repository. I think @black-adder helped me create https://github.com/jaegertracing/cpp-client-hunter-cache, but I still need credentials for my .travis.yml to upload to that repository.

Jaeger's shared lib links to the opentracing static lib

Opentracing builds its shared lib with -fPIC and its static lib without (see opentracing/opentracing-cpp#49).

Jaeger links to the opentracing static lib from the Jaeger shared lib. That's a very weird thing to do in the first place, and becomes a problem when building against a local default opentracing install that has a non-PIC static lib.

Jaeger should really just link to the opentracing shared lib from its own shared lib and let the dynamic loader take care of the opentracing lib on demand. Please.

MacOs gcc/clang error

Hello, everyone.When i use Eclipse to build c++ code ,that is ok.But in terminal there is link error.

clang++ -std=c++11 AMQPClientSend.cpp -o send -lSimpleAmqpClient -lopentracing -lcurl -ljaegertracing -v
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name AMQPClientSend.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.1 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/xujie/Desktop/C_Project/AMQP_Opentrainc/src -ferror-limit 19 -fmessage-length 117 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/8h/yw85sq4j5mjf9q19rm24vv340000gn/T/AMQPClientSend-b52538.o -x c++ AMQPClientSend.cpp
clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin15.6.0
ignoring nonexistent directory "/usr/include/c++/v1"
#include "..." search starts here:
#include <...> search starts here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 -o send /var/folders/8h/yw85sq4j5mjf9q19rm24vv340000gn/T/AMQPClientSend-b52538.o -lSimpleAmqpClient -lopentracing -lcurl -ljaegertracing -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
"TraceSingleton::getInstance()", referenced from:
CreateTrace(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in AMQPClientSend-b52538.o
"TraceSingleton::CreateTracer(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, opentracing::v1::Value, std::__1::less<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, opentracing::v1::Value> > >, std::initializer_list<std::__1::pair<opentracing::v1::string_view, opentracing::v1::Value> >, std::__1::map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > > >, DHTracer*)", referenced from:
CreateTrace(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in AMQPClientSend-b52538.o
"TraceSingleton::SendContextWithRequest()", referenced from:
CreateTrace(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >) in AMQPClientSend-b52538.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Document how to specify agent/collector endpoint

Hey guys

I'm trying to add jaegertracing to a C++ microservice running on an Istio mesh.

I got working the example app but I can't find a way to specify what is the collector endpoint the app will use to send the spans/traces and the only loggers I see defined do nothing or just print on screen the messages.

Can someone tell me what would be the config parameter that defines the collector to use?
Or point me to some working example/documentation to use as a guide?

Thanks for you help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.