Skip to content

feat: Add SentryObjC WebView trace propagation - #9488

Open
antonis wants to merge 4 commits into
feat/webview-trace-propagationfrom
feat/webview-trace-propagation-objc
Open

antonis wants to merge 4 commits into
feat/webview-trace-propagationfrom
feat/webview-trace-propagation-objc

Conversation

@antonis

@antonis antonis commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Stacked on #9474, which adds SentryWebViewTracing.

Exposes WebView trace propagation through the SentryObjC SDK.

SentryObjCWebViewTracingOptions *options =
    [[SentryObjCWebViewTracingOptions alloc] initWithAllowedHosts:@[ @"app.example.com" ]];
[SentryObjCWebViewTracing addTracePropagationToWebView:webView options:options];
  • SentryObjCWebViewTracing has overloads for WKUserContentController, WKWebViewConfiguration, and WKWebView, and forwards to SentryWebViewTracing. The SwiftUI WebPage overload is Swift-only.
  • Returns YES if the script was added. Called off the main thread, it returns NO instead of trapping.
  • Available on iOS, macOS (including Mac Catalyst) and visionOS.

💡 Motivation and Context

Split out of #9474 to keep it focused on the Swift API. Public APIs need to be exposed through SentryObjC before release.

💚 How did you test it?

  • Added SentryObjCWebViewTracingTests for each overload, repeated calls, a closed SDK, and calls off the main thread
  • Built SentryObjC for iOS and ran the tests on macOS

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Expose SentryWebViewTracing through the SentryObjC SDK as
SentryObjCWebViewTracing and SentryObjCWebViewTracingOptions, with
overloads for WKUserContentController, WKWebViewConfiguration, and
WKWebView. Calls off the main thread return NO.
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 03ee99f

@antonis antonis added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Oct 29, 2026
@sentry

sentry Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
SDK-Size io.sentry.sample.SDK-Size 9.32.0 (1) Release

⚙️ sentry-cocoa Build Distribution Settings

@sentry

sentry Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Size Analysis

1 component analyzed

iOS Builds

Name Configuration Version Download Size Install Size
SDK-Size (iOS)
io.sentry.sample.SDK-Size
Release 9.32.0 (1) 1.2 MB (+6 B) 3.2 MB (0 B)

Configure sentry-cocoa status check rules

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7d10643. Configure here.

@antonis
antonis marked this pull request as ready for review October 29, 2026 13:01
@antonis
antonis requested review from a team and noahsmartin as code owners October 29, 2026 13:01
@antonis
antonis requested review from 0xadam-brown, alwx, buenaflor, itaybre, philprime and runningcode and removed request for a team October 29, 2026 13:01

@itaybre itaybre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants