Skip to content

Conversation

@aliu39
Copy link
Member

@aliu39 aliu39 commented Jan 23, 2026

instead of branching to our own util to parse and validate start end statsPeriod, lean on the existing sentry api validation and util.

Changes:

  • When invoking an endpoint, directly pass the params to it (already has validation)
  • When passing date params for other use, use get_date_range_from_params
  • Adds a get_group_date_range convenience util for getting a group's first/last seen time range, clamped by retention.
  • Updates the baselines rpc for suspect tags to default to the first/last seen range instead of last 7d. This matches the behavior of the issue tool when no date is specified

Note: I removed some default stats periods from explorer tools, as it seems better to maintain and pass them from seer only. Right now Seer mostly defaults to passing 7d, so the sentry-side defaults aren't used

@aliu39 aliu39 requested a review from a team as a code owner January 23, 2026 02:35
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 23, 2026
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.

start_dt = datetime.datetime.fromisoformat(start or "")
start_dt, end_dt = get_date_range_from_params(
{"start": start, "end": end, "statsPeriod": stats_period},
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Default time period increased from 7d to 90d

Medium Severity

In get_attributes_and_values, the default time period changed from 7 days to 90 days when no date parameters are provided. The old validate_date_params defaulted to "7d" while get_date_range_from_params defaults to MAX_STATS_PERIOD (90 days). This 13x increase could cause performance issues and significantly higher query costs if callers don't explicitly pass date params. While the PR notes Seer "mostly" passes 7d, the word "mostly" suggests edge cases exist where params aren't provided.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@roaga roaga left a comment

Choose a reason for hiding this comment

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

would double check that seer passes in the defaults as needed for all our tools

also does this impact any functionality or is this just cleanup?

@aliu39
Copy link
Member Author

aliu39 commented Jan 23, 2026

@roaga I've double checked the defaults I've removed here are passed with a default (sometimes different) from seer. Will comment on those functions here

This is mostly cleanup, but the changes are removed defaults (doesnt change functionality, only future use of rpcs) + defaulting to issue lifetime for the baselines rpc

@aliu39
Copy link
Member Author

aliu39 commented Jan 23, 2026

also baseline rpc will raise now if the group doesn't exist

@aliu39 aliu39 merged commit 6aa328d into master Jan 23, 2026
66 checks passed
@aliu39 aliu39 deleted the aliu/date-params-update branch January 23, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants