Skip to content

Commit 63de53d

Browse files
authored
fix(sampling): update condition (#198)
1 parent c714a42 commit 63de53d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/datadog/trace_sampler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ SamplingDecision TraceSampler::decide(const SpanData& span) {
5555
decision.limiter_max_per_second = limiter_max_per_second_;
5656
decision.configured_rate = rule.rate;
5757
const std::uint64_t threshold = max_id_from_rate(rule.rate);
58-
if (knuth_hash(span.trace_id.low) < threshold) {
58+
if (knuth_hash(span.trace_id.low) <= threshold) {
5959
const auto result = limiter_.allow();
6060
if (result.allowed) {
6161
decision.priority = int(SamplingPriority::USER_KEEP);
@@ -90,7 +90,7 @@ SamplingDecision TraceSampler::decide(const SpanData& span) {
9090
}
9191

9292
const std::uint64_t threshold = max_id_from_rate(*decision.configured_rate);
93-
if (knuth_hash(span.trace_id.low) < threshold) {
93+
if (knuth_hash(span.trace_id.low) <= threshold) {
9494
decision.priority = int(SamplingPriority::AUTO_KEEP);
9595
} else {
9696
decision.priority = int(SamplingPriority::AUTO_DROP);

0 commit comments

Comments
 (0)