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

Enable service default sampling param #2230

Merged
merged 5 commits into from
May 10, 2020

Conversation

defool
Copy link
Contributor

@defool defool commented May 7, 2020

Signed-off-by: defool [email protected]

Which problem is this PR solving?

Short description of the changes

  • Use service's sampling param event though it has no per-operation strategies.

@defool defool requested a review from a team as a code owner May 7, 2020 16:04
@defool defool requested a review from pavolloffay May 7, 2020 16:04
@defool defool force-pushed the hotfix/use_service_strategies branch from 6922f1b to e457add Compare May 8, 2020 03:29
@codecov
Copy link

codecov bot commented May 9, 2020

Codecov Report

Merging #2230 into master will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2230      +/-   ##
==========================================
- Coverage   96.18%   96.16%   -0.02%     
==========================================
  Files         219      219              
  Lines       10635    10640       +5     
==========================================
+ Hits        10229    10232       +3     
- Misses        351      352       +1     
- Partials       55       56       +1     
Impacted Files Coverage Δ
...in/sampling/strategystore/static/strategy_store.go 100.00% <100.00%> (ø)
cmd/query/app/server.go 91.78% <0.00%> (-2.74%) ⬇️

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 0378e5b...c3e6f1a. Read the comment docs.

}
// Service has no per-operation strategies, so just reference the default settings and change default samplingRate.
newOpS := *newStore.defaultStrategy.OperationSampling
newOpS.DefaultSamplingProbability = newStore.serviceStrategies[s.Service].ProbabilisticSampling.SamplingRate
Copy link
Member

Choose a reason for hiding this comment

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

is it possible that newStore.serviceStrategies[s.Service].ProbabilisticSampling == nil here?

Copy link
Member

Choose a reason for hiding this comment

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

For example, in plugin/sampling/strategystore/static/fixtures/operation_strategies.json there is

    {
      "service": "bar",
      "type": "ratelimiting",
      "param": 5,
      ...

Copy link
Member

Choose a reason for hiding this comment

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

Side node: this type was a mistake introduced in the past:

// operationStrategy defines an operation specific sampling strategy.
type operationStrategy struct {
        Operation string `json:"operation"`
        strategy
}

because operations can only use probabilistic strategy (example), so this generalized schema allows things that clients can't understand. Similarly, if service-level strategy contains per-operation instructions, then the top-level strategy can only be probabilistic (default sampler in the example).

@yurishkuro yurishkuro merged commit 2ea2be9 into jaegertracing:master May 10, 2020
@defool defool deleted the hotfix/use_service_strategies branch May 11, 2020 04:21
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.

sampler.param shows defaultSamplingProbability instead of samplingRate
2 participants