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

Commit 99d5602

Browse files
authored
Add language prefix to Jaeger client version tag (#35)
Signed-off-by: Isaac Hier <[email protected]>
1 parent bd39a6a commit 99d5602

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/jaegertracing/Constants.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
namespace jaegertracing {
2323

24-
static constexpr auto kJaegerClientVersion = "@PROJECT_VERSION@";
24+
static constexpr auto kJaegerClientVersion = "C++-@PROJECT_VERSION@";
2525
static constexpr auto kJaegerClientVersionTagKey = "jaeger.version";
2626
static constexpr auto kJaegerDebugHeader = "jaeger-debug-id";
2727
static constexpr auto kJaegerBaggageHeader = "jaeger-baggage";

src/jaegertracing/TracerTest.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ TEST(Tracer, testTracer)
122122
const auto tracer =
123123
std::static_pointer_cast<Tracer>(opentracing::Tracer::Global());
124124

125+
auto tagItr =
126+
std::find_if(std::begin(tracer->tags()),
127+
std::end(tracer->tags()),
128+
[](const Tag& tag) {
129+
return tag.key() == kJaegerClientVersionTagKey;
130+
});
131+
ASSERT_NE(std::end(tracer->tags()), tagItr);
132+
ASSERT_TRUE(tagItr->value().is<const char*>());
133+
ASSERT_EQ("C++-",
134+
static_cast<std::string>(tagItr->value().get<const char*>()).substr(0, 4));
135+
125136
opentracing::StartSpanOptions options;
126137
options.tags.push_back({ "tag-key", 1.23 });
127138

0 commit comments

Comments
 (0)