Skip to content

Align jaeger probabilistic sampler with trace.TraceIDRatioBased#6892

Merged
dmathieu merged 8 commits intoopen-telemetry:mainfrom
diurnalist:b/jaeger-random-sampling
Mar 10, 2025
Merged

Align jaeger probabilistic sampler with trace.TraceIDRatioBased#6892
dmathieu merged 8 commits intoopen-telemetry:mainfrom
diurnalist:b/jaeger-random-sampling

Conversation

@diurnalist
Copy link
Copy Markdown
Contributor

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.
@linux-foundation-easycla
Copy link
Copy Markdown

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

testDefaultSamplingProbability = 0.5
testMaxID = uint64(1) << 62
testMaxID = uint64(1) << 63
Copy link
Copy Markdown
Contributor 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

Comment thread samplers/jaegerremote/sampler.go Outdated
Comment thread samplers/jaegerremote/sampler.go Outdated
@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
@codecov
Copy link
Copy Markdown

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 75.5%. Comparing base (7f341e4) to head (4a4b29f).
Report is 1 commits behind head on main.

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   75.5%   75.5%   -0.1%     
=======================================
  Files        207     207             
  Lines      19330   19319     -11     
=======================================
- Hits       14609   14598     -11     
  Misses      4285    4285             
  Partials     436     436             
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.

Comment thread CHANGELOG.md Outdated
Co-authored-by: Damien Mathieu <42@dmathieu.com>
@dmathieu dmathieu changed the title align jaeger probabilistic sampler with traceidratiobased Align jaeger probabilistic sampler with trace.TraceIDRatioBased Mar 10, 2025
@dmathieu dmathieu merged commit 2f2b761 into open-telemetry:main Mar 10, 2025
@diurnalist diurnalist deleted the b/jaeger-random-sampling branch March 10, 2025 20:16
@MrAlias MrAlias added this to the v1.36.0 milestone Mar 27, 2025
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.

4 participants