When a server says “slow down”, a well-behaved SDK waits. When that wait has no limit, logs from your app can go missing for a long time, just when you need them to diagnose a problem. You see a gap in your data and assume the app was quiet, when in fact it was queued.
PostHog iOS SDK 3.92.0 now lets a Retry-After header pause log uploads for at most 5 minutes. The same release drops log attributes with an empty key instead of sending them, and sends queued events, replay snapshots and logs when close() is called. Together these change how fresh and how clean your log data is.
Data Points to Track
- log_upload_status: success, throttled or failed
- retry_after_seconds: the value the server asked for
- pause_applied_seconds: the wait actually used, capped at 300
- queued_log_count: logs waiting at the time of the pause
- log_delay_seconds: time between creation and delivery
- dropped_attribute_count: attributes removed for an empty key
- flush_on_close: whether
close()triggered a send - app_state: foreground, background or terminating
- network_type: Wi-Fi or cellular
- posthog_ios_version: SDK version in use
Setup Steps
- Upgrade the PostHog iOS SDK to 3.92.0 or later.
- Add a delay metric by comparing each log’s creation time with its arrival time.
- Simulate throttling with a test endpoint that returns
Retry-After: 900. - Confirm the pause is limited to 5 minutes and uploads then resume.
- Audit attribute keys in your logging code and fix any that can be empty.
- Call
close()in a test and confirm queued logs arrive. - Chart the delay as a percentile, not an average.
- Alert when the 95th percentile delay exceeds 5 minutes.
Actionable Insights
A rising delay after a release usually means you are logging too much. Throttling is a signal to cut volume, not simply to wait. Look at which log levels and screens produce the most entries.
If logs from the end of a session arrive late, check how your app shuts down. Flushing on close() helps, but sessions ended by the system can still leave data waiting.
Dropped attributes point to a bug in your code. A key built from a missing value is the usual cause. Fix the source rather than relying on the SDK to discard it.
Compare delay across networks. Long delays on cellular but not Wi-Fi suggest batching or connectivity problems, not server limits.
Common Pitfalls
Do not treat missing logs as proof nothing happened. Check delay first.
Do not alert on averages. A few long pauses hide inside a healthy mean.
Do not assume a 5 minute cap fixes heavy logging. It limits waiting, not volume.
Why Product Teams Should Care
Logs are how engineers explain a bad user experience. Timely, complete logs shorten the time from complaint to cause.