Skip to content

chore: Add tracking for feature flags - #8678

Draft
denrase wants to merge 2 commits into
mainfrom
chore/add-tracking-for-feature-flags
Draft

chore: Add tracking for feature flags#8678
denrase wants to merge 2 commits into
mainfrom
chore/add-tracking-for-feature-flags

Conversation

@denrase

@denrase denrase commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

#skip-changelog

📜 Description

Track runtime use of the manual feature flag APIs by adding featureFlags to sdk.features after the API is used.

Runtime-discovered features are stored internally and thread-safely on the active SDK options, then merged with the existing option-derived features when SDK metadata is built.

💡 Motivation and Context

We want internal telemetry showing actual feature flag API adoption, matching the behavior in sentry-flutter. Inferring this at SDK initialization is not possible because feature flags are enabled through runtime API usage.

Closes #8594

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • If I added a new public API, I also added it to the SentryObjC wrapper.

denrase added 2 commits August 4, 2026 18:21
Record manual feature flag API usage as `featureFlags` in the active SDK options. Merge dynamically discovered features into `sdk.features` for subsequent events and envelope headers.

Keep the tracking internal and thread-safe. This is a best effort, we do not handle uninitialized sdk and crashed events.
@denrase denrase changed the title Chore/add tracking for feature flags chore: Add tracking for feature flags Aug 4, 2026
@denrase denrase self-assigned this Aug 4, 2026
@denrase denrase added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Aug 4, 2026
@denrase
denrase marked this pull request as ready for review August 4, 2026 16:32
@sentry

sentry Bot commented Aug 4, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

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

⚙️ sentry-cocoa Build Distribution Settings

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1227.21 ms 1260.16 ms 32.95 ms
Size 24.14 KiB 1.27 MiB 1.24 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f0c60b7 1224.60 ms 1259.33 ms 34.74 ms
8469478 1240.30 ms 1277.07 ms 36.76 ms
3ba6174 1222.29 ms 1265.35 ms 43.06 ms
91f06a6 1213.64 ms 1259.58 ms 45.93 ms
b6fa517 1218.83 ms 1257.47 ms 38.63 ms
31e3b65 1225.70 ms 1246.98 ms 21.28 ms
00009c7 1231.69 ms 1265.73 ms 34.04 ms
952f116 1221.55 ms 1248.72 ms 27.17 ms
e3070ad 1240.00 ms 1274.43 ms 34.43 ms
07d6099 1224.06 ms 1247.13 ms 23.06 ms

App size

Revision Plain With Sentry Diff
f0c60b7 24.14 KiB 1.22 MiB 1.20 MiB
8469478 24.14 KiB 1.24 MiB 1.21 MiB
3ba6174 24.14 KiB 1.25 MiB 1.23 MiB
91f06a6 24.14 KiB 1.24 MiB 1.21 MiB
b6fa517 24.14 KiB 1.14 MiB 1.12 MiB
31e3b65 24.14 KiB 1.23 MiB 1.21 MiB
00009c7 24.14 KiB 1.24 MiB 1.21 MiB
952f116 24.14 KiB 1.24 MiB 1.21 MiB
e3070ad 24.14 KiB 1.16 MiB 1.14 MiB
07d6099 24.14 KiB 1.17 MiB 1.15 MiB

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

This seems a bit over engineered, at this moment I believe a simple boolean flag would be simpler and if we end up with other features like this we can build the set logic

@denrase

denrase commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

@itaybre Thought I add something generic as we track multiple runtime values in flutter and it's easy to query this data, but we can also do it simpy and then expand if needed.

@denrase
denrase marked this pull request as draft August 5, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Add tracking for feature flags

2 participants