Skip to content

fix(dynamic-sampling): display minimum sample rate rules correctly in admin #95868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shellmayr
Copy link
Member

@shellmayr shellmayr commented Jul 18, 2025

  • Display the minimumSampleRate rule in the same way as a sampleRate rule - in percent. Currently it shows * 1 - which is not the correct way to think about it.
    Before:
Screenshot 2025-07-18 at 13 33 49

After:
Screenshot 2025-07-18 at 13 33 36

@shellmayr shellmayr requested review from a team and Dav1dde July 18, 2025 10:33
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 18, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Rule Impact Calculation Fails for Minimum Sample Rates

The evaluateRuleImpact function incorrectly calculates impact for minimumSampleRate rules. Despite minimumSampleRate values now being formatted as percentages (like sampleRate values), the evaluateRuleImpact function was not updated to handle this type. This causes minimumSampleRate rules to fall through to a default value - 1 calculation instead of the correct value - baseSampleRate, leading to inaccurate impact indicators.

static/gsAdmin/views/dynamicSamplingPanel.tsx#L326-L330

const formatSamplingRateValue = (samplingValue: any) => {
if (
samplingValue.type === 'sampleRate' ||
samplingValue.type === 'minimumSampleRate'
) {

static/gsAdmin/views/dynamicSamplingPanel.tsx#L338-L349

const evaluateRuleImpact = (rule: RuleV2) => {
if (getRuleType(rule) === RuleType.BOOST_LOW_VOLUME_PROJECTS) {
return 0;
}
if (rule.samplingValue.type === 'sampleRate') {
return round(rule.samplingValue.value - baseSampleRate);
}
if (rule.samplingValue.type === 'reservoir') {
return 1;
}
return round(rule.samplingValue.value - 1);

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants