Loading…
Any Apple update can break our app. Here's how we find out first.
SentryDan Mindru, Oleh Stasula
Summary
Usage is an Apple ecosystem resource monitor that relies on undocumented APIs vulnerable to silent data structure changes across OS updates. To maintain stability across iPhone, iPad, and Mac without degrading device performance, the development team uses Sentry across separate component projects in a unified workspace. Beyond capturing standard crashes, the team wraps Swift errors with unexpected raw data payloads to quickly diagnose undocumented API structure drift while scrubbing sensitive user values. They also employ Sentry Size Analysis as a regression gate to monitor release payload deltas, preventing unintended asset omissions or bloat from slipping through code reviews. This multi-layered monitoring setup enables the team to detect and resolve platform-induced breakages before most end users encounter them.
Context
Usage is an Apple system monitor that depends on undocumented APIs without deprecation notices, exposing the app to silent data structure changes across OS updates and hardware generations. In addition, its architecture spans multiple cooperating processes with distinct lifecycles, and manual reviews previously missed a refactoring error that removed a localization file and hurt active usage in production.
Approach / What changed
The team separates monitoring across app targets into individual Sentry projects under a unified workspace. They capture non-fatal decoding errors using a Swift Error wrapper that attaches unexpected payload structures to Sentry extras while scrubbing private data. They also implement Sentry Size Analysis with delta alert monitors on every release build to detect missing assets or bloat, and instrument counters and gauges using Sentry Metrics.
Takeaways
- Wrapping Swift errors to attach raw payload structures provides necessary diagnostic context to resolve undocumented OS schema changes that stack traces alone cannot explain.
- Separating multi-process app targets into distinct monitoring projects under a shared workspace ensures crash attribution to specific processes like background services and widgets.
- Tracking build size deltas between releases serves as a regression gate to catch missing localization files, dropped bundle assets, or unexpected binary bloat.
Related reading
Sentry ·
When and what should I be logging?
Targeted structured logging provides a fast way to capture operational behavior in production without requiring new deployments for debugging. Developers benefit most from logging key runtime decisions, multi-step algorithm outcomes, mutating audit operations, and context around non-critical or retried errors. Rather than outputting plain text, applications should record structured key-value pairs that capture who performed an action, what occurred, and associated trace identifiers. Sensitive information such as secrets and personally identifiable data must be excluded or scrubbed, and large unparsed payloads should be avoided to prevent excessive costs. Managing log levels appropriately and treating logs as potentially temporary instrumentation helps maintain actionable telemetry without generating unnecessary noise.
Ben CoeSentry ·
You don’t need to pick one: how Sentry and OpenTelemetry work together