Skip to content

Commit

Permalink
Default sampling rate for any rule is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi authored and PROFeNoM committed Dec 6, 2023
1 parent 4b30ec5 commit a6dfb4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ext/priority_sampling/priority_sampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ static ddtrace_rule_result dd_match_rules(ddtrace_span_data *span, bool eval_roo
}
}

zval *sample_rate_zv;
if (dd_check_sampling_rule(Z_ARR_P(rule), span) && (sample_rate_zv = zend_hash_str_find(Z_ARR_P(rule), ZEND_STRL("sample_rate")))) {
return (ddtrace_rule_result){ .sampling_rate = zval_get_double(sample_rate_zv), .rule = index };
if (dd_check_sampling_rule(Z_ARR_P(rule), span)) {
zval *sample_rate_zv = zend_hash_str_find(Z_ARR_P(rule), ZEND_STRL("sample_rate"));
return (ddtrace_rule_result){ .sampling_rate = sample_rate_zv ? zval_get_double(sample_rate_zv) : 1, .rule = index };
}
} ZEND_HASH_FOREACH_END();

Expand Down

0 comments on commit a6dfb4b

Please sign in to comment.