Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename JAEGER_SAMPLER_MANAGER_HOST_PORT to JAEGER_CONFIG_MANAGER_HOST_PORT #325

Closed
wants to merge 2 commits into from

Conversation

masroorhasan
Copy link

Which problem is this PR solving?

Resolves #282

Short description of the changes

Renames the environment variable JAEGER_SAMPLER_MANAGER_HOST_PORT to JAEGER_CONFIG_MANAGER_HOST_PORT to denote the endpoint is not just for setting sampling server but rather is the endpoint for remote sampling configuration.

Signed-off-by: Masroor Hasan masroor.hasan.n@gmail.com

…_PORT

Fixes: jaegertracing#282
Signed-off-by: Masroor Hasan <masroor.hasan.n@gmail.com>
@codecov
Copy link

codecov bot commented Aug 20, 2018

Codecov Report

Merging #325 into master will decrease coverage by 0.08%.
The diff coverage is 40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #325      +/-   ##
==========================================
- Coverage   87.14%   87.06%   -0.09%     
==========================================
  Files          54       54              
  Lines        2988     2992       +4     
==========================================
+ Hits         2604     2605       +1     
- Misses        272      274       +2     
- Partials      112      113       +1
Impacted Files Coverage Δ
config/config.go 93.19% <ø> (ø) ⬆️
config/config_env.go 97.27% <40%> (-2.73%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 252d853...0823bd0. Read the comment docs.

Signed-off-by: Masroor Hasan <masroor.hasan.n@gmail.com>
Copy link
Contributor

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, LGTM.

There's one open question, about renaming the SamplerConfig's property and there are a couple of minor things that could be improved.

@@ -72,7 +72,7 @@ type SamplerConfig struct {
Param float64 `yaml:"param"`

// SamplingServerURL is the address of jaeger-agent's HTTP sampling server
// Can be set by exporting an environment variable named JAEGER_SAMPLER_MANAGER_HOST_PORT
// Can be set by exporting an environment variable named JAEGER_CONFIG_MANAGER_HOST_PORT
SamplingServerURL string `yaml:"samplingServerURL"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this property should be changed as well. Similarly, this should be backwards compatible.

cc @yurishkuro

} else {
// deprecated
if e = os.Getenv(envSamplerManagerHostPort); e != "" {
jaeger.StdLogger.Infof("deprecated: Please use JAEGER_CONFIG_MANAGER_HOST_PORT")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is deprecated? :) How about something like:

JAEGER_SAMPLER_MANAGER_HOST_PORT was used but is deprecated. Use JAEGER_CONFIG_MANAGER_HOST_PORT instead.

@@ -116,9 +116,11 @@ func TestNoServiceNameFromEnv(t *testing.T) {

func TestSamplerConfigFromEnv(t *testing.T) {
// prepare
testMgrHostPort := "http://themaster:80"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous version of the test didn't have the port. Usually, it's better to leave this as it was, to make sure the previous behavior is kept.

os.Setenv(envSamplerType, "const")
os.Setenv(envSamplerParam, "1")
os.Setenv(envSamplerManagerHostPort, "http://themaster")
os.Setenv(envConfigManagerHostPort, testMgrHostPort)
os.Setenv(envSamplerManagerHostPort, testMgrHostPort) // deprecated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a new test, where the new option isn't set but the old one is?

@@ -59,7 +59,8 @@ JAEGER_REPORTER_MAX_QUEUE_SIZE | The reporter's maximum queue size
JAEGER_REPORTER_FLUSH_INTERVAL | The reporter's flush interval (ms)
JAEGER_SAMPLER_TYPE | The sampler type
JAEGER_SAMPLER_PARAM | The sampler parameter (number)
JAEGER_SAMPLER_MANAGER_HOST_PORT | The host name and port when using the remote controlled sampler
JAEGER_SAMPLER_MANAGER_HOST_PORT | The host name and port when using the remote controlled sampler (deprecated, use JAEGER_CONFIG_MANAGER_HOST_PORT)
JAEGER_CONFIG_MANAGER_HOST_PORT | The host name and port when using remote sampling configuration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to #326, the variable is actually a URL, not a host:port string. Similar to JAEGER_ENDPOINT, we can call this JAEGER_CONFIG_ENDPOINT.

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per jaegertracing/jaeger#1849, we want to go with the name JAEGER_SAMPLING_ENDPOINT.

@yurishkuro
Copy link
Member

Addressed by #511

@yurishkuro yurishkuro closed this May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename JAEGER_SAMPLER_MANAGER_HOST_PORT to JAEGER_SAMPLING_ENDPOINT
3 participants