Product Benefits Pricing Guides Docs About Contact us Try it out
Performance

PostHog Feature Flag Retry Tracking

PostHog feature flag retry tracking: measure flag load failures after iOS 3.91.2 and Android 3.72.1 retry DNS and TLS errors.

· 3 min read

Feature flags decide what your user sees in the first second of a session. If the flag request fails, the app falls back to defaults, and your experiment quietly serves the wrong variant to people on weak connections. Those are often the users you most need to understand.

PostHog iOS 3.91.2 and Android 3.72.1 now retry feature flag requests after DNS and TLS handshake failures, and iOS also retries no-internet failures. Before, only timeouts and lost connections were retried. More flag loads should succeed, which is good, but it also changes your baselines.

Data Points to Track

  • flag_request_outcome: success, retried success, or failed
  • retry_count: attempts before the flag payload loaded
  • failure_type: DNS, TLS, timeout, offline
  • time_to_flags_ready: milliseconds from SDK setup to flags available
  • flag_key and variant: what was served
  • used_fallback: whether the default value was used
  • network_type: wifi, cellular, offline
  • sdk_version and app_version: to split pre and post upgrade

Setup Steps

  1. Upgrade iOS to 3.91.2 or later and Android to 3.72.1 or later.
  2. Add a custom event such as flags_ready, fired when the SDK reports flags loaded, with elapsed time.
  3. Add a fallback event when your code reads a flag and gets the default because none loaded.
  4. Tag network_type from the platform connectivity API.
  5. Build a dashboard of fallback rate and time_to_flags_ready by app version.
  6. Compare the two weeks before and after rollout.
  7. Alert if fallback rate exceeds your threshold on any version.

Actionable Insights

A falling fallback rate on the new SDK shows retries are working. Expect experiment exposure counts to rise as more devices receive a variant.

If time_to_flags_ready grows at the high percentiles, retries are adding delay. Consider showing a neutral loading state or defaulting safely rather than blocking the first screen.

Split fallback rate by network type. A high rate on cellular only suggests carrier DNS problems rather than your own backend.

Experiment results need care. If exposure grows for users on poor networks, the mix of participants changes mid-test. Note the SDK upgrade date on running experiments.

Common Pitfalls

Do not treat a lower fallback rate as proof that all users are served correctly. Cached flags from a previous session can mask failures. Also test with airplane mode and a bad DNS profile, not just a healthy connection.

Why Product Teams Should Care

Experiments are only as fair as their exposure. If a slice of users never receives a variant, your result describes the well-connected majority, not your whole audience. Ask engineering for the fallback rate on every running experiment and review it alongside the headline metric. A small, steady fallback rate is normal. A sudden change after an SDK upgrade deserves a note on the experiment record before anyone reads the result.