diff --git a/src/jaegertracing/Constants.h.in b/src/jaegertracing/Constants.h.in index f6292d1d..c5b90f55 100644 --- a/src/jaegertracing/Constants.h.in +++ b/src/jaegertracing/Constants.h.in @@ -21,7 +21,7 @@ namespace jaegertracing { -static constexpr auto kJaegerClientVersion = "@PROJECT_VERSION@"; +static constexpr auto kJaegerClientVersion = "C++-@PROJECT_VERSION@"; static constexpr auto kJaegerClientVersionTagKey = "jaeger.version"; static constexpr auto kJaegerDebugHeader = "jaeger-debug-id"; static constexpr auto kJaegerBaggageHeader = "jaeger-baggage"; diff --git a/src/jaegertracing/TracerTest.cpp b/src/jaegertracing/TracerTest.cpp index 7d352d98..30290d23 100644 --- a/src/jaegertracing/TracerTest.cpp +++ b/src/jaegertracing/TracerTest.cpp @@ -122,6 +122,17 @@ TEST(Tracer, testTracer) const auto tracer = std::static_pointer_cast(opentracing::Tracer::Global()); + auto tagItr = + std::find_if(std::begin(tracer->tags()), + std::end(tracer->tags()), + [](const Tag& tag) { + return tag.key() == kJaegerClientVersionTagKey; + }); + ASSERT_NE(std::end(tracer->tags()), tagItr); + ASSERT_TRUE(tagItr->value().is()); + ASSERT_EQ("C++-", + static_cast(tagItr->value().get()).substr(0, 4)); + opentracing::StartSpanOptions options; options.tags.push_back({ "tag-key", 1.23 });