-
-
Notifications
You must be signed in to change notification settings - Fork 435
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
Add OkHttp event spans #2659
Add OkHttp event spans #2659
Conversation
made SentryOkHttpInterceptor work nicely with SentryNetworkCallEventListener
added SentryOkHttpEvent added tests
|
I just need a confirmation if some data could be seen as PII |
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
46b1782 | 387.72 ms | 458.74 ms | 71.02 ms |
1707044 | 338.80 ms | 384.79 ms | 46.00 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
46b1782 | 1.72 MiB | 2.28 MiB | 570.44 KiB |
1707044 | 1.72 MiB | 2.28 MiB | 570.44 KiB |
Previous results on branch: feat/okhttp-event-spans
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
6244bee | 244.04 ms | 390.08 ms | 146.04 ms |
80dcf36 | 311.78 ms | 350.02 ms | 38.24 ms |
418cd6d | 339.98 ms | 381.98 ms | 42.00 ms |
19b506b | 386.54 ms | 413.02 ms | 26.48 ms |
4e5eb0c | 357.83 ms | 363.70 ms | 5.87 ms |
f79cd6a | 295.88 ms | 358.24 ms | 62.36 ms |
f08b219 | 320.40 ms | 372.40 ms | 52.00 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
6244bee | 1.73 MiB | 2.26 MiB | 550.35 KiB |
80dcf36 | 1.72 MiB | 2.28 MiB | 570.67 KiB |
418cd6d | 1.72 MiB | 2.28 MiB | 570.44 KiB |
19b506b | 1.72 MiB | 2.28 MiB | 565.45 KiB |
4e5eb0c | 1.73 MiB | 2.26 MiB | 550.51 KiB |
f79cd6a | 1.72 MiB | 2.28 MiB | 570.44 KiB |
f08b219 | 1.73 MiB | 2.26 MiB | 550.38 KiB |
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #2659 +/- ##
============================================
+ Coverage 81.05% 81.11% +0.05%
- Complexity 4427 4449 +22
============================================
Files 345 345
Lines 16356 16407 +51
Branches 2219 2226 +7
============================================
+ Hits 13258 13308 +50
- Misses 2170 2172 +2
+ Partials 928 927 -1 ☔ View full report in Codecov by Sentry. |
@stefanosiano should we close this then? #2158 |
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEvent.kt
Outdated
Show resolved
Hide resolved
@stefanosiano can you attach a screenshot of the result? |
I think so. I wanted to use and expand that, but there were several differences, so I ended up creating a whole new pr
Added it in the description |
sentry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/GithubAPI.kt
Show resolved
Hide resolved
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEvent.kt
Outdated
Show resolved
Hide resolved
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.
After a quick glance looks good, but I'll defer to @markushi for proper review
SentryOkHttpEventListener now accepts an instance of EventListener or EventListener.Factory and propagate all the calls to it
Let's update the span data keys to align with https://develop.sentry.dev/sdk/performance/span-data-conventions/ |
@stefanosiano can we actually add the children's span nested to its parents? |
Sure, i'll add it |
Removed `http.` prefix from the breadcrumb Updated sub-spans with operation from `http.client` to `http.client.details` removed filtered_url from SentryOkHttpEvent
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEvent.kt
Outdated
Show resolved
Hide resolved
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEvent.kt
Outdated
Show resolved
Hide resolved
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEvent.kt
Outdated
Show resolved
Hide resolved
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEvent.kt
Outdated
Show resolved
Hide resolved
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEvent.kt
Outdated
Show resolved
Hide resolved
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEvent.kt
Outdated
Show resolved
Hide resolved
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.
@stefanosiano I've left a few names, there's a spec for crumbs and spans, let's use the very same keys as per spec.
removed `success` from http span as it's implied by the http.status_code http sub-spans operation now contains the event, and the description is now empty
@marandaneto would you take another look? |
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEventListener.kt
Outdated
Show resolved
Hide resolved
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEventListener.kt
Show resolved
Hide resolved
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEvent.kt
Outdated
Show resolved
Hide resolved
sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpEventListener.kt
Show resolved
Hide resolved
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.
Left a few more comments, if the maintainers are happy, I am happy.
@marandaneto could you unblock this PR - we want to merge and ship this today 😊 |
It's not blocked, #2659 (review) |
|
if the maintainers are happy, I am happy.
📜 Description
added SentryOkHttpEventListener that creates a span on every OkHttp event
added SentryOkHttpEvent
Here is an example of the result.
💡 Motivation and Context
We are increasing the information shown to the user by adding spans for OkHttp events, including dns, https setup, proxies, request headers/body and response headers/body
💚 How did you test it?
Unit test
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps
Update docs https://docs.sentry.io/platforms/android/configuration/integrations/okhttp/