-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(uptime): Use EAP to query in project_uptime_alert_checks_index
#94755
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
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #94755 +/- ##
========================================
Coverage 87.88% 87.89%
========================================
Files 10439 10441 +2
Lines 603361 603685 +324
Branches 23501 23501
========================================
+ Hits 530254 530580 +326
+ Misses 72741 72739 -2
Partials 366 366 |
fe363cf
to
7101600
Compare
7101600
to
020ab43
Compare
Relies on #94597 This allows us to switch our queries to use EAP in the check details endpoint
020ab43
to
5f21d41
Compare
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.
Bug: UUID Parsing Breaks Legacy Subscription IDs
The ProjectUptimeAlertCheckIndexEndpoint
now attempts to parse uptime_subscription.uptime_subscription.subscription_id
as a UUID. This introduces a ValueError
if the ID is not a valid UUID string, potentially crashing requests. The previous implementation directly used the ID as a string, making the new code incompatible with existing legacy subscription IDs that may not be UUID-formatted, particularly affecting the TRACE_ITEM_TYPE_UPTIME_CHECK
path.
src/sentry/uptime/endpoints/project_uptime_alert_checks_index.py#L133-L135
sentry/src/sentry/uptime/endpoints/project_uptime_alert_checks_index.py
Lines 133 to 135 in 5f21d41
value=AttributeValue( | |
val_str=str(uuid.UUID(uptime_subscription.uptime_subscription.subscription_id)) | |
), |
Bug: Trace Item Parsing Errors
For UPTIME_RESULT
trace items, check_status_reason
is always None
because the code incorrectly looks for the column label "check_status_reason" instead of the actual attribute name "status_reason_type" in the RPC response. Additionally, accessing http_status_code
directly via row_dict[...]
can lead to a KeyError
if the column is missing from the RPC response; it should use row_dict.get()
.
src/sentry/uptime/endpoints/project_uptime_alert_checks_index.py#L347-L355
sentry/src/sentry/uptime/endpoints/project_uptime_alert_checks_index.py
Lines 347 to 355 in 5f21d41
check_status=cast(CheckStatus, row_dict["check_status"].val_str), | |
check_status_reason=self._extract_check_status_reason( | |
row_dict.get("check_status_reason") | |
), | |
http_status_code=( | |
None | |
if row_dict["http_status_code"].is_null | |
else row_dict["http_status_code"].val_int | |
), |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Relies on #94597
This allows us to switch our queries to use EAP in the check details endpoint