Skip to content

chore: Add tracking for feature flags - #8678

Open
denrase wants to merge 4 commits into
mainfrom
chore/add-tracking-for-feature-flags
Open

chore: Add tracking for feature flags#8678
denrase wants to merge 4 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 feature flag usage is 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 1215.42 ms 1254.00 ms 38.58 ms
Size 24.14 KiB 1.27 MiB 1.25 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
df67624 1225.12 ms 1259.90 ms 34.78 ms
6e35062 1232.19 ms 1262.91 ms 30.73 ms
220d7ef 1238.77 ms 1267.42 ms 28.65 ms
4b5a1d7 1235.27 ms 1264.49 ms 29.22 ms
9319185 1223.24 ms 1249.98 ms 26.73 ms
d0b52d1 1227.31 ms 1258.32 ms 31.01 ms
b6b0d1d 1236.69 ms 1270.22 ms 33.52 ms
5b1c31e 1221.35 ms 1246.14 ms 24.79 ms
9787f05 1233.67 ms 1269.00 ms 35.33 ms
29d1b7f 1220.58 ms 1254.14 ms 33.56 ms

App size

Revision Plain With Sentry Diff
df67624 24.14 KiB 1.14 MiB 1.12 MiB
6e35062 24.14 KiB 1.22 MiB 1.20 MiB
220d7ef 24.14 KiB 1.17 MiB 1.14 MiB
4b5a1d7 24.14 KiB 1.22 MiB 1.20 MiB
9319185 24.14 KiB 1.16 MiB 1.13 MiB
d0b52d1 24.14 KiB 1.15 MiB 1.13 MiB
b6b0d1d 24.14 KiB 1.18 MiB 1.16 MiB
5b1c31e 24.14 KiB 1.24 MiB 1.22 MiB
9787f05 24.14 KiB 1.18 MiB 1.15 MiB
29d1b7f 24.14 KiB 1.26 MiB 1.23 MiB

Previous results on branch: chore/add-tracking-for-feature-flags

Startup times

Revision Plain With Sentry Diff
bbe0e31 1227.21 ms 1260.16 ms 32.95 ms

App size

Revision Plain With Sentry Diff
bbe0e31 24.14 KiB 1.27 MiB 1.24 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
@denrase
denrase marked this pull request as ready for review August 5, 2026 11:54
@denrase
denrase requested a review from itaybre August 5, 2026 11:54
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