You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Stress Relief mode is activated, a fraction of traffic is sampled through a deterministic sampler based on the hash of trace id calculated using wyhash. When observing the kept_from_stress and dropped_from_stress metrics, the ratio between the two does not always align with the SampleRate configured for stress relief
Potential Cause
Below test showed that with smaller iteration n, wyhash result sometimes can have less distribution. This can be a reason why more traces are kept than configured SampleRate
func TestWyhash(t *testing.T) {
n := 10000
const frac = 100
var upperBound uint64 = math.MaxUint64 / frac
for i := 0; i < 10; i++ {
t.Run(fmt.Sprintf("frac=%d", frac), func(t *testing.T) {
count := 0
for i := 0; i < n; i++ {
traceID := fmt.Sprintf("%016x%016x", rand.Int63(), rand.Int63())
hash := wyhash.Hash([]byte(traceID), hashSeed)
if hash <= upperBound {
count++
}
}
assert.InDelta(t, count, n/frac, 0.1*float64(n/frac))
})
}
}
The text was updated successfully, but these errors were encountered:
Description:
When Stress Relief mode is activated, a fraction of traffic is sampled through a deterministic sampler based on the hash of trace id calculated using
wyhash
. When observing thekept_from_stress
anddropped_from_stress
metrics, the ratio between the two does not always align with the SampleRate configured for stress reliefPotential Cause
Below test showed that with smaller iteration
n
,wyhash
result sometimes can have less distribution. This can be a reason why more traces are kept than configured SampleRateThe text was updated successfully, but these errors were encountered: