Skip to content

Commit

Permalink
Overload withSentryObservableEffect to provide compose instrumentatio…
Browse files Browse the repository at this point in the history
…n hook(#2320)
  • Loading branch information
markushi committed Oct 28, 2022
1 parent 0fbe535 commit b516cf3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

### Features
- Provide hook for Jetpack Compose navigation instrumentation ([#2320](https://github.com/getsentry/sentry-java/pull/2320))

## 6.6.0

### Fixes
Expand Down
Expand Up @@ -37,7 +37,7 @@ internal class SentryLifecycleObserver(

/**
* A [DisposableEffect] that captures a [Breadcrumb] and starts an [ITransaction] and sends
* them to Sentry for when attached to the respective [NavHostController].
* them to Sentry for every navigation event when being attached to the respective [NavHostController].
*
* @param enableNavigationBreadcrumbs Whether the integration should capture breadcrumbs for
* navigation events.
Expand Down Expand Up @@ -73,3 +73,18 @@ public fun NavHostController.withSentryObservableEffect(
}
return this
}

/**
* A [DisposableEffect] that captures a [Breadcrumb] and starts an [ITransaction] and sends
* them to Sentry for every navigation event when being attached to the respective [NavHostController].
*
* Used by the sentry android gradle plugin for Jetpack Compose instrumentation.
*
*/
@Composable
internal fun NavHostController.withSentryObservableEffect(): NavHostController {
return withSentryObservableEffect(
enableNavigationBreadcrumbs = true,
enableNavigationTracing = true
)
}

0 comments on commit b516cf3

Please sign in to comment.