You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/android/integrations/jetpack-compose/index.mdx
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Once performance metrics have been enabled, you'll see two spans inside your tra
38
38
-`ui.compose.composition`, describing the time it took to execute your `@Composable`
39
39
-`ui.compose.rendering`, describing the time it took to render your `@Composable` to the canvas
40
40
41
-
The `SentryTraced` function also provides an `enableUserInteractionTracing` argument, which automatically applies a `Modifier.testTag()` and enables the _User Interactions_ feature mentioned below.
41
+
The `SentryTraced` function also provides an `enableUserInteractionTracing` argument, which automatically applies a `Modifier.sentryTag()` and enables the _User Interactions_ feature mentioned below.
The Sentry SDK utilizes the built-in `Modifier.testTag("<tag>")` of a Composable to determine its identifier. Here's an example:
113
+
#### Capture Composables
114
+
115
+
The Sentry SDK requires you to have either `Modifier.sentryTag("<tag>")` or `Modifier.testTag("<tag>")` applied on each `@Composable` you want to capture to determine its identifier.
116
+
Here's an example:
114
117
115
118
```kotlin
116
-
importandroidx.compose.ui.platform.testTag
119
+
importio.sentry.compose.sentryTag
117
120
118
121
@Composable
119
122
funLoginScreen() {
120
123
Column {
121
124
// ...
122
125
Button(
123
-
modifier =Modifier.testTag("button_login"),
126
+
modifier =Modifier.sentryTag("button_login"),
124
127
onClick = { TODO() }) {
125
128
Text(text ="Login")
126
129
}
@@ -130,7 +133,8 @@ fun LoginScreen() {
130
133
131
134
<Note>
132
135
133
-
If a `@Composable` doesn't have a `testTag` modifier applied, both breadcrumbs and transactions won't be captured because they can't be uniquely identified. To automatically generate tags, refer to the docs about our <PlatformLinkto="/enhance-errors/kotlin-compiler-plugin/">Sentry Kotlin Compiler Plugin</PlatformLink>.
136
+
If a `@Composable` doesn't have a `.sentryTag` or a `.testTag` modifier applied, both breadcrumbs and transactions won't be captured because they can't be uniquely identified.
137
+
To automatically generate tags, refer to the docs about our <PlatformLinkto="/enhance-errors/kotlin-compiler-plugin/">Sentry Kotlin Compiler Plugin</PlatformLink>.
Copy file name to clipboardExpand all lines: docs/platforms/android/performance/instrumentation/automatic-instrumentation.mdx
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -278,17 +278,18 @@ If the view doesn't have the `id` assigned, the transaction won't be captured be
278
278
279
279
_(New in version 6.10.0)_
280
280
281
-
The SDK composes the transaction name out of the host `Activity` and the `tag` set by way of the `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`).
281
+
The SDK composes the transaction name out of the host `Activity` and the `tag` set by way of the `Modifier.sentryTag("<tag>")` of the `Composable` (for example, `LoginActivity.login_button`).
282
+
The transaction operation is set to `ui.action` plus the interaction type (one of `click`, `scroll`, or `swipe`).
282
283
283
284
```kotlin
284
-
importandroidx.compose.ui.platform.testTag
285
+
importio.sentry.compose.sentryTag
285
286
286
287
@Composable
287
288
funLoginScreen() {
288
289
Column {
289
290
// ...
290
291
Button(
291
-
modifier =Modifier.testTag("button_login"),
292
+
modifier =Modifier.sentryTag("button_login"),
292
293
onClick = { TODO() }) {
293
294
Text(text ="Login")
294
295
}
@@ -298,7 +299,8 @@ fun LoginScreen() {
298
299
299
300
<Note>
300
301
301
-
If the `@Composable` doesn't have a `testTag` modifier applied, the transaction won't be captured because it can't be uniquely identified. To capture a transaction for the `@Composable`, you must either add a `testTag` modifier or enable automatic `@Composable` tagging.
302
+
If the `@Composable` doesn't have a `sentryTag` modifier applied, the transaction won't be captured because it can't be uniquely identified.
303
+
To capture a transaction for the `@Composable`, you must either add a `sentryTag` modifier or enable automatic `@Composable` tagging.
302
304
303
305
</Note>
304
306
@@ -310,7 +312,9 @@ The Sentry Kotlin Compiler plugin is considered _experimental_. Give it a try an
310
312
311
313
</Note>
312
314
313
-
The <PlatformLinkto="/enhance-errors/kotlin-compiler-plugin/">Sentry Kotlin Compiler Plugin</PlatformLink> can automatically enrich your `@Composable` functions during compilation with a tag name, based on the function name of your `@Composable`. In order to use this feature, the Sentry Kotlin Compiler plugin needs to be applied to all modules, which contain `@Composable` elements.
315
+
The <PlatformLinkto="/enhance-errors/kotlin-compiler-plugin/">Sentry Kotlin Compiler Plugin</PlatformLink> can automatically enrich your `@Composable` functions during compilation with a tag name,
316
+
based on the function name of your `@Composable`.
317
+
In order to use this feature, the Sentry Kotlin Compiler plugin needs to be applied to all modules, which contain `@Composable` elements.
0 commit comments