I usually see some people ask why the HTTP requests are not reporting or that some of the HTTP requests are missing. In this post, I’ll go through some basic troubleshooting steps and hope it can help most of the cases.
The first thing I would check is which Network library is used to make the HTTP requests. And then confirm if the library is supported by the New Relic Mobile SDK by default. The compatibility can be found in the below docs:
If a supported Network library is used, but the HTTP requests are still not reporting, I would check:
Which version of the New Relic Mobile agent is used? There’re always new versions of the library coming out and thus the new instrumentation may need to be added to the new version of the New Relic agent. It’s always a good idea to keep the New Relic agent updated to experience the new features and improvements. Check out our release notes for the details:
For Android, if you are using Proguard, there’s an extra configuration required which is to keep the Network library in the Proguard config file. Without this, the New Relic Android agent cannot see this library and thus cannot instrument the requests made by this library. The details of the configuration can be found in the following doc: Configure ProGuard or DexGuard for Android apps | New Relic Documentation
Make sure the New Relic Mobile agent is initialized before the Network library.
For iOS, the New Relic iOS agent requires to be initialized before the Network library to be able to instrument the library. We recommend initializing the agent at the top of “didFinishLaunchingWithOptions” which is usually before other libraries are initialized. But if you are using any service managers that may initialize the Network libraries before New Relic, you’ll need to adjust this and make sure New Relic is initialized before them.
For Android, the agent needs to be initialized in the
onCreatemethod in the Default Activity.
Install Android apps with Gradle and Android Studio | New Relic Documentation
If an unsupported library is used, you can use our Mobile APIs to record custom HTTP requests manually. Below docs are described more details about how to implement this.
If you are using WebView, the requests should be reported for iOS but not for Android. Check out the below post for instrumenting WebView in Android.