Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Add language prefix to Jaeger client version tag
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Hier <isaachier@gmail.com>
  • Loading branch information
isaachier committed Dec 17, 2017
1 parent bd39a6a commit b8c769a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/jaegertracing/Constants.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
11 changes: 11 additions & 0 deletions src/jaegertracing/TracerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ TEST(Tracer, testTracer)
const auto tracer =
std::static_pointer_cast<Tracer>(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<const char*>());
ASSERT_EQ("C++-",
static_cast<std::string>(tagItr->value().get<const char*>()).substr(0, 4));

opentracing::StartSpanOptions options;
options.tags.push_back({ "tag-key", 1.23 });

Expand Down

0 comments on commit b8c769a

Please sign in to comment.