Skip to content

ref: Extract outgoing trace lookup - #9487

Merged
antonis merged 1 commit into
mainfrom
ref/outgoing-trace
Nov 3, 2026
Merged

antonis merged 1 commit into
mainfrom
ref/outgoing-trace

Conversation

@antonis

@antonis antonis commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Moves the lookup of the trace propagated to outgoing requests from SentryNetworkTracker into a new internal SentryOutgoingTrace. It returns the span bound to the scope if it belongs to a tracer, otherwise the scope's propagation context, together with the matching baggage.

Behavior is unchanged. SentryNetworkTracker is high-risk code, so this is split out of #9474, which reuses the same lookup for WebView trace propagation. isFromSpan is used by #9474.

💡 Motivation and Context

Split out of #9474 to review the SentryNetworkTracker change on its own.

💚 How did you test it?

  • Added SentryOutgoingTraceTests for the propagation context, a tracer, and a child span bound to the scope
  • SentryNetworkTrackerTests and SentryNetworkTrackerIntegrationTests pass on macOS and the iOS 26.5 simulator

📝 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.

#skip-changelog

Move the lookup of the trace propagated to outgoing requests from
SentryNetworkTracker into SentryOutgoingTrace: the span bound to the
scope if it belongs to a tracer, otherwise the scope's propagation
context. Behavior is unchanged.

This lets WebView trace propagation reuse the same lookup.
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Swift/Networking/SentryNetworkTracker.swift

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

@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 725d08b. Configure here.

@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 (+837 B) 3.2 MB (0 B)

Configure sentry-cocoa status check rules

@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

@antonis
antonis marked this pull request as ready for review October 29, 2026 10:52
@antonis
antonis requested review from a team and noahsmartin as code owners October 29, 2026 10:52
@antonis
antonis requested review from itaybre and philprime and removed request for a team October 29, 2026 10:52

@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

@antonis
antonis merged commit 5a805b9 into main Nov 3, 2026
341 of 360 checks passed
@antonis
antonis deleted the ref/outgoing-trace branch November 3, 2026 08:23
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