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
fix: Try to use a better performance API #3356
Conversation
- Trying to address the inconsistencies between browsers - Always try to use the timeOrigin first, as long as its consistent with either the navigationStart or the current time - Otherwise, use the navigationStart if its consistent with the current time - And still fallback to date if all else fails
size-limit report
|
@wmak were you able to test this change in Safari, Chrome, and Firefox? |
@dashed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, it can likely mitigate the problems we're seeing on FF.
Thanks @wmak <3
Co-authored-by: Rodolfo Carvalho <rodolfo.carvalho@sentry.io>
Co-authored-by: Rodolfo Carvalho <rodolfo.carvalho@sentry.io>
…ry/sentry-javascript into wmak/fix/performance-time-origin
Also, starting with Threshold == 1 hour, but this will likely mean we start seeing inaccurate durations up to an hour, if this solution works out we could drop Threshold down to a few seconds instead, just want to start with something safer for now |
Co-authored-by: Alberto Leal <mail4alberto@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to see this in prod.
@wmak I had one idea since yesterday -- as a way to debug and quantify how this is working, we could set some internal variable with a string depending on what time origin is being used (timeOrigin
, navigationStart
or dateNow
) and then in Sentry we can use this + event processor to set a tag on every transaction, so we can filter and see what fraction of users use which method, see if there is a clear browser correlation etc.
We could also mark/tag whenever we decided that timeOrigin
or navigationStart
is reliable or not.
@kamilogorek would you have some suggestion on how to implement the "internal global value"? E.g. how exactly to bind to the global sentry object?
Getting this in so we can test across more browsers in the wild. |
Before submitting a pull request, please take a look at our
Contributing guidelines and verify:
yarn lint
) & (yarn test
).