-
Notifications
You must be signed in to change notification settings - Fork 625
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
Clean up ProbabilitySampler for 64 bit trace IDs #238
Conversation
This change because mypy isn't willing to believe the exponent is always positive. See python/typeshed#285.
I reverted most of the changes in f2251ea now that we've decided to use the low bits for sampling decisions for compatibility with 64 bit trace IDs in w3c/trace-context#349. This is now mostly a cosmetic and testing change. |
Codecov Report
@@ Coverage Diff @@
## master #238 +/- ##
=========================================
Coverage ? 85.32%
=========================================
Files ? 38
Lines ? 1956
Branches ? 231
=========================================
Hits ? 1669
Misses ? 221
Partials ? 66 Continue to review full report at Codecov.
|
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.
Change looks good, just one question and a typo fix.
Co-Authored-By: alrex <alrex.boten@gmail.com>
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.
LGTM, just a couple of nits.
@@ -147,7 +148,7 @@ def test_probability_sampler(self): | |||
trace.SpanContext( | |||
0xDEADBEF0, 0xDEADBEF1, trace_options=TO_SAMPLED | |||
), | |||
0x8000000000000001, | |||
0x8000000000000000, |
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.
Would 0x0
make it more clear?
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.
Same reason as above, but not a strong preference in either case.
Co-authored-by: alrex <alrex.boten@gmail.com>
* feat: add BatchSpanProcessor * fix: remove default value, already done Ctor * fix: append the MS unit * fix: move unrefTimer function in core * fix: use SetInterval instead of SetTimer * fix: rename TraceOptions -> TraceFlags * Update packages/opentelemetry-basic-tracer/src/export/BatchSpanProcessor.ts Co-Authored-By: Olivier Albertini <olivier.albertini@montreal.ca> * fix: remove _MS * fix: rename _lastSpanWrite -> _lastSpanFlush
Follow up to #225.
This PR changes
ProbabilitySampler
so that it checks the left bits of the trace ID (following open-telemetry/opentelemetry-specification#331) instead of the right bits (like OpenCensus).Whether this is the right behavior depends on open-telemetry/opentelemetry-specification#331, and does break from the other clients.