Merged
Conversation
….SentryOkHttpEventListener is attached and skips it
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| baaf637 | 462.32 ms | 579.22 ms | 116.90 ms |
| 28c9a83 | 416.98 ms | 479.90 ms | 62.92 ms |
| 201048a | 418.62 ms | 481.67 ms | 63.05 ms |
| 7ab32b6 | 373.62 ms | 480.61 ms | 106.99 ms |
| b172d4e | 352.92 ms | 446.50 ms | 93.58 ms |
| 3d8bd2b | 364.76 ms | 469.98 ms | 105.22 ms |
| 1e05e43 | 411.00 ms | 467.29 ms | 56.29 ms |
| c554ca2 | 383.78 ms | 449.84 ms | 66.06 ms |
| 0bd723b | 375.20 ms | 452.41 ms | 77.20 ms |
| 99a51e2 | 405.11 ms | 479.65 ms | 74.54 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| baaf637 | 1.72 MiB | 2.27 MiB | 558.42 KiB |
| 28c9a83 | 1.70 MiB | 2.28 MiB | 592.00 KiB |
| 201048a | 1.70 MiB | 2.28 MiB | 592.32 KiB |
| 7ab32b6 | 1.70 MiB | 2.27 MiB | 584.63 KiB |
| b172d4e | 1.72 MiB | 2.29 MiB | 578.09 KiB |
| 3d8bd2b | 1.72 MiB | 2.29 MiB | 577.53 KiB |
| 1e05e43 | 1.70 MiB | 2.28 MiB | 590.89 KiB |
| c554ca2 | 1.70 MiB | 2.27 MiB | 582.25 KiB |
| 0bd723b | 1.72 MiB | 2.29 MiB | 578.09 KiB |
| 99a51e2 | 1.72 MiB | 2.29 MiB | 576.34 KiB |
kahest
reviewed
Jun 27, 2024
sentry-okhttp/src/main/java/io/sentry/okhttp/SentryOkHttpEventListener.kt
Show resolved
Hide resolved
adinauer
approved these changes
Jun 27, 2024
Member
adinauer
left a comment
There was a problem hiding this comment.
LGTM
- some questions
- a comment explaining why the fix is necessary could be nice, made a suggestion.
sentry-okhttp/src/main/java/io/sentry/okhttp/SentryOkHttpEventListener.kt
Show resolved
Hide resolved
Contributor
Author
|
Just pointing out this will be less relevant when getsentry/sentry-android-gradle-plugin#724 will be released |
kahest
approved these changes
Jun 27, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
SentryOkHttpEventListener now checks if an existing
io.sentry.android.SentryOkHttpEventListeneris attached and skips it💡 Motivation and Context
Customers reported duplicated http spans, that was happening due to our Gradle plugin auto instrument using the old version of the
SentryOkHttpEventListenerfrom thesentry-android-okhttpartifact.That was delegating to the listener from
sentry-okhttp, and when being instrumented multiple times, it was creating multiple http spans, overwriting the parenthttp.clientspan in the listener, causing the duplicated spans to never finish, due to their reference being lost.💚 How did you test it?
Unit test
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps