chore: Add tracking for feature flags - #8678
Open
denrase wants to merge 4 commits into
Open
Conversation
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
marked this pull request as ready for review
August 4, 2026 16:32
denrase
requested review from
NinjaLikesCheez,
itaybre,
noahsmartin,
philipphofmann and
philprime
as code owners
August 4, 2026 16:32
📲 Install BuildsiOS
|
Contributor
Performance metrics 🚀
|
| 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 |
itaybre
reviewed
Aug 4, 2026
itaybre
left a comment
Contributor
There was a problem hiding this comment.
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
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
marked this pull request as draft
August 5, 2026 07:24
denrase
marked this pull request as ready for review
August 5, 2026 11:54
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.
#skip-changelog
📜 Description
Track runtime use of the manual feature flag APIs by adding
featureFlagstosdk.featuresafter 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?
featureFlagsappears in the event'ssdk.featuresJSON.📝 Checklist
sendDefaultPIIis enabled.