-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
ref(explorer): refactor rpc date param validation #106853
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
Conversation
There was a problem hiding this 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}, | ||
| ) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
roaga
left a comment
There was a problem hiding this 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?
|
@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 |
|
also baseline rpc will raise now if the group doesn't exist |
instead of branching to our own util to parse and validate
startendstatsPeriod, lean on the existing sentry api validation and util.Changes:
get_date_range_from_paramsget_group_date_rangeconvenience util for getting a group's first/last seen time range, clamped by retention.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