Skip to content

docs: Update Android WebView guidance for connected traces #6161

Open

Description

@antonis

Outcome

Replace the current Android WebView guidance — which states the SDK "doesn't interact with the mobile application's web views" — with setup for the new trace-connection support.

Acceptance criteria

  • Documents SentryWebViewTracing.addTracePropagation(webView, allowedHosts...). It writes the native trace into the page as sentry-trace and baggage meta tags at document start, using androidx.webkit's WebViewCompat.addDocumentStartJavaScript.
  • Documents the prerequisites:
    • the app adds the androidx.webkit:webkit dependency;
    • the System WebView supports document-start scripts (minimum version TBD);
    • the call is made on the main thread, before loadUrl;
    • otherwise the call logs a warning and returns false.
  • Documents allowedHosts as a trust boundary, separate from tracePropagationTargets:
    • matching covers the host and its subdomains, over https;
    • a non-default port in an entry is kept.
  • Documents that the page in the WebView must run @sentry/browser with browserTracingIntegration.
  • Documents the limitations:
    • the trace is a snapshot taken at call time, so call it again to update it for a later page load;
    • only the main frame receives it, and only the entry pageload continues the trace;
    • sentry-transaction is removed from baggage;
    • native and web sampling can differ when no span is active;
    • Custom Tabs and loadData/file:// content aren't supported (use WebViewAssetLoader for bundled pages).
  • Wording coordinated with the Apple and React Native WebView doc updates for cross-platform consistency.

References

Activity

  1. linear-code commented on Sep 24, 2026

    @linear-code
  2. self-assigned this
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions