| name | mobile-app-monitoring |
|---|---|
| description | Add production application performance monitoring (APM) to a React Native/Expo or Flutter app. Covers Sentry Performance, Datadog RUM, and Instabug for error tracking, performance tracing, session replay, and release health. Includes OpenTelemetry spans, cold/warm start metrics, Apdex scoring, alerting, dashboards, and user impact analysis. Use when the user needs to monitor production errors, track app performance, measure launch times, or set up alerting. |
| standards-version | 1.6.3 |
Use this skill when the user:
- Wants production error tracking and crash reporting beyond basic Crashlytics
- Asks about APM, performance monitoring, or production observability
- Needs to track app launch times, screen load durations, or API latency
- Mentions "Sentry Performance", "Datadog", "Instabug", "APM", "Apdex", "session replay", or "release health"
- Wants dashboards, alerts, or user impact analysis for production issues
- Is preparing for a production launch and needs monitoring infrastructure
- Framework: Expo (React Native) or Flutter
- APM provider: Sentry Performance (recommended), Datadog RUM, or Instabug
- Metrics: what to track (errors, performance, sessions, user actions)
- Alert thresholds: error rate %, response time p95, crash-free session rate
-
Choose an APM provider:
Provider Strengths Pricing Best for Sentry Performance Error grouping, breadcrumbs, source maps, release health Free tier available Most mobile apps Datadog RUM Full-stack observability, session replay, log correlation Per session Enterprise, full-stack teams Instabug Bug reporting, surveys, in-app feedback, session replay Per app User-facing feedback + monitoring -
Set up Sentry (recommended for Expo):
npx expo install @sentry/react-native
Use
mobile_setupMonitoringto generate the monitoring module, then wrap your app:// app/_layout.tsx import * as Sentry from "@sentry/react-native"; import { monitoring } from "../lib/monitoring"; export default Sentry.wrap(function RootLayout() { return <Stack />; });
Add the Sentry Expo plugin to
app.config:export default { plugins: [ [ "@sentry/react-native/expo", { organization: "your-org", project: "your-project", }, ], ], };
-
Set up Sentry for Flutter:
dependencies: sentry_flutter: ^7.0.0
Future<void> main() async { await SentryFlutter.init( (options) { options.dsn = const String.fromEnvironment('SENTRY_DSN'); options.tracesSampleRate = 0.2; }, appRunner: () => runApp(const MyApp()), ); }
-
Add performance tracing. Measure what matters:
import * as Sentry from "@sentry/react-native"; async function loadDashboard() { const span = Sentry.startInactiveSpan({ name: "dashboard.load", op: "ui.load", }); try { const data = await fetchDashboardData(); renderDashboard(data); span?.setStatus({ code: 1, message: "ok" }); } catch (error) { span?.setStatus({ code: 2, message: "error" }); Sentry.captureException(error); } finally { span?.end(); } }
-
Track app launch performance:
import * as Sentry from "@sentry/react-native"; const appStartSpan = Sentry.startInactiveSpan({ name: "app.start", op: "app.start.cold", }); export default function App() { useEffect(() => { appStartSpan?.end(); }, []); return <RootNavigator />; }
-
Set up alerting. Configure alerts for critical thresholds:
- Crash-free session rate < 99.5% - immediate alert
- Error rate > 1% - warning alert
- API p95 latency > 3s - warning alert
- New error type in release - notification
Configure in Sentry Dashboard > Alerts > Create Alert Rule.
-
Release health tracking. Tag every error with the release version:
Sentry.init({ dsn: "...", release: `com.example.app@${appVersion}`, dist: buildNumber, });
This enables:
- Per-release error rate comparison
- Regression detection (new errors in latest release)
- Adoption tracking (how many users are on each version)
-
Session replay (Datadog/Instabug). Record user sessions for debugging:
// Datadog session replay import { DdRum } from "@datadog/mobile-react-native"; // Sessions are recorded automatically when RUM is configured // Mask sensitive views: DdRum.addAttribute("view.name", "PaymentScreen");
Session replay captures user interactions, network requests, and errors in context. Useful for reproducing bugs reported by users.
User: "I'm launching next week. I need to know immediately if something breaks in production."
Agent:
- Runs
mobile_setupMonitoringwith provider=sentry to generate the monitoring module - Installs
@sentry/react-nativeviamobile_installDependency - Wraps the root layout with
Sentry.wrap() - Adds the Sentry Expo config plugin for source map uploads
- Creates custom spans for key user flows (login, checkout, feed load)
- Configures alert rules: crash-free rate <99.5%, new error in release, p95 >3s
- Tags the release with version and build number for regression tracking
- Reminds the user to set
EXPO_PUBLIC_SENTRY_DSNin the EAS Secrets dashboard
| Step | MCP Tool | Description |
|---|---|---|
| Set up APM | mobile_setupMonitoring |
Generate monitoring module with tracing and error capture |
| Install packages | mobile_installDependency |
Install @sentry/react-native or sentry_flutter |
| Check build | mobile_checkBuildHealth |
Verify Sentry plugin is wired correctly |
| Security audit | mobile_securityAudit |
Ensure DSN is in env vars, not hardcoded |
- 100% trace sampling in production - Sampling all transactions is expensive and can hit Sentry/Datadog quotas fast. Use 10-20% sample rate in production, 100% in dev.
- No source maps - Without source maps, stack traces show minified/bundled code. Configure the Sentry build plugin to upload source maps on every EAS Build.
- Missing release tagging - Without
releaseanddist, errors cannot be grouped by version. Always set these from your app version and build number. - Alert fatigue - Too many alerts cause the team to ignore them. Start with 2-3 critical alerts (crash rate, new errors) and expand gradually.
- Not tracking custom spans - Default instrumentation covers crashes but not business logic. Add spans for key flows: login, checkout, search, image upload.
- PII in error reports - Sentry captures breadcrumbs and context that may include user data. Configure
beforeSendto scrub PII (emails, phone numbers, addresses).
- Mobile Analytics - event tracking and crash reporting basics
- Mobile Debugging - development-time debugging tools
- Mobile CI/CD - automate source map uploads in the build pipeline
- Mobile OTA Updates - ship fixes quickly when monitoring detects regressions