-
Notifications
You must be signed in to change notification settings - Fork 0
Sampling test #16
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
base: master
Are you sure you want to change the base?
Sampling test #16
Conversation
With sampling we can reduce the tracing overhead by limiting the
percentage of requests that are traced.
Since Jaeger's sampling functionality does not ignore the
instrumentation code we had to implement our own sampling.
This is done by generating a thread local random every time we call
addToTrace and if this value is below the sampling threshold a baggage
item ("sampled" : "True") is added to the span. From then on if the
active span's baggage does not contain that item, the instrumentation
code will be ignored and when necessary Noop versions of Span, Scope and
SpanContext are returned.
Codecov Report
@@ Coverage Diff @@
## master #16 +/- ##
============================================
- Coverage 71.27% 60.17% -11.1%
- Complexity 90 92 +2
============================================
Files 7 16 +9
Lines 369 452 +83
Branches 23 25 +2
============================================
+ Hits 263 272 +9
- Misses 85 150 +65
- Partials 21 30 +9
Continue to review full report at Codecov.
|
|
There might be a small issue with this pull request as it relies on the OpenTracing Noop implementation which isn't public (the API is, but the implementation classes aren't) so I had to download the code from their Github and include it in ours (making the implementation classes public in the process). Not sure how licensing works here but they use Apache 2.0 as far as I know. |
Codecov Report
@@ Coverage Diff @@
## master #16 +/- ##
============================================
- Coverage 71.27% 60.17% -11.1%
- Complexity 90 92 +2
============================================
Files 7 16 +9
Lines 369 452 +83
Branches 23 25 +2
============================================
+ Hits 263 272 +9
- Misses 85 150 +65
- Partials 21 30 +9
Continue to review full report at Codecov.
|
With sampling we can reduce the tracing overhead by limiting the
percentage of requests that are traced.
Since Jaeger's sampling functionality does not ignore the
instrumentation code we had to implement our own sampling.
This is done by generating a thread local random every time we call
addToTrace and if this value is below the sampling threshold a baggage
item ("sampled" : "True") is added to the span. From then on if the
active span's baggage does not contain that item, the instrumentation
code will be ignored and when necessary Noop versions of Span, Scope and
SpanContext are returned.