Skip to content

Conversation

jasonyuezhang
Copy link
Owner

Hides the resolution threshold shaded area on the chart if they're using automatic resolution.

with resolution threshold

image

Copied from getsentry#101050
Original PR: getsentry#101050

Hides the resolution threshold shaded area on the chart if they're using automatic resolution.
Copy link

Hide Resolution Threshold on Chart When Using Automatic Resolution

This pull request updates the threshold visualization in useMetricDetectorThresholdSeries.tsx to prevent the resolution threshold shaded area from displaying on charts when the resolution is set to automatic. The logic now checks if the resolution value matches any of the alert threshold values, treating it as automatic in that case. Only manual resolutions (distinct from alert thresholds) will display the resolution line and safe area.

Key Changes

• Added an isResolutionManual check in useMetricDetectorThresholdSeries.tsx to determine if the resolution should be shown as a separate threshold.
• Modified logic for adding the resolution series and calculation of maxValue to only include the resolution value when isResolutionManual is true.
• Resolution threshold area is now hidden if resolution uses an automatic value (when its value matches any threshold).

Affected Areas

static/app/views/detectors/hooks/useMetricDetectorThresholdSeries.tsx

This summary was automatically generated by @propel-code-bot

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.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on November 12

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

const isResolutionManual = Boolean(
resolution && !thresholds.some(threshold => threshold.value === resolution.value)
);
if (resolution && isResolutionManual) {
Copy link

Choose a reason for hiding this comment

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

Bug: Thresholds Disappear in Static Detection Charts

Alert threshold lines and areas are missing from charts for static detection types. This happens because the additional.push(...thresholdSeries); line, which adds these thresholds, was accidentally removed during changes to the resolution display logic.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants