We integrate New Relic APM into mobile apps on iOS and Android. This system shows not just crashes but also UI slowness, slow network requests, and conversion drops. You get a single trace from button tap to SQL query — without additional correlation. The newrelic header (W3C TraceContext) is propagated automatically. In New Relic One, you can open an HTTP request from the app and drill into the server trace. We've completed 30+ integrations for projects with an audience from 50,000 DAU. We guarantee monitoring stability and correct sampling.
Why Distributed Tracing Is Mandatory for Mobile Monitoring
Without Distributed Tracing, you only see the client side. If a request fails with a 500 error on the backend, you won't know the reason. With tracing enabled, each HTTP call gets a unique identifier. The mobile agent adds traceparent and tracestate headers. The server-side New Relic agent picks them up and forms a single trace. You see timing for each segment: network call, SQL, cache. New Relic documentation recommends enabling Distributed Tracing for all applications with microservice architecture.
How to Install the New Relic Agent on iOS and Android
iOS via Swift Package Manager:
// Package.swift .package(url: "https://github.com/newrelic/newrelic-ios-agent-spm", from: "7.4.0") // AppDelegate.application(_:didFinishLaunchingWithOptions:) import NewRelic NewRelic.start(withApplicationToken: "AA-XXXXXXXX-XXXX") Android via Gradle:
// build.gradle (project level) classpath("com.newrelic.agent.android:agent-gradle-plugin:7.+") // build.gradle (app level) apply plugin: 'newrelic' implementation("com.newrelic.agent.android:android-agent:7.+") // Application.onCreate() NewRelic.withApplicationToken("AA-XXXXXXXX-XXXX") .withLoggingEnabled(false) .start(applicationContext) After installation, the agent automatically instruments HTTP calls: iOS intercepts URLSession through swizzling, Android through bytecode instrumentation of OkHttp and HttpURLConnection. If you use custom networking layers (NWConnection, custom URLProtocol), verify that tracking works explicitly.
How to Verify Auto-Instrumentation
Immediately after launch, open the Distributed traces tab in New Relic One. If requests appear with correct durations and statuses, the integration is set correctly. Otherwise, check that the agent is initialized before the first network request.
What Is Distributed Tracing and How to Enable It
Distributed Tracing is enabled by default only for Infinite Tracing. For standard sampling, add:
NewRelic.enableFeatures([.NRFeatureFlag_DistributedTracing]) On Android, no similar flag is required — tracing works after activation in New Relic settings. The TraceContext header is automatically propagated to backend requests, where the New Relic APM agent picks it up and forms a single trace.
How Custom Events Improve Business Metrics
Custom events allow tracking of business funnels. For example, record a CheckoutCompleted event with attributes order_id, total, payment_method.
// iOS NewRelic.recordCustomEvent("CheckoutCompleted", attributes: ["order_id": orderId, "total": total, "payment_method": method]) // Android NewRelic.recordCustomEvent("CheckoutCompleted", mapOf("order_id" to orderId, "total" to total)) These events flow into NRQL — a powerful SQL-like language. We build dashboards with time series, FACET by payment methods, and calculate funnel conversion.
Error and Crash Tracking
Crashes are collected automatically. Handled exceptions are recorded explicitly:
// iOS do { try performPayment() } catch { NewRelic.recordError(error, attributes: ["context": "checkout"]) } // Android NewRelic.recordError(exception, mapOf("context" to "checkout")) Crash reports include Thread State of all threads, ANR events, and Breadcrumb Trail — a sequence of actions leading to the crash.
Why New Relic Is Better Than Firebase Crashlytics for Business Metrics
| Criteria | New Relic APM | Firebase Crashlytics |
|---|---|---|
| Monitoring type | Performance + errors | Errors only |
| Distributed Tracing | Yes, down to SQL query | No |
| Custom business events | Yes, with NRQL | Error logs only |
| Alerts on conversion | Yes, based on NRQL | No |
| Single account with backend | Yes | No |
New Relic allows you to set an alert on crash-free rate dropping below 99.5% or correlate network error rate with a business metric. Firebase doesn't offer that.
How We Configure NRQL Alerts
Typical alerts we set up:
| Metric | Condition | Notification Channel |
|---|---|---|
| Crash-free rate | < 99.5% | Slack |
| Average HTTP request duration | > 2 s | PagerDuty |
| Checkout conversion | drop > 10% in 1 hour |
Example agent configuration for Android
NewRelic.withApplicationToken("AA-XXXXXXXX-XXXX") .withLoggingEnabled(true) .withCrashReporting(true) .withHttpResponseBodyCaptureEnabled(true) .start(applicationContext) How We Implement New Relic
- Analyze the current application — identify key scenarios, network requests, business events.
- Install the agent on iOS and Android, verify HTTP auto-instrumentation.
- Configure Distributed Tracing with the backend agent, verify traces.
- Create custom events for the business funnel — registration, view, purchase.
- Configure NRQL alerts with notifications to Slack/PagerDuty.
- Deliver documentation — dashboards, alerts, instructions for further improvements.
What's Included in the Work
- Agent installation iOS/Android (including React Native via
@newrelic/react-native-agent) - Verification of HTTP auto-instrumentation
- Distributed Tracing setup
- Custom events for business funnel
- NRQL alerts
- Documentation for dashboards and alerts
- Team training on New Relic One
- 2 weeks post-release support
Timeline
Basic integration with auto-instrumentation: 1–2 days. Custom events and dashboards: +1 day. Cost is determined individually for your project.
Get a consultation on New Relic integration for your mobile app — contact us to discuss details. Order monitoring setup today.







