Compose navigation-based Tracing instead of Activity-level Tracing
Problem Statement
A customer recently enabled tracing in their Android application. By default, Sentry’s automatic Android tracing creates one trace per Activity. However, their app increasingly relies on Jetpack Compose, where navigation happens within a single Activity. As a result, Activity-level traces are becoming less meaningful for understanding real UI flows.
They would prefer to have performance data at the screen or flow level (i.e., per composable destination) so that individual feature teams can better monitor and diagnose performance issues.
Is there a recommended way to adjust our Sentry configuration so that performance traces align with Compose navigation screens or user flows, rather than Activities? If so, what patterns or APIs should they adopt to achieve more granular and meaningful tracing in a Compose-based app?
Solution Brainstorm
No response
@dalnoki if the customer is using androidx.navigation:navigation-compose then we support this out-of-the-box -- see this doc.
Otherwise they would have to manually instrument their framework/routes, they can get inspired by the aforementioned androidx.navigation instrumentation that we provide here.