Skip to content

feat(uptime): Optionally include uptime stats in organization_trace_meta #97022

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

Merged
merged 1 commit into from
Aug 5, 2025

Conversation

wedamija
Copy link
Member

@wedamija wedamija commented Aug 1, 2025

This adds include_uptime to the meta endpoint as well. When it's passed, we'll include the number of uptime spans in the meta as well

Relies on #96821

@wedamija wedamija requested a review from a team August 1, 2025 21:48
@wedamija wedamija requested review from a team as code owners August 1, 2025 21:48
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 1, 2025
Copy link

codecov bot commented Aug 2, 2025

Codecov Report

❌ Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...rc/sentry/api/endpoints/organization_trace_meta.py 90.90% 3 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                         @@
##           danf/organization-uptime-trace   #97022      +/-   ##
==================================================================
- Coverage                           80.66%   80.66%   -0.01%     
==================================================================
  Files                                8515     8511       -4     
  Lines                              374885   374879       -6     
  Branches                            24315    24315              
==================================================================
- Hits                               302404   302393      -11     
- Misses                              72104    72109       +5     
  Partials                              377      377              

Base automatically changed from danf/organization-uptime-trace to master August 5, 2025 18:22
…meta`

This adds `include_uptime` to the meta endpoint as well. When it's passed, we'll include the number of uptime spans in the meta as well

Relies on #96821
@wedamija wedamija force-pushed the danf/organization-uptime-trace-meta branch from bb41dbf to eed8c9e Compare August 5, 2025 18:23
@wedamija wedamija enabled auto-merge (squash) August 5, 2025 18:23
uptime_count = extract_uptime_count(uptime_result)
except Exception:
logger.exception("Failed to fetch uptime results")
return Response(self.serialize(results, perf_issues, uptime_count))
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: API Inconsistency: Missing Uptime Checks Field

The OrganizationTraceMetaEndpoint omits the uptime_checks field from the response when include_uptime=1 and the uptime query fails. This occurs because the uptime_count variable remains None in the exception handler. Clients expect uptime_checks to always be present (even if 0) when include_uptime=1, leading to inconsistent API behavior.

Fix in Cursor Fix in Web

@wedamija wedamija merged commit 60a2578 into master Aug 5, 2025
63 checks passed
@wedamija wedamija deleted the danf/organization-uptime-trace-meta branch August 5, 2025 18:43
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.

2 participants