OkHttp and Fragment Instrumentation Now Available in Android

Last week we released version 3.361.0 of New Relic’s Android agent with a number of exciting new improvements.  Today, I’d like to highlight two of these new features you’ll receive simply by upgrading—no custom instrumentation necessary!

First, we’ve added support for Square’s popular HttpURLConnection replacement OkHttp.  You’ll now be able to monitor your app’s network activity whether you’re using OkHttpClient or OkApacheClient with no extra API calls necessary.  Just click the “Network” tab for your mobile app and dive into HTTP requests, errors, geography, and carrier data.  You can read more about our network monitoring features here.

Network Header

We’ve also added better auto-naming support for Fragments.  Before this improvement, you may have been used to seeing something like:


Wouldn’t it be nice if your Fragments were included as well?  We thought so too!  We’ve broken out Fragments as first-class interactions and instrumented the onCreate() and onCreateView callback methods.  Thus, you’ll see them listed along with your Activities like so:

Activities and Fragments

All of this is possible without manually starting an interaction via our API.  Of course, you can always rename in-flight Fragment interactions if you so desire.  Curious about the API?  You’ll find complete documentation here.

As always, we’re eager to hear your feedback.  If you’d like your favorite third-party library instrumented, just let us know over at New Relic Support.

A longtime fan of New Relic, Jason joined the team to contribute his user insight, dark computer magic, and knowledge of vintage boomboxes. View posts by .

Interested in writing for New Relic Blog? Send us a pitch!