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

Update default samplingServerURL to include /sampling path #158

Merged

Conversation

JorritSalverda
Copy link
Contributor

@JorritSalverda JorritSalverda commented May 23, 2019

Resolves #157

Signed-off-by: Jorrit Salverda jorrit.salverda@gmail.com

Which problem is this PR solving?

The default sampling server url misses the /sampling path, which leads to an incorrect response and inability to use remote configuration.

Short description of the changes

Updated the default url and added a test.

Fixes issue jaegertracing#157

Signed-off-by: Jorrit Salverda <jorrit.salverda@gmail.com>
By asserting against a static string the test will fail if the value changes, while otherwise it would not

Signed-off-by: Jorrit Salverda <jsalverda@travix.com>
@JorritSalverda
Copy link
Contributor Author

I have no experience writing C++, so let me know if I do something unusual for the language. Although there's hardly any coding involved :)

@yurishkuro
Copy link
Member

Have you tested it against Jaeger server? I don't think the crossdock integration test in this repo actually tests polling for sampling strategies, it only tests spans submission. I believe there is a difference between / and /sampling endpoints in the returned data format.

@hiruna
Copy link

hiruna commented Jul 8, 2019

hi can we get this merged ?

@yurishkuro
Copy link
Member

I would like to see some proof of testing with the agent.

@hiruna
Copy link

hiruna commented Jul 8, 2019

@yurishkuro , there is a difference between / and /sampling (correct me if im wrong), / returns the default value for a remote sampler, which is probabilistic | 0.5 this was mentioned in #157

@yurishkuro
Copy link
Member

The difference is not in the semantics of the response but in the format of the data, how the thrift enums were encoded into json (numbers instead of strings).

@skwiffhub
Copy link

skwiffhub commented Sep 12, 2019

@yurishkuro Is this fix going to be merged at some point? During our debugging using the 0.5.0 jaeger-client-cpp, we observe exactly what @JorritSalverda described in #157:

Using samplingServerURL of http://127.0.0.1:5778 results in an HTTP response from the sampling server containing this JSON:

{"strategyType":0,"probabilisticSampling":{"samplingRate":0.001}}

which results in the client hitting the exception at line 1352 of include/nlohmann/json.hpp (v3.6.1):

        JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name())));

Whereas using samplingServerURL of http://127.0.0.1:5778/sampling results in:

{"strategyType":"PROBABILISTIC","probabilisticSampling":{"samplingRate":0.001}}

No exception occurs and the JSON is parsed and the sampling rate updated properly.

Based on the RemoteSamplingJSON.h implementation, it appears to only support strategyType of "PROBABILISTIC".

@yurishkuro
Copy link
Member

@skwiffhub are you able to test with the fix in this PR and confirm that it works?

@AppVeyorBot
Copy link

@skwiffhub
Copy link

@yurishkuro Yes, thanks, we were able to test with the fix. We did not verify the ConfigTest.cpp portion of the commit though.

One other thing to check for is sample instances of config.yml files that contain samplingServerURL and make sure they are updated to reflect what is in the current source code.

@yurishkuro
Copy link
Member

@skwiffhub thanks for the confirmation, I will merge it. I am not too concerned with config test because it actually has a unit test, but there's no integration test with the real agent.

@yurishkuro yurishkuro merged commit b083108 into jaegertracing:master Sep 13, 2019
@yurishkuro
Copy link
Member

Thanks for the PR, @JorritSalverda

@hiruna
Copy link

hiruna commented Sep 17, 2019

Is this going to be released soon ? @yurishkuro

@hiruna
Copy link

hiruna commented Oct 13, 2019

any update on this @yurishkuro @JorritSalverda

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default sampling server url misses /sampling path
5 participants