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
Odd activity auto tracing duration #1787
Comments
@LouisFn thanks for reporting. can you reproduce that? did you disable the can you give some more context? thanks |
Sadly we can't reproduce that but in prod, there are 10% of the traces of our MainActivity which have invalid duration (more than 10min up to 30h) ... |
@LouisFn did you find any pattern from this 10% of traces? like OS version, Device brand, or something. |
No, we didn't find any pattern, it occurs on different android version and devices. |
@LouisYubo I can't really reproduce it, not sure how to proceed, any ideas on how to reproduce otherwise I'd have to close it. |
@LouisFn does your app have notifications? is it possible that users open your app via notification? |
@marandaneto Completely, I can reproduce it by opening the app from notification |
@LouisFn ok thats a good start, can you tell me the exact steps to reproduce it? or provide a minimal reproducible example? thanks |
@marandaneto It seems to be because the lib wait for the child traces to finish before stoping the transaction (waitForChildren) and the child trace from FragmentLifecycleIntegration never ends. It's due to NavDeepLinkBuilder, when the deep link is triggered, the destination and all of its parents will be on the back stack. But for its parents, only onCreate is called but not onResume. So the HomeFragment transaction never finished. You can find a reproducible example here: BTW, I think it would be usefull to add an option to disable "waitForChildren" |
will have a look, thanks |
I can confirm that |
@LouisFn in your use case, maybe there's a bug in your example as well, you set:
but in |
do |
I don't understand what you mean, I set
No, the purpose is to navigate to a specific destination (not the start destination) while adding the start destination to the backstack. From the docs: https://developer.android.com/reference/androidx/navigation/NavDeepLinkBuilder
|
sorry it was a typo,
got it, that makes sense, since the fragment does not trigger any other lifecycle, I don't really know how to finish the span automatically for that case, ideas? |
even if I provide a custom |
I think, you might check if fragment |
indeed @LouisYubo that's totally possible and it works, thanks for the tip, See PR #1813 |
@marandaneto Thanks a lot for the fix :) But I think there are others issues with the auto tracing activity that doesn't seem to be related to or App Startup - MainActivity#onCreate is a custom child span added to measure our onCreate implementation |
@LouisYubo it could be related to opening the App thru notifications, mind testing that out? at least the sample that you have given is fixed, please raise a new issue with more detailed use case for the other one, also a minimal reproducible example would help as it did with this one, thanks a lot. |
Platform:
Build system:
_Android Gradle Plugin: 7.0.2
The version of the SDK:
5.2.0
I have the following issue:
We get odd result with activity auto tracing. We receive many transactions with a very long duration on prod.
The text was updated successfully, but these errors were encountered: