-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[sampling] Fix merging of per-operation strategies into service strategies without them #5277
Conversation
…evel strategies for ratelimiting service configurations Signed-off-by: Kazimieras Pociunas <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it's been quite a while since this code was written, and I am not able to follow either your change or your unit test changes. I would recommend unit tests to be structured as follows:
- define config file
- execute request to retrieve sampling strategy for a service
- compare it with a pre-constructed response that is easy to read
Steps 1 and 3 are best described via JSON docs under /fixtures, or embedded JSON strings
afb0684
to
f1f30c4
Compare
After looking over the test - extracting expected response to separate file makes things a lot more readable :) |
Signed-off-by: Kazimieras Pociunas <[email protected]>
f1f30c4
to
19a9c60
Compare
plugin/sampling/strategystore/static/fixtures/probablistic_with_default_operation_strategy.json
Outdated
Show resolved
Hide resolved
plugin/sampling/strategystore/static/fixtures/probablistic_with_default_operation_strategy.json
Outdated
Show resolved
Hide resolved
…id being treated as empty during marshaling/unmarshaling Signed-off-by: Kazimieras Pociunas <[email protected]>
Thank you for the comments, I will address them, but I'm a bit swamped with life things, so this gets a bit of a back seat for now :( |
Signed-off-by: Kazimieras Pociunas <[email protected]>
71dc343
to
202b52e
Compare
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5277 +/- ##
==========================================
+ Coverage 95.20% 95.22% +0.02%
==========================================
Files 343 343
Lines 16777 16813 +36
==========================================
+ Hits 15972 16010 +38
Misses 606 606
+ Partials 199 197 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
… enabling via sampling.strategies.bugfix-5270=true. Signed-off-by: Kazimieras Pociunas <[email protected]>
…arning to constructor, updated test names Signed-off-by: Kazimieras Pociunas <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: Kazimieras Pociunas <[email protected]>
… available in the provided source, updated warning messages per MR suggestions. Signed-off-by: Kazimieras Pociunas <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
please revert ui submodule change, it's not related
|
Signed-off-by: Kazimieras Pociunas <[email protected]>
295376d
to
db54fd0
Compare
Done, sorry, should not have happened. |
I edited description to NOT resolve the issue, to make sure we do the follow-ups. |
…egies without them (jaegertracing#5277) ## Which problem is this PR solving? - Part 1 of [jaegertracing#5270] ## Description of the changes - See issue for description of the bug and of the two changed behaviors - Default `probabilistic` operation level strategies will now be returned if service strategy is of `ratelimiting` type - If the service itself has `probabilistic` strategy, its sampling rate takes priority for operation-level definition ## How was this change tested? - Via updated unit test - By building local all-in-one executable and using it as a otel instrumentation backend for simple java service https://github.com/kuujis/opentelemetry-java-5504 and using the below `sampling_strategies.json` from open-telemetry/opentelemetry-java#5504 ``` { "service_strategies": [ { "service": "foobar", "type": "ratelimiting", "param": 2 } ], "default_strategy": { "type": "probabilistic", "param": 0.2, "operation_strategies": [ { "operation": "metrics", "type": "probabilistic", "param": 0.0 } ] } } ``` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Kazimieras Pociunas <[email protected]> Signed-off-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: Vamshi Maskuri <[email protected]>
Which problem is this PR solving?
Description of the changes
probabilistic
operation level strategies will now be returned if service strategy is ofratelimiting
typeprobabilistic
strategy, its sampling rate takes priority for operation-level definitionHow was this change tested?
sampling_strategies.json
from JaegerRemoteSampler inconsistent Implementation open-telemetry/opentelemetry-java#5504Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test