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
{{ message }}
Repository navigation
Automatic WebView trace propagation via the Gradle plugin #6407
Connect native traces with WebView content without a manual SentryWebViewTracing.addTracePropagation call per WebView, and with a fresh trace on each page load.
Context
#6395 adds SentryWebViewTracing.addTracePropagation(webView, allowedHosts...), which has two limits:
the app must call it for each WebView;
the injected trace is a snapshot taken at call time, so later loads reuse it until the app calls it again.
Proposal
Add an opt-in WEBVIEW feature to the Sentry Android Gradle Plugin's tracingInstrumentation.features:
rewrite WebView.loadUrl(...) call sites to go through an internal hook in sentry-android-core, which installs the trace for the configured hosts right before the load;
add an app-wide allowed-hosts setting, e.g. webViewAllowedHosts, passed to the SDK through SentryAndroidOptions.
The bytecode work belongs in getsentry/sentry-android-gradle-plugin; the runtime hook belongs in this repo.
Open questions
App-wide hosts. v1 keeps allowedHosts per WebView on purpose, because it is a trust boundary. Is an app-wide list acceptable? Needs Security input (SEC-1935).
Navigations inside the page. Links followed inside the page don't go through loadUrl, so they would keep the last trace. Is that acceptable, or should we also hook WebViewClient callbacks?
Libraries. Should WebViews created inside libraries be covered? That depends on the plugin instrumenting dependencies.
Activity
linear-code commentedon Oct 28, 2026
JAVA-818