Skip to content
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

Wrong transactions on late SDK init/re-init #3059

Closed
stefanosiano opened this issue Nov 22, 2023 · 1 comment · Fixed by #3092
Closed

Wrong transactions on late SDK init/re-init #3059

stefanosiano opened this issue Nov 22, 2023 · 1 comment · Fixed by #3092

Comments

@stefanosiano
Copy link
Member

Description

To calculate the app start timestamp (and TTID and TTFD), the SDK changes the start timestamp of the first Activity transaction to be the app init timestamp.
When the SDK is initialized manually after the creation of the first activity, for example waiting for a feature flag or any other user logic, the SDK still applies the same logic to the first Activity transaction happening after the init, which can happen minutes later.
It also happens when the SDK is reinitialized: the SDK changes the timestamp of the first Activity transaction happening after the re-init, which can happen days later.
This breaks TTID/TTFD and other metrics, other than transaction durations.
First init example (ttid: 1.2 minutes)
Re-init example (ttid: 2.75 minutes)
Even if we can "fix" it by discarding outlier transactions, we should handle this case properly.
Reproducible example is the sample app in the https://github.com/getsentry/sentry-java/tree/repro/long-start-transaction breanch

@stefanosiano
Copy link
Member Author

we can do the same of cocoa: https://github.com/getsentry/sentry-cocoa/blob/b0646651e1c1e526071883841a6412e4f75f3690/Sources/Sentry/SentryTracer.m#L698-L703
disable this behaviour if the difference of the start timestamp of the app and the transaction is higher than a specified threshold

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants