Skip to content

feat(replays): Add Breadcrumb AI Summaries #93256

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 30 commits into from
Jun 13, 2025

Conversation

cmanallen
Copy link
Member

@cmanallen cmanallen commented Jun 10, 2025

Adds support for transforming RRWeb events into log messages and submitting them to Seer for AI analysis. Additionally exposes endpoints for querying and a blueprint for building clients against.

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 10, 2025
@cmanallen cmanallen marked this pull request as ready for review June 10, 2025 20:06
@cmanallen cmanallen requested review from a team as code owners June 10, 2025 20:06
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 97.17314% with 8 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../endpoints/project_replay_summarize_breadcrumbs.py 92.00% 4 Missing ⚠️
src/sentry/replays/usecases/ingest/event_parser.py 96.22% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #93256       +/-   ##
===========================================
+ Coverage   61.52%   88.02%   +26.50%     
===========================================
  Files       10298    10279       -19     
  Lines      593920   593696      -224     
  Branches    23101    22963      -138     
===========================================
+ Hits       365389   522587   +157198     
+ Misses     228082    70619   -157463     
- Partials      449      490       +41     

| ------------------------ | --------------- | --------------------------------------------------------------------------------------------- |
| title | str | The main title of the user journey summary. |
| summary | str | A concise summary featuring the highlights of the user's journey while using the application. |
| time_ranges | list[TimeRange] | A list of TimeRange objects. |
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
| time_ranges | list[TimeRange] | A list of TimeRange objects. |
| time_ranges | list[TimeRange] | An ordered list of TimeRange objects. |

Copy link
Member

@aliu39 aliu39 left a comment

Choose a reason for hiding this comment

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

looks good, I don't know specifics for the event formats though. Do we have any docs for replay event/breadcrumb types?

"period_end": 1749584992.912,
"period_title": "Second Replay Load Failure"
}
]
Copy link
Member

Choose a reason for hiding this comment

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

Could add a second example to show the ordering and relationship of start/end (will all ranges be disjoint? no gaps in between?)

return response.content


def get_request_data(iterator: Iterator[tuple[int, memoryview]]) -> list[str]:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def get_request_data(iterator: Iterator[tuple[int, memoryview]]) -> list[str]:
def get_request_data(segment_iterator: Iterator[tuple[int, memoryview]]) -> list[str]:

@michellewzhang
Copy link
Member

looks good, I don't know specifics for the event formats though. Do we have any docs for replay event/breadcrumb types?

@aliu39 if you look at node_modules/.pnpm/@[email protected]/node_modules/@sentry-internal/replay/build/npm/types/types/replayFrame.d.ts (or search for ReplayBreadcrumbFrame in the codebase the file might be easier to find) there are some types in there

},
)
if response.status_code != 200:
raise ParseError("A non 200 HTTP status code was returned.")
Copy link
Member

Choose a reason for hiding this comment

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

could we make this error more detailed? when i was getting errors testing in devserver it was tough to figure out that it was coming from here, and what error was happening

Copy link
Member

Choose a reason for hiding this comment

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

(it was a google cloud auth error but i didn't know until i looked at my seer terminal)

Copy link
Member

Choose a reason for hiding this comment

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

+1, think it'd be better to raise a ValueError or Exception so the code is 500 instead of 400, since it's not a user triggered error right? And the error message can contain the specific Seer response code

@cmanallen cmanallen merged commit 6d0102c into master Jun 13, 2025
66 checks passed
@cmanallen cmanallen deleted the cmanallen/replays-breadcrumb-ai-summaries branch June 13, 2025 14:01
Copy link

sentry-io bot commented Jun 13, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ KeyError: 'size' /api/0/projects/{organization_id_or_slug}/{proj... View Issue
  • ‼️ KeyboardInterrupt sentry.replays.usecases.ingest.event_parser in ... View Issue

Did you find this useful? React with a 👍 or 👎

billyvg pushed a commit that referenced this pull request Jun 18, 2025
Adds support for transforming RRWeb events into log messages and
submitting them to Seer for AI analysis. Additionally exposes endpoints
for querying and a blueprint for building clients against.

---------

Co-authored-by: Andrew Liu <[email protected]>
andrewshie-sentry pushed a commit that referenced this pull request Jun 19, 2025
Adds support for transforming RRWeb events into log messages and
submitting them to Seer for AI analysis. Additionally exposes endpoints
for querying and a blueprint for building clients against.

---------

Co-authored-by: Andrew Liu <[email protected]>
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.

4 participants