Setting Up Release Health Monitoring (Sentry) for Mobile Apps
Release Health in Sentry is not just a crash counter for a version. It's automatic comparison of every new release with the previous: adoption rate, crash-free rate, error rate over time. If you roll out a version with a regression, Sentry marks it Unhealthy before users notice in reviews.
How Session Tracking Works
Sentry builds Release Health on sessions, not events. A session starts when the app launches and ends when it backgrounds (> 30 seconds) or exits explicitly.
// iOS — Sentry sessions managed automatically when enableAutoSessionTracking = true
SentrySDK.start { options in
options.dsn = "https://[email protected]/project"
options.releaseName = "MyApp@\(Bundle.main.releaseVersionNumber)+\(Bundle.main.buildNumber)"
options.environment = "production"
options.enableAutoSessionTracking = true
options.sessionTrackingIntervalMillis = 30_000 // 30 sec in background = new session
}
// Android
SentryAndroid.init(this) { options ->
options.dsn = "https://[email protected]/project"
options.release = "myapp@${BuildConfig.VERSION_NAME}+${BuildConfig.VERSION_CODE}"
options.environment = "production"
options.enableAutoSessionTracking = true
options.sessionTrackingIntervalMillis = 30_000L
}
The releaseName parameter must match what you pass when uploading dSYM/ProGuard mapping to Sentry — otherwise Release Health and symbolicated traces appear in different "versions" in the UI.
Automation via Sentry CLI
iOS dSYM files must be uploaded to Sentry with every release. In Fastlane:
# Fastfile
lane :upload_dsyms_to_sentry do
sentry_upload_dsym(
auth_token: ENV["SENTRY_AUTH_TOKEN"],
org_slug: "your-org",
project_slug: "ios-app",
dsym_path: "./build/MyApp.app.dSYM"
)
end
Or via sentry-cli in CI/CD:
sentry-cli releases new "[email protected]+456"
sentry-cli releases set-commits "[email protected]+456" --auto
sentry-cli upload-dsyms ./build/MyApp.app.dSYM
sentry-cli releases finalize "[email protected]+456"
set-commits --auto ties git commits to the release — Sentry's Issue tracker shows which commit caused the problem.
Reading Release Health in UI
In Sentry → Releases, each version shows:
| Metric | Description |
|---|---|
| Crash Free Rate | % of sessions without crashes |
| Adoption | % of users on this version of all |
| Sessions | Total number of sessions |
| Issues | New errors first appearing in this version |
Status Unhealthy is set automatically if Crash Free Rate drops > 5% vs the previous release.
Alerts on Degradation
# Sentry API — create Alert Rule
import requests
rule = {
"name": "Release Health Degradation",
"environment": "production",
"actionMatch": "all",
"conditions": [
{
"id": "sentry.rules.conditions.regression_event.RegressionEventCondition"
}
],
"filters": [
{"id": "sentry.rules.filters.latest_release.LatestReleaseFilter"}
],
"actions": [
{
"id": "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
"workspace": "SLACK_WORKSPACE_ID",
"channel": "#mobile-releases"
}
],
"frequency": 60
}
requests.post(
f"https://sentry.io/api/0/projects/YOUR_ORG/ios-app/rules/",
headers={"Authorization": "Bearer YOUR_TOKEN"},
json=rule
)
Comparing Two Releases via API
Useful for post-release analysis in automated pipelines:
import requests
def get_release_crash_free_rate(release: str) -> float:
resp = requests.get(
"https://sentry.io/api/0/organizations/YOUR_ORG/sessions/",
headers={"Authorization": "Bearer YOUR_TOKEN"},
params={
"field": ["crash_free_rate(session)"],
"groupBy": "release",
"query": f"release:{release}",
"statsPeriod": "7d",
"interval": "1d",
"project": ["PROJECT_ID"]
}
)
groups = resp.json().get("groups", [])
if groups:
return groups[0]["totals"].get("crash_free_rate(session)", 0)
return 0.0
current = get_release_crash_free_rate("[email protected]+456")
previous = get_release_crash_free_rate("[email protected]+455")
print(f"Delta: {current - previous:.2f}%")
What We Do
- Configure
enableAutoSessionTrackingwith correctreleaseNameformat - Integrate Sentry CLI in CI/CD for auto-uploading dSYM (iOS) and ProGuard mapping (Android)
- Configure git commit tracking via
set-commits - Set up alerts on Regression Event with Slack notifications
- Create post-deploy script checking Crash Free Rate for pipeline gate
Timeline
Basic Release Health setup: 4–8 hours. CI/CD integration with auto-symbol upload: 1–2 days. Pricing is calculated individually.







