-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(android): Add Jetpack Compose automatic UI transaction docs #5893
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/platforms/android/common/performance/instrumentation/automatic-instrumentation.mdx
Outdated
Show resolved
Hide resolved
@@ -226,24 +226,56 @@ For more information see our [file I/O integration](/platforms/android/configura | |||
|
|||
### User Interaction Instrumentation | |||
|
|||
The UI instrumentation, once enabled, captures transactions for a set of different user interactions, which include clicks, scrolls and swipes. User interaction instrumentation is available for both classic Android Views as well as Jetpack Compose UI. |
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.
The UI instrumentation, once enabled, captures transactions for a set of different user interactions, which include clicks, scrolls and swipes. User interaction instrumentation is available for both classic Android Views as well as Jetpack Compose UI. | |
The UI instrumentation, once enabled, captures transactions for a set of different user interactions, which include clicks, scrolls and swipes. User interaction instrumentation is available for both classic Android Views as well as the Jetpack Compose UI. |
src/platforms/android/common/performance/instrumentation/automatic-instrumentation.mdx
Outdated
Show resolved
Hide resolved
src/platforms/android/common/performance/instrumentation/automatic-instrumentation.mdx
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.
I know this is still in draft, but I just made some wording and style fixes.
…atic-instrumentation.mdx Co-authored-by: Isabel <[email protected]>
…atic-instrumentation.mdx Co-authored-by: Isabel <[email protected]>
…atic-instrumentation.mdx Co-authored-by: Isabel <[email protected]>
src/platforms/android/common/performance/instrumentation/automatic-instrumentation.mdx
Outdated
Show resolved
Hide resolved
…atic-instrumentation.mdx
Can we also maybe update the Jetpack Compose page? (maybe we could have subsections for navigation and UI events, or just change the wording a bit) Also, maybe we should update the Basic Options section with the new flags ( Otherwise the PR looks good 👍 |
<application> | ||
<meta-data android:name="io.sentry.traces.user-interaction.enable" android:value="true" /> | ||
</application> | ||
The SDK composes the transaction name out of the host `Activity` and the `tag` set by way of `Modifier.testTag("<tag>")` of the Composable (for example, `LoginActivity.login_button`). The transaction operation is set to `ui.action` plus the interaction type (one of `click`, `scroll`, or `swipe`). |
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.
Using the testTag for monitoring in production seems a bit awkward to me. Maybe we should define our own Modifier?
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.
Good point! @romtsn and I discussed about this as well..testTag()
is used for writing Jetpack Compose UI tests to identify an element within the view hierarchy. So the use case is quite similar to ours.
I see two advantages:
- it will work out of the box for any existing Composables
- there's no need for an extra API
- If we would introduce our own modifier, the users would probably end up setting the same value there as well:
Button(
modifier = Modifier
.testTag("button_login")
.sentryTag("button_login") {
...
}
But yeah I see your point, it still could be confusing. Maybe let's wait for some user feedback and add our own API if necessary?
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.
yep - our ultimate goal would also be to automatically generate the transaction name through SAGP (either bytecode manipulation or kotlin compiler plugin), so long-term users will only need this as a fallback in rare cases, so I think it's a good middle-ground
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.
What about using testTag
as a fallback if sentryTag
is not set? So if you are already using testTag
you are fine, because you don't have to set it twice. If you use both, sentryTag
wins. Finally, we recommend using sentryTag
. I'm also fine with not adding sentryTag
in the first iteration. It's always easier to add APIs than to remove them.
…entry-docs into feat/compose-ui-transactions
src/platforms/android/configuration/integrations/jetpack-compose.mdx
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.
lgtm 🚀 just one thing about the gradle setup. @imatwawana do you want to have another look at the updated docs please?
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.
Made some wording tweaks and fixed some formatting stuff (adding line breaks etc).
src/platforms/android/common/performance/instrumentation/automatic-instrumentation.mdx
Outdated
Show resolved
Hide resolved
src/platforms/android/common/performance/instrumentation/automatic-instrumentation.mdx
Outdated
Show resolved
Hide resolved
src/platforms/android/common/performance/instrumentation/automatic-instrumentation.mdx
Outdated
Show resolved
Hide resolved
src/platforms/android/configuration/integrations/jetpack-compose.mdx
Outdated
Show resolved
Hide resolved
src/platforms/android/configuration/integrations/jetpack-compose.mdx
Outdated
Show resolved
Hide resolved
src/platforms/android/configuration/integrations/jetpack-compose.mdx
Outdated
Show resolved
Hide resolved
src/platforms/android/common/performance/instrumentation/automatic-instrumentation.mdx
Show resolved
Hide resolved
src/platforms/android/common/performance/instrumentation/automatic-instrumentation.mdx
Show resolved
Hide resolved
src/platforms/android/configuration/integrations/jetpack-compose.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: Isabel <[email protected]> Co-authored-by: Roman Zavarnitsyn <[email protected]>
…entry-docs into feat/compose-ui-transactions
Add docs for automatic Jetpack Compose transactions.
Related
sentry-java
PR: getsentry/sentry-java#2390TODOs