You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-25 22:41:46 +02:00
Consistently use pointer receivers for core.Number (#375)
Change all occurrences of value to pointer receivers Add meta sys files to .gitignore Code cleanup e.g. - Don't capitalize error statements - Fix ignored errors - Fix ambiguous variable naming - Remove unnecessary type casting - Use named params Fix #306
This commit is contained in:
committed by
rghetia
parent
30795ef58c
commit
1ab645fedb
@@ -52,13 +52,13 @@ func ProbabilitySampler(fraction float64) Sampler {
|
||||
fraction = 0
|
||||
}
|
||||
traceIDUpperBound := uint64(fraction * (1 << 63))
|
||||
return Sampler(func(p SamplingParameters) SamplingDecision {
|
||||
return func(p SamplingParameters) SamplingDecision {
|
||||
if p.ParentContext.IsSampled() {
|
||||
return SamplingDecision{Sample: true}
|
||||
}
|
||||
x := binary.BigEndian.Uint64(p.TraceID[0:8]) >> 1
|
||||
return SamplingDecision{Sample: x < traceIDUpperBound}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// AlwaysSample returns a Sampler that samples every trace.
|
||||
|
||||
Reference in New Issue
Block a user