-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[sampling] Fix merging of per-operation strategies into service strategies without them #5277
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bce0053
Fix for #5270 - return default probabilistic operation level strategi…
kuujis 19a9c60
Updated unit tests to load expected responses from fixtures folder
kuujis cd75115
Renamed fixture files, updated expected sampling probabilities to avo…
kuujis 202b52e
Added JSON regeneration flag, addressed MR comments
kuujis 030d19a
simplify
yurishkuro bffcb91
Merge branch 'main' into otel_5504_issue_fix
yurishkuro 39f2859
reformat
yurishkuro 62b7b08
refactor and document the code better
yurishkuro 5eadac5
remove commented out code
yurishkuro db352a3
Merge branch 'main' into otel_5504_issue_fix
yurishkuro 7b1dec3
Fix for #5270 is disabled by default. Added a switch for enabling via…
kuujis 4954a13
Reintroduced original function until deprecation, moved deprecation w…
kuujis 1391866
Clarified flag message.
kuujis d7377db
Added handling for missing strategies source and strategies not being…
kuujis 2171073
Merge branch 'main' into otel_5504_issue_fix
yurishkuro db54fd0
Added parameterised tests to ensure code coverage.
kuujis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...store/static/fixtures/TestServiceNoPerOperationStrategiesDeprecatedBehavior_ServiceA.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "probabilisticSampling": { | ||
| "samplingRate": 1 | ||
| }, | ||
| "operationSampling": { | ||
| "defaultSamplingProbability": 1, | ||
| "perOperationStrategies": [ | ||
| { | ||
| "operation": "/health", | ||
| "probabilisticSampling": { | ||
| "samplingRate": 0.1 | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } |
6 changes: 6 additions & 0 deletions
6
...store/static/fixtures/TestServiceNoPerOperationStrategiesDeprecatedBehavior_ServiceB.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "strategyType": 1, | ||
| "rateLimitingSampling": { | ||
| "maxTracesPerSecond": 3 | ||
| } | ||
| } |
16 changes: 16 additions & 0 deletions
16
.../sampling/strategystore/static/fixtures/TestServiceNoPerOperationStrategies_ServiceA.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "probabilisticSampling": { | ||
| "samplingRate": 1 | ||
| }, | ||
| "operationSampling": { | ||
| "defaultSamplingProbability": 1, | ||
| "perOperationStrategies": [ | ||
| { | ||
| "operation": "/health", | ||
| "probabilisticSampling": { | ||
| "samplingRate": 0.1 | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } |
17 changes: 17 additions & 0 deletions
17
.../sampling/strategystore/static/fixtures/TestServiceNoPerOperationStrategies_ServiceB.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "strategyType": 1, | ||
| "rateLimitingSampling": { | ||
| "maxTracesPerSecond": 3 | ||
| }, | ||
| "operationSampling": { | ||
| "defaultSamplingProbability": 0.2, | ||
| "perOperationStrategies": [ | ||
| { | ||
| "operation": "/health", | ||
| "probabilisticSampling": { | ||
| "samplingRate": 0.1 | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } |
50 changes: 25 additions & 25 deletions
50
plugin/sampling/strategystore/static/fixtures/service_no_per_operation.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,25 @@ | ||
| { | ||
| "service_strategies": [ | ||
| { | ||
| "service": "ServiceA", | ||
| "type": "probabilistic", | ||
| "param": 1.0 | ||
| }, | ||
| { | ||
| "service": "ServiceB", | ||
| "type": "ratelimiting", | ||
| "param": 3 | ||
| } | ||
| ], | ||
| "default_strategy": { | ||
| "type": "probabilistic", | ||
| "param": 0.2, | ||
| "operation_strategies": [ | ||
| { | ||
| "operation": "/health", | ||
| "type": "probabilistic", | ||
| "param": 0.0 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| { | ||
| "service_strategies": [ | ||
| { | ||
| "service": "ServiceA", | ||
| "type": "probabilistic", | ||
| "param": 1.0 | ||
| }, | ||
| { | ||
| "service": "ServiceB", | ||
| "type": "ratelimiting", | ||
| "param": 3 | ||
| } | ||
| ], | ||
| "default_strategy": { | ||
| "type": "probabilistic", | ||
| "param": 0.2, | ||
| "operation_strategies": [ | ||
| { | ||
| "operation": "/health", | ||
| "type": "probabilistic", | ||
| "param": 0.1 | ||
| } | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.