Skip to content

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Sep 15, 2025

Currently segment downloads and log parsing are done synchronously, before queueing a summary task in Seer. This PR moves that work to a RPC call which will be called by the task, allowing project_replay_summary endpoint to be fully async/return immediately.

Changes in both services can be rolled out together with a new FF.

Part of REPLAY-708: Move POST endpoint log parsing to Seer->Sentry RPC

test coverage todo

@aliu39 aliu39 requested review from a team as code owners September 15, 2025 22:18
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 15, 2025
Copy link

linear bot commented Sep 15, 2025

SEER_START_TASK_ENDPOINT_PATH,
{
"logs": [],
"use_rpc": True,
Copy link
Member Author

Choose a reason for hiding this comment

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

Used to toggle code paths in seer (default false)

Copy link

codecov bot commented Sep 15, 2025

Codecov Report

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

Files with missing lines Patch % Lines
src/sentry/replays/usecases/summarize.py 24.00% 19 Missing ⚠️
...sentry/replays/endpoints/project_replay_summary.py 28.57% 5 Missing ⚠️

❌ Your patch check has failed because the patch coverage (29.41%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #99547      +/-   ##
==========================================
+ Coverage   81.04%   81.23%   +0.19%     
==========================================
  Files        8589     8590       +1     
  Lines      380373   380402      +29     
  Branches    24128    24128              
==========================================
+ Hits       308260   309021     +761     
+ Misses      71750    71018     -732     
  Partials      363      363              

if features.has(
"organizations:replay-ai-summaries-rpc", project.organization, actor=request.user
):
start, end = default_start_end_dates()
Copy link
Member Author

Choose a reason for hiding this comment

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

deciding to not support date params, imo it's not necessary. We don't pass these in from the frontend atm

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.


# 404s are handled in the originating Sentry /summarize/ endpoint.
if not processed_response:
return []
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Empty Response Causes Type Mismatch

The rpc_get_replay_summary_logs function returns an empty list when processed_response is empty. This is inconsistent with its dict[str, Any] type annotation and its normal dictionary return, which could cause runtime errors for callers expecting a 'logs' key.

Fix in Cursor Fix in Web

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