Skip to content

ref(replays): clamp connected error query dates to org retention period#108428

Open
aliu39 wants to merge 1 commit intomasterfrom
aliu/replay-err-retention
Open

ref(replays): clamp connected error query dates to org retention period#108428
aliu39 wants to merge 1 commit intomasterfrom
aliu/replay-err-retention

Conversation

@aliu39
Copy link
Member

@aliu39 aliu39 commented Feb 18, 2026

Changes

In rpc_get_replay_summary_logs, the start/end dates used to fetch trace-connected errors were previously hardcoded to a 90-day window relative to datetime.now(UTC), ignoring the organization's actual retention period.

This change:

  • Replaces the hardcoded 90-day window with default_start_end_dates() (already used for the initial replay lookup), so the window is consistent throughout the function
  • Applies outside_retention_with_modified_start to clamp start to the organization's retention boundary before querying connected errors
  • Skips the fetch_trace_connected_errors Snuba query entirely when the clamped start >= end (i.e., the replay falls entirely outside retention), avoiding a query that would return no results

Fixes SENTRY-5AEE
Fixes SENTRY-5AEF

Uses outside_retention_with_modified_start to skip fetching trace-connected
errors when the replay's date range falls entirely outside the organization's
retention window.
@aliu39 aliu39 requested a review from a team as a code owner February 18, 2026 04:12
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 18, 2026
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.

1 participant