Coder Social home page Coder Social logo

getsentry / sentry-replay Goto Github PK

View Code? Open in Web Editor NEW
27.0 35.0 1.0 2.01 MB

Moved to http://github.com/getsentry/sentry-javascript

Home Page: http://github.com/getsentry/sentry-javascript

License: MIT License

Shell 0.09% TypeScript 98.08% JavaScript 1.83%
tag-archived

sentry-replay's Introduction

Sentry Replay

Attention: This project was moved to the getsentry/sentry-javascript monorepo.

While moving, we introduced some breaking changes, along with a version bump from 0.x to 7.x. Please take a look at the migration guide to find out what changed.

The project's README was updated along the way, too. Feel free to take a look.

Please use the getsentry/javascript repo to open new issues and PRs.

sentry-replay's People

Contributors

benvinegar avatar billyvg avatar byk avatar danondso avatar dcramer avatar dependabot[bot] avatar getsentry-bot avatar jas-kas avatar joshferge avatar lms24 avatar mattgauntseo-sentry avatar mdtro avatar mitsuhiko avatar mydea avatar ryan953 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

sentry-replay's Issues

Investigate Sentry replays not fully working

Sentry replays are not fulling working (at least with yarn dev-ui). Some pages work fine (e.g. if you load Settings), but most do not seem to replay.

It's possible this could be a dev vs prod build issue (e.g. dev build + emotion might be producing a lot of diffs).

Will have to investigate further.

Looks like our stitched together replays do not work well. We have lots of warnings when replaying:
image

Memory Capture Events show the incorrect timestamp.

Whenever a memory capture event is submitted, the timestamps are shown incorrectly. This is because of the call to getAbsoluteTime() adds window.performance.timeOrigin to the time passed in. And since memory events have a timestamp of now, we fling all the memory events far into the future.

image

Should integration keep separate list of breadcrumbs?

We are currently using the SDK's breadcrumbs that are saved to every event. The SDK does not clear breadcrumbs after capturing an event so the most recent event will have all breadcrumbs that have occurred since the initialization of the SDK. I believe there is a upper bound on the number of breadcrumbs stored, which would cause issues if we were to aggregate breadcrumbs across many events.

Bug: Possible duplicate breadcrumbs captured

Here's a replay with some duplicates. It looks weird on the front-end but i don't know for certain that the issue is really in the SDK, it's possible that we need to group events because that's what the browser api's return...

This example has:

  • 2 Page Load crumbs at 0:00
  • 3 LCP crumbs at 0:00
  • 2 Reload crumbs at 0:51
  • 2 LCP at 0:51

https://dev.getsentry.net:7999/organizations/sentry-emerging-tech/replays/ben-test:cd7824017b744d3b88473be9c2f72ebc/#console

I'm pretty sure the Pageload and Reload crumbs are from redirects or something, they should be easier to group on the front end (unless we don't have to!)

The LCP crumbs are more of a mystery to me though.
The payloads for the first three are:

'{"type":"debug","timestamp":"2022-06-09T00:50:22.916Z","level":"info","category":"default","data":{"action":"largest-contentful-paint","size":1024,"nodeId":-1,"label":"LCP"},"id":25,"color":"purple300","description":"Debug"}'

'{"type":"debug","timestamp":"2022-06-09T00:50:22.975Z","level":"info","category":"default","data":{"action":"largest-contentful-paint","size":12654,"nodeId":-1,"label":"LCP"},"id":26,"color":"purple300","description":"Debug"}'

'{"type":"debug","timestamp":"2022-06-09T00:50:23.034Z","level":"info","category":"default","data":{"action":"largest-contentful-paint","size":39204,"nodeId":-1,"label":"LCP"},"id":27,"color":"purple300","description":"Debug"}'

notice that timestamp is slightly different, so they're not really duplicates. And data.size is increasing each time.

Support only recording replays when an error occurs

When an error occurs, we capture and upload a replay to Sentry. This means that we need to buffer the replay events and only upload on an error event. We need to place an upper bound on the events we buffer, in order to do so, we configure rrweb to checkout the full DOM on a time interval (alternatively we could do it based on an event count, or replay size). Otherwise end users will face memory issues having to store all of the incremental updates.

