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

align jaeger probabilistic sampler with traceidratiobased #6892

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

diurnalist
Copy link

currently the jaegerremotesampler has a custom probabilistic sampler that does not align with how the traceid_ratiobased sampler works. it only looks at the first 64 bits of the trace; the opentelemetry-go sampler looks at the last 64 bits, because there are cases when trace IDs having 64 bits are converted to otel trace IDs, which have 128 bits, and when that happens the first 64 bits are typically ignored/zero-d out.

rather than re-implement this logic, this just pulls in the traceid_ratiobased sampler so we re-use it, ensuring the decisions will be made similarly and predictably.

currently the jaegerremotesampler has a custom probabilistic sampler
that does not align with how the traceid_ratiobased sampler works. it
only looks at the first 64 bits of the trace; the opentelemetry-go
sampler looks at the last 64 bits, because there are cases when trace IDs
having 64 bits are converted to otel trace IDs, which have 128 bits, and
when that happens the first 64 bits are typically ignored/zero-d out.

rather than re-implement this logic, this just pulls in the traceid_ratiobased
sampler so we re-use it, ensuring the decisions will be made similarly
and predictably.
Copy link

linux-foundation-easycla bot commented Mar 6, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@github-actions github-actions bot requested a review from yurishkuro March 6, 2025 01:43
@@ -34,26 +35,27 @@ const (
testFirstTimeOperationName = "firstTimeOp"

testDefaultSamplingProbability = 0.5
testMaxID = uint64(1) << 62
testMaxID = uint64(1) << 63
Copy link
Author

Choose a reason for hiding this comment

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

i think jaeger's old probabilistic sampler only looked at 63 bits

@diurnalist diurnalist marked this pull request as ready for review March 6, 2025 21:42
@diurnalist diurnalist requested a review from a team as a code owner March 6, 2025 21:42
Copy link

codecov bot commented Mar 6, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.1%. Comparing base (193839f) to head (072b17b).

Files with missing lines Patch % Lines
samplers/jaegerremote/sampler.go 75.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #6892     +/-   ##
=======================================
- Coverage   76.1%   76.1%   -0.1%     
=======================================
  Files        220     220             
  Lines      21448   21437     -11     
=======================================
- Hits       16332   16321     -11     
  Misses      4557    4557             
  Partials     559     559             
Files with missing lines Coverage Δ
samplers/jaegerremote/sampler.go 91.6% <75.0%> (-0.6%) ⬇️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Damien Mathieu <[email protected]>
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.

3 participants