Advertisement
Advanced Flutter, Error Handling & Crash Reporting (Sentry & Crashlytics)

How can custom keys, breadcrumbs, and user context attached to a crash report help a development team dramatically speed up diagnosing and reproducing a genuinely difficult, hard to reproduce production issue?

Short answer

Attaching genuinely relevant custom contextual information to a crash report, such as a specific user identifier, which particular feature flags were currently active for that user, the exact specific screen they were viewing, or a detailed sequence of breadcrumbs showing their…

Save Flutter mock interview
Advertisement
AModel answer
Attaching genuinely relevant custom contextual information to a crash report, such as a specific user identifier, which particular feature flags were currently active for that user, the exact specific screen they were viewing, or a detailed sequence of breadcrumbs showing their recent actions leading up to the actual error, gives a development team substantially more useful information than a bare stack trace alone, often making the difference between quickly and confidently reproducing and fixing a genuinely difficult issue versus being left simply guessing at its actual underlying root cause with very little concrete information to actually work from.
FirebaseCrashlytics.instance.setCustomKey('feature_flag_new_checkout', true);
FirebaseCrashlytics.instance.setUserIdentifier(userId);
Real-world example
A team diagnosing a crash that only seems to affect a small subset of users discovers, using custom keys attached to their crash reports, that every single affected user happened to have one specific experimental feature flag enabled, immediately pointing them directly toward the actual underlying root cause.
Likely follow-ups
  • What personal or sensitive information should generally be avoided when attaching custom context to a crash report?
  • How do you properly and consistently set a user identifier across both Crashlytics and Sentry simultaneously?
Related topics