After an error occurs, we should continue to record the session. The SDK currently is easily setup to continue recording forever, however we may want to limit the amount of time after the error. The important parts of the replay should be what immediately happens before and after the error.
- If we record only up to a specific timeframe after the error happens, what should we do if a new error occurs? Should it always become a new session? Should it be part of the previous replay (given that it happens within the session lifetime).

Index UI mocks

Designs

https://www.figma.com/file/ULqGN1mpdvUkiWJ8PCuo0z/Index?node-id=45%3A7162

AC

  • Can filter the session's table by project & time range
  • Can filter the session's table by tags we ingest(smart search)
  • Can sort the session's table by a specific session column
  • Have a way to get to a session "detail" view
  • Can see each session's URL slug from where it started
  • Can see a user's Gravatar, username, email or IP address if we can associate a user to a session
  • Users can see a session's timestamp and duration
  • Users can show more sessions in a single view
  • Users can paginate the session's table

What is a session?

What should we consider as a session? Things to consider:

  • Refreshing the current tab
  • Navigating to an external site
  • Opening a new tab to current app
  • non-SPAs
  • User goes idle/inactive
  • User changes tabs or hides browser
  • User changes tabs and goes back to app
  • Usage of cookies/localStorage

SDK instrumentation handlers do not flush events

Currently we do not create replay events after receiving new updates from core SDK (e.g. breadcrumbs) -- they only get flushed after an rrweb event.

This causes breadcrumbs to be attached to a new session instead of the previous session.

e.g. old session -> breadcrumbs -> (no upload happens)
new session -> rrweb checkout -> upload (with old breadcrumbs)

Browser Extension which will mask/replace DOM nodes on a live page, to match what the SDK will mask

The SDK is configured to treat DOM notes with the classname of: sr-block sr-ignore & sr-mask as PII, and hide the data.

See: https://github.com/getsentry/sentry-replay/blob/main/src/index.ts#L110-L112 for the latest classname configs.

I think it would be useful for developers to have an extension available where:

  • Run the extension on any site
  • Extension finds any DOM notes with one of those classnames
  • Extension implements the same replacement logic as rrweb, so developers can see the black boxes, or * before they enable the replay sdk.
    The benefit would be that developers can audit their site to make sure that PII information is not sent to the Sentry backend before they deploy their site to production.

If the developer could configure the extension to have different classnames, that'd be awesome too because the SDK allows it already.


Side note: the browser extension would be useful to anyone who has integrated rrweb into their site, but we should care about the README just like we do for SDK's and maybe get signups from the extension itself!

Add client side sampling

Add an option to enable sampling. This will be a very basic sampling: if not sampled, do not initialize plugin at all, otherwise proceed as normal.

Note: We will want to sample based on the session, otherwise, in non-SPA, we would have fragments of a user's journey as they navigate throughout a site as sampling would occur on every pageload.

Brower Compatibility

Currently there has not been any work done in regards to researching browser compatibility (e.g. for Worker, PerformanceObserver, MutationObserver). We'll want to dive deeper into what browsers we want to support and how to support them.

sequenceId logic is currently broken

need to save the session after each sequence id increment, or les when updateSessionActivity is called, it blows the current in-memory session away

Compress snapshots

Snapshots can be quite large, we will want them to be compressed before uploading to Sentry. This needs to be done in a webworker as it is a CPU intensive process and we do not want to block UI.

Blocked by #36

Don't associate SDK network events with user/app activity

This is the sentry-replay version of the ticket: "Network waterfall should not show all the sentry-replay beacon/post requests"

The network waterfall is full of beacon and fetch requests from the sentry-replay sdk.

Example:
Image

This is really meta, and not part of the page/product itself. I think we should hide it in the Network waterfall so that customers are not confused by all this traffic that they are not in control of.

Retry failed uploads

It's possible due to network conditions that a replay upload fails. We should add a way to retry the upload after a delay and up to a maximum number of attempts.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.