From b08310803dcddf3b3ad08de37e8b0d5e48b514c5 Mon Sep 17 00:00:00 2001 From: Jorrit Salverda Date: Fri, 13 Sep 2019 19:58:11 +0200 Subject: [PATCH] Update default samplingServerURL to include /sampling path (#158) * Update default samplingServerURL to include /sampling path Fixes issue https://github.com/jaegertracing/jaeger-client-cpp/issues/157 Signed-off-by: Jorrit Salverda * Improve test for default sampling server url By asserting against a static string the test will fail if the value changes, while otherwise it would not Signed-off-by: Jorrit Salverda --- README.md | 2 +- src/jaegertracing/ConfigTest.cpp | 6 ++++++ src/jaegertracing/samplers/Config.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5c2d441d..f39b54a0 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ NOTE: It is not recommended to use a remote host for UDP connections. ### Updating Sampling Server URL -The default sampling collector URL is `http://127.0.0.1:5778`. Similar to UDP address above, you can use a different URL by updating the sampler configuration. +The default sampling collector URL is `http://127.0.0.1:5778/sampling`. Similar to UDP address above, you can use a different URL by updating the sampler configuration. ```yml sampler: diff --git a/src/jaegertracing/ConfigTest.cpp b/src/jaegertracing/ConfigTest.cpp index 79822508..1079cc97 100644 --- a/src/jaegertracing/ConfigTest.cpp +++ b/src/jaegertracing/ConfigTest.cpp @@ -73,6 +73,12 @@ TEST(Config, testDefaultSamplingProbability) Config().sampler().param()); } +TEST(Config, testDefaultSamplingServerURL) +{ + ASSERT_EQ("http://127.0.0.1:5778/sampling", + Config().sampler().samplingServerURL()); +} + TEST(Config, testZeroSamplingParam) { { diff --git a/src/jaegertracing/samplers/Config.h b/src/jaegertracing/samplers/Config.h index 008d60cc..f349cbce 100644 --- a/src/jaegertracing/samplers/Config.h +++ b/src/jaegertracing/samplers/Config.h @@ -42,7 +42,7 @@ class Config { static constexpr auto kDefaultSamplingProbability = static_cast(0.001); - static constexpr auto kDefaultSamplingServerURL = "http://127.0.0.1:5778"; + static constexpr auto kDefaultSamplingServerURL = "http://127.0.0.1:5778/sampling"; static constexpr auto kDefaultMaxOperations = 2000; static Clock::duration defaultSamplingRefreshInterval()