feat: add root-level methods and raw address properties to SentryInternalApi - #8097
Merged
Merged
Conversation
Contributor
|
philprime
force-pushed
the
philprime/internal-api/root-methods
branch
from
June 16, 2026 14:29
0ab4bbd to
35e90bb
Compare
📲 Install BuildsiOS
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 92bcc8f | 1233.43 ms | 1270.20 ms | 36.77 ms |
| ccf353a | 1233.79 ms | 1268.77 ms | 34.98 ms |
| 207a888 | 1215.22 ms | 1248.98 ms | 33.75 ms |
| 909f4ae | 1222.85 ms | 1253.26 ms | 30.41 ms |
| bdd8e0e | 1233.35 ms | 1266.96 ms | 33.60 ms |
| 9787f05 | 1233.67 ms | 1269.00 ms | 35.33 ms |
| 8bb6aeb | 1215.82 ms | 1244.84 ms | 29.02 ms |
| 09627e8 | 1223.68 ms | 1261.95 ms | 38.27 ms |
| fc4e913 | 1221.61 ms | 1253.82 ms | 32.21 ms |
| e3147fd | 1227.15 ms | 1257.79 ms | 30.63 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 92bcc8f | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| ccf353a | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| 207a888 | 24.14 KiB | 1.18 MiB | 1.15 MiB |
| 909f4ae | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| bdd8e0e | 24.14 KiB | 1.16 MiB | 1.13 MiB |
| 9787f05 | 24.14 KiB | 1.18 MiB | 1.15 MiB |
| 8bb6aeb | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| 09627e8 | 24.14 KiB | 1.17 MiB | 1.14 MiB |
| fc4e913 | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| e3147fd | 24.14 KiB | 1.17 MiB | 1.14 MiB |
Previous results on branch: philprime/internal-api/root-methods
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4a5ae2e | 1220.11 ms | 1249.62 ms | 29.51 ms |
| cf296cb | 1221.90 ms | 1253.94 ms | 32.04 ms |
| b1b3e20 | 1222.13 ms | 1244.56 ms | 22.43 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 4a5ae2e | 24.14 KiB | 1.19 MiB | 1.17 MiB |
| cf296cb | 24.14 KiB | 1.19 MiB | 1.17 MiB |
| b1b3e20 | 24.14 KiB | 1.19 MiB | 1.17 MiB |
philprime
force-pushed
the
philprime/internal-api/root-methods
branch
from
June 22, 2026 08:16
67bfb99 to
f0b92fd
Compare
Inject Hub, ClientProvider, and OptionsDeserializer dependencies instead of calling PrivateSentrySDKOnly static methods directly. - setTrace delegates to Hub.setTrace via new Scope convenience method - options getter uses ClientProvider.client.options - options(fromDictionary:) uses injectable OptionsDeserializer - Revert unnecessary SENTRY_SWIFT_MIGRATION_ID on options property
Add UInt64 address properties alongside the existing hex string properties on SentryDebugMeta and SentryObjCDebugMeta. Hybrid SDKs can now access raw numeric addresses without parsing hex strings. Populated from SentryBinaryImageInfo in both SentryDebugImageProvider and SentryInternalDebugApi.images(forAddresses:). Not included in event serialization as the hex strings already cover that.
SentryClient.options returns SentryOptions * which is an incomplete type from Swift in the xcframework build. Route through the Hub protocol using getClient()?.getOptions() (returns NSObject) instead, matching the pattern used for storeEnvelope/captureEnvelope.
Member
Author
|
@sentry review |
philprime
marked this pull request as ready for review
June 22, 2026 09:33
philprime
requested review from
NinjaLikesCheez,
itaybre,
noahsmartin and
philippsuess
as code owners
June 22, 2026 09:33
philprime
enabled auto-merge (squash)
June 22, 2026 11:12
limbonaut
approved these changes
Jun 22, 2026
Revert SENTRY_SWIFT_MIGRATION_ID and NS_SWIFT_NAME on PrivateSentrySDKOnly.optionsWithDictionary to avoid breaking hybrid SDK callers (React Native, Flutter, etc.). Move the Swift migration bridge to a new internal SentryOptionsHelper class used only by SentryDependencyContainer.
philprime
disabled auto-merge
June 23, 2026 11:38
NinjaLikesCheez
approved these changes
Jun 23, 2026
NinjaLikesCheez
left a comment
Member
There was a problem hiding this comment.
LGTM, one small comment
itaybre
pushed a commit
that referenced
this pull request
Jun 26, 2026
This was referenced Jun 29, 2026
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Adds root-level methods to
SentryInternalApiand extendsDebugMetawith raw numeric address properties.Root-level methods on
SentryInternalApisetTrace(_:spanId:)— sets propagation context on the current scopesetLogOutput(_:)— configures SDK log outputignoreNextSignal(_:)— tells SentryCrash to ignore the next signaloptions— returns the current SDK optionsoptions(fromDictionary:)— deserializes options from a dictionaryAll methods are also exposed on
SentryObjCInternalApifor ObjC consumers.Dependency injection in
SentryInternalApiReplaced direct
PrivateSentrySDKOnlystatic calls with injected dependencies:Hubprotocol (withsetTracemethod)ClientProviderprotocol (for options access)OptionsDeserializerProviderprotocol (for dictionary-to-options)Raw address properties on
DebugMetaAdded
imageAddressRaw(UInt64) andimageVmAddressRaw(UInt64) toSentryDebugMeta,DebugMeta, andSentryObjCDebugMeta. These live alongside the existing hex string properties (imageAddress,imageVmAddress). Hybrid SDKs can use the raw values directly without parsing hex strings.SentryDebugImageProvider.debugMeta(from:)andSentryInternalDebugApi.images(forAddresses:)Closes #8039
💡 Motivation and Context
Hybrid SDKs (React Native, Flutter, .NET, Unity) need access to the same root-level SDK operations currently only available through
PrivateSentrySDKOnly. The structuredSentrySDK.internalAPI provides a cleaner, more discoverable surface. Raw address properties were requested to avoid hex string parsing overhead in hybrid SDKs.💚 How did you test it?
SentryInternalApimethods (SentryInternalApiIntegrationTests)SentryObjCInternalApi(SentryObjCInternalApiIntegrationTests)imageAddressRaw/imageVmAddressRawonSentryDebugMeta(SentryDebugMetaTests)SentryInternalDebugApi(SentryInternalDebugApiTests)SentryObjCDebugMetaraw address properties (SentryObjCDebugMetaTests)make test-macospassing📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.