-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
feat(preprod): add endpoint to fetch dashboard data #105309
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
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
src/sentry/preprod/api/endpoints/organization_preprod_app_size_stats.py
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #105309 +/- ##
=========================================
Coverage 80.56% 80.57%
=========================================
Files 9443 9444 +1
Lines 404657 404969 +312
Branches 25722 25722
=========================================
+ Hits 326002 326290 +288
- Misses 78223 78247 +24
Partials 432 432 |
src/sentry/preprod/api/endpoints/organization_preprod_app_size_stats.py
Outdated
Show resolved
Hide resolved
src/sentry/preprod/api/endpoints/organization_preprod_app_size_stats.py
Outdated
Show resolved
Hide resolved
| raise ParseError("Invalid query parameters") | ||
| except (ValueError, KeyError): | ||
| logger.exception("Error while parsing app size stats request") | ||
| raise ParseError("Invalid request parameters") |
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.
Is it possible to shrink the code which lives inside the try catch block to specifically what could potentially error?
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.
we'll will also catch any error that's raised and send it to sentry, so you do not need to add these logger.exception statements
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.
I kept the logs in since it's useful to still do some searching in GCP.
src/sentry/preprod/api/endpoints/organization_preprod_app_size_stats.py
Outdated
Show resolved
Hide resolved
src/sentry/preprod/api/endpoints/organization_preprod_app_size_stats.py
Outdated
Show resolved
Hide resolved
src/sentry/preprod/api/endpoints/organization_preprod_app_size_stats.py
Outdated
Show resolved
Hide resolved
| response, start, end, interval_seconds, aggregate_func, aggregate_field | ||
| ) | ||
|
|
||
| result: dict[str, Any] = { |
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.
Is there a stronger type we could leverage here? Seems this data is pretty tightly scoped other than data (i.e. start/end are ints, meta is pretty typed.)
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.
I took a look around and most endpoints just return raw JSON. I could wrap this in a dataclass perhaps, but I don't think it'd buy us much since like you said the data type is a bit gnarly.
Adds a new endpoint we can query from Dashboards to fetch preprod EAP data.