-
-
Notifications
You must be signed in to change notification settings - Fork 444
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
feat: add fragment lifecycle breadcrumb logger #1522
Conversation
...ry-android-fragment/src/main/java/io/sentry/android/fragment/FragmentLifecycleIntegration.kt
Show resolved
Hide resolved
...ry-android-fragment/src/main/java/io/sentry/android/fragment/FragmentLifecycleIntegration.kt
Show resolved
Hide resolved
...ry-android-fragment/src/main/java/io/sentry/android/fragment/FragmentLifecycleIntegration.kt
Show resolved
Hide resolved
...amples/sentry-samples-android/src/main/java/io/sentry/samples/android/SampleInnerFragment.kt
Show resolved
Hide resolved
...ndroid-fragment/src/main/java/io/sentry/android/fragment/SentryFragmentLifecycleCallbacks.kt
Outdated
Show resolved
Hide resolved
...ry-android-fragment/src/main/java/io/sentry/android/fragment/FragmentLifecycleIntegration.kt
Outdated
Show resolved
Hide resolved
...ry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/MyApplication.java
Outdated
Show resolved
Hide resolved
...ndroid-fragment/src/main/java/io/sentry/android/fragment/SentryFragmentLifecycleCallbacks.kt
Outdated
Show resolved
Hide resolved
...ndroid-fragment/src/main/java/io/sentry/android/fragment/SentryFragmentLifecycleCallbacks.kt
Outdated
Show resolved
Hide resolved
...ndroid-fragment/src/test/java/io/sentry/android/fragment/FragmentLifecycleIntegrationTest.kt
Outdated
Show resolved
Hide resolved
...ry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/MyApplication.java
Outdated
Show resolved
Hide resolved
@wzieba nicely done, thanks a lot, left a few comments only the Java or Kotlin would be a question to be answered, all the rest are easy fixes. |
@marandaneto thank you a lot for the review! I'm now fixing formatting issues - I couldn't reproduce them locally as I was using Java 11.0 on my machine. After changing JDK to 1.8 (the same as on CI) I was able to reproduce&fix them.
Sure, that's a good idea to add spans for this integration too. |
Codecov Report
@@ Coverage Diff @@
## main #1522 +/- ##
=========================================
Coverage 76.12% 76.12%
Complexity 1934 1934
=========================================
Files 191 191
Lines 6696 6696
Branches 666 666
=========================================
Hits 5097 5097
Misses 1274 1274
Partials 325 325 Continue to review full report at Codecov.
|
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.
wow this is beautiful stuff. Thanks @wzieba
...ndroid-fragment/src/main/java/io/sentry/android/fragment/SentryFragmentLifecycleCallbacks.kt
Show resolved
Hide resolved
...ry-samples/sentry-samples-android/src/main/java/io/sentry/samples/android/MyApplication.java
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.
@wzieba good stuff, thanks a lot, also pretty nice the comments linking the commit hash, so easy to review, nicely done.
left 2 small comments, other than that LGTM.
I
l'll cut a release early next week :)
Thank you @marandaneto , it was a pleasure working on this. I've left one comment about parameterless constructor - please take a look and let me know if it needs changes.
Great, thanks! |
📜 Description
This PR adds a new module
sentry-android-fragment
which exposes a newIntegration
for automated Android'sFragment
s lifecycles breadcrumb logging.Sample
💡 Motivation and Context
Closes: #1374
From suggested solutions by @marandaneto , I've liked
the most, so I've followed it in this implementation.
It's also highly inspired by
ActivityLifecycleIntegration
.💚 How did you test it?
Aside from unit tests, I've tested it manually using a sample project. To do this, uncomment manual initialization in
MyApplication
, add a test DSN, run app and click onOpen sample fragment
button.From there you can send a message from inner fragment to check if breadcrumbs logging works for nested fragments too.
📝 Checklist
🔮 Next steps