Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Print error on Sampler Query failure #328

Merged
merged 1 commit into from
Sep 3, 2018

Conversation

gouthamve
Copy link
Contributor

Fixes #327

@codecov
Copy link

codecov bot commented Aug 29, 2018

Codecov Report

Merging #328 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #328      +/-   ##
==========================================
+ Coverage   87.14%   87.21%   +0.07%     
==========================================
  Files          54       54              
  Lines        2988     2989       +1     
==========================================
+ Hits         2604     2607       +3     
+ Misses        272      271       -1     
+ Partials      112      111       -1
Impacted Files Coverage Δ
sampler.go 94.69% <100%> (+0.84%) ⬆️

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...dbafe64. Read the comment docs.

sampler.go Outdated
@@ -511,6 +511,7 @@ func (s *RemotelyControlledSampler) updateSampler() {
res, err := s.manager.GetSamplingStrategy(s.serviceName)
if err != nil {
s.metrics.SamplerQueryFailure.Inc(1)
s.logger.Infof("Unable to query sampling strategy. Got error: %v", err)
Copy link
Member

Choose a reason for hiding this comment

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

simplify the message: s.logger.Infof("Unable to query sampling strategy: %v", err)

can you add a unit test?

Copy link
Member

Choose a reason for hiding this comment

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

e.g.

if s.logger.String() == expectedLogs {

Copy link
Member

Choose a reason for hiding this comment

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

preferably use string.Contains()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :)

Signed-off-by: Goutham Veeramachaneni <[email protected]>
@yurishkuro
Copy link
Member

Thanks!

@yurishkuro yurishkuro merged commit 24c9ca5 into jaegertracing:master Sep 3, 2018
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.

2 participants