Skip to content

ConsistentRateLimitingSampler can fail if used in combination with legacy samplers #2007

@PeterF778

Description

@PeterF778

Component(s)

samplers

What happened?

Description

When ConsistentRateLimitingSampler is using ConsistentParentBasedSampler as the delegate, and when the parent span has no threshold value, the calculated suggested threshold is correct only under assumption that the randomness value is uniformly distributed in the interval [0, 2^56). This assumption may be incorrect.

Please also see this issue.

Steps to Reproduce

Let's assume 100 traces per second. Now,

  1. Use the legacy AlwayOn sampler for the parent span
  2. For child spans, use ConsistentRateLimitingSampler using ConsistentParentBasedSampler as the delegate, and specify max rate as 50 spans/s
  3. For grandchild spans, use ConsistentRateLimitingSampler using ConsistentParentBasedSampler as the delegate, and specify max rate as 25 spans/s

Expected Result

The grandchild spans are sampled at the rate of about 25/s.

Actual Result

The grandchild spans are sampled at the rate of about 50/s.

Component version

1.47.0

Log output

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions