Insights, instantly! The power of the New Relic Agents

One of the most exciting things about how New Relic Insights works is that the New Relic language agents that you already use for monitoring your application performance automatically insert data into Insights. This makes it possible to get powerful visibility into your application performance without any additional work.

Out of the box, you can slice your data on a variety of metrics, which are automatically captured. For example, would you like to see how page load performance differs per country and browser? With a query like:

SELECT average(duration) FROM PageView FACET countryCode SINCE 1 day AGO


I can immediately see how our performance differs geographically. I can rapidly update my query to dig further into any problems I see. For example, I want to learn more about why Argentina is slow. Is it because of a certain browser?

SELECT average(duration), count(*) FROM PageView WHERE countryCode = 'AR' FACET userAgentName SINCE 1 day AGO


Nope, it turns out that most of my traffic in Argentina is using Chrome, which matches the profile of my site. I wonder if it’s because of network performance. Let’s find out by checking the backend performance:

SELECT average(backendDuration) FROM PageView FACET countryCode SINCE 1 day AGO


No again! It turns out that it’s actually taking more time on the server for these customers. Why is that?

Here’s where it gets really interesting! You can easily extend the attributes that are captured by your agent with one line of code. Maybe the reason it’s slow is because my customers from Argentina somehow differ from my other customers.

By adding one line of code to my application, I’m able to collect another attribute that I can use in my queries. Here’s an example in Python:

newrelic.agent.add_custom_parameter("userSize", user.size)

This example assumes I have a user attribute in my application that tells me the size of that user. Maybe it’s how much they pay or how big their data is. By flagging this as an important custom parameter, I can now query my transactions and use this new attribute just like the built-in ones!

APIs similar to this Python example are available for PHP, Ruby, .NET, and Java. By using these APIs to add additional context to your transactions, you can gain powerful visibility into not only application performance, but also business performance.

Consider how powerful it is to be able to answer questions like:

  • What is the performance of my application for my largest customers?
  • How many times each day does the average user log in?
  • Is my marketing effort in France leading to more signups from that country?
  • Which customers paying more than $10,000 each year have failed to successfully login over the past hour?

This can be done with our current New Relic language agents and with a simple, one-line API call in your application to provide the metrics you most care about.

To learn more about New Relic Insights, visit:'

Nathan Taggart is a Product Manager for New Relic. He oversees New Relic Browser, a client-side application performance monitoring tool. He's given talks on front-end application performance at Fluent and Front-end Ops Conf. View posts by .

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