Skip to content

fix(metric-issues): Handle 10k data point limit for the metric chart#109882

Open
malwilley wants to merge 4 commits intomasterfrom
malwilley/metric-issue-invalid-time-ranges
Open

fix(metric-issues): Handle 10k data point limit for the metric chart#109882
malwilley wants to merge 4 commits intomasterfrom
malwilley/metric-issue-invalid-time-ranges

Conversation

@malwilley
Copy link
Member

@malwilley malwilley commented Mar 4, 2026

Closes ISWF-2151

For metric detectors with a small time window (like 1 minute), some of the time ranges will fetch too much data for the chart and cause the request to respond with a 400.

This PR prevents us from fetching too much data, and displays a message to the user to explain that they will need to narrow the time range.

See here for an example: https://demo.sentry.io/issues/6755986934/

Before:

CleanShot 2026-03-04 at 09 01 00@2x

After:

CleanShot 2026-03-04 at 10 46 45@2x

@malwilley malwilley requested review from a team as code owners March 4, 2026 17:03
@linear
Copy link

linear bot commented Mar 4, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 4, 2026
@@ -81,12 +81,6 @@ export const DetectorErrorsConfig: DetectorDatasetConfig<ErrorsSeriesResponse> =
defaultField: DEFAULT_FIELD,
getAggregateOptions: () => AGGREGATE_OPTIONS,
getSeriesQueryOptions: options => {
// If interval is 1 minute and statsPeriod is 7 days, apply a 9998m statsPeriod to avoid the 10k results limit.
// Applied specifically to errors dataset because it has 1m intervals, spans/logs have a minimum of 5m intervals.
if (options.interval === 60 && options.statsPeriod === '7d') {
Copy link
Member Author

Choose a reason for hiding this comment

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

The max data points were recently updated to 10,100 to accommodate 7d, so this is no longer necessary

Copy link
Contributor

@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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

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.

1 participant