Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
)
}