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.
📲 Install BuildsiOS
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 6beeea8 | 1220.50 ms | 1253.93 ms | 33.43 ms |
| 5a9c804 | 1220.29 ms | 1255.17 ms | 34.88 ms |
| 2ce4807 | 1220.52 ms | 1254.02 ms | 33.50 ms |
| b69e199 | 1210.45 ms | 1251.13 ms | 40.68 ms |
| 35901c8 | 1217.02 ms | 1259.13 ms | 42.11 ms |
| 3b7d81f | 1220.53 ms | 1239.06 ms | 18.53 ms |
| 871ce4d | 1223.43 ms | 1257.17 ms | 33.75 ms |
| a879c92 | 1229.37 ms | 1262.33 ms | 32.97 ms |
| fc5cefc | 1222.44 ms | 1254.20 ms | 31.77 ms |
| 56dbf49 | 1236.41 ms | 1261.31 ms | 24.89 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 6beeea8 | 24.14 KiB | 1.23 MiB | 1.21 MiB |
| 5a9c804 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| 2ce4807 | 24.14 KiB | 1.23 MiB | 1.20 MiB |
| b69e199 | 24.14 KiB | 1.24 MiB | 1.22 MiB |
| 35901c8 | 24.14 KiB | 1.24 MiB | 1.21 MiB |
| 3b7d81f | 24.14 KiB | 1.22 MiB | 1.20 MiB |
| 871ce4d | 24.14 KiB | 1.22 MiB | 1.20 MiB |
| a879c92 | 24.14 KiB | 1.25 MiB | 1.23 MiB |
| fc5cefc | 24.14 KiB | 1.17 MiB | 1.14 MiB |
| 56dbf49 | 24.14 KiB | 1.27 MiB | 1.25 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 |
| af59095 | 1215.42 ms | 1254.00 ms | 38.58 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| bbe0e31 | 24.14 KiB | 1.27 MiB | 1.24 MiB |
| af59095 | 24.14 KiB | 1.27 MiB | 1.25 MiB |
itaybre
left a comment
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
|
@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. |
|
I agree with @itaybre. We already sent this information with the events. We pull the features list from the scope. I tried to get that info in Hex, but we don't index that info yet. @itaybre I think we should talk to the data team and ask them to index this, so we see how many projects and orgs use this. Maybe also numbers on how many events have feature flags and how many would be useful, but mostly how many orgs and projects. As I'm on PTO soon, @itaybre or @denrase, could you maybe talk to the data team so we get this info? Then we could close this PR. |
|
@philipphofmann Will do, putting this in draft/blocked for now until we have an aswer. |
#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.