New Relic Insights: New Attributes for Pageviews and Transactions

Since New Relic Insights exited from beta in July, we’ve been busy continuing to add new features and data based on the massive amount of feedback our users have submitted to us. In particular, we wanted to emphasize a few themes that we discovered (by using Insights!) in terms of common use cases for which users wanted out-of-the-box support:

  • Over the past 90 days, more than 101 million queries have been performed in Insights:

o   Of those, about 14 million (nearly 14 percent) were performed using some kind of attribute for “username.”
o   Nearly 5 million (approximately 5 percent) were performed using an attribute for “error” or “error codes.”
o   Finally, about 558,000 queries were performed using an attribute for “page URL.”

  • We also had several requests through our community forum that indicated a need to have access to “city” and “region” attributes on PageView data, similar to our Browser monitoring UI.


This told us that users were adding custom instrumentation for usernames, error attributes, and pageURLs—and that they wanted to have greater depth into the geographic details of their end-user traffic. So we took the initiative to add several new attributes to PageViews and Transactions, many of which will appear without any alterations to your configuration or application. You can view more details about them here.

Analyzing data

New PageView Attributes

  • city: You can now segment any PageView query by the name of the city in which it was initiated. This is awesome for figuring out where your customers are coming from. For example, you might want to know how many sessions initiated a particular transaction from New York and San Francisco:
SELECT uniqueCount(sessionID) FROM PageView WHERE city IN ('San Francisco','New York') SINCE 1 day ago
  • regionCode: Similarly, you can segment your PageView queries by regionCodes, which are two-digit numbers that correspond to a particular country. (See the complete list here: ) For example, you might want to see how many of your Australian sessions are coming from New South Wales:
SELECT uniqueCount(sessionID) FROM PageView WHERE countryCode='AU' AND regionCode='02' SINCE 1 day ago
  • pageURL: Let’s face it—it’s not always easy to query based on the name of the Transaction. Lots of users want to be able to query based on the URL of the page that they’re trying to measure. Let’s say you wanted to just measure visits to a login page on your website. You could run a query like this:
SELECT count(*) FROM PageView WHERE pageUrl='' SINCE 1 day ago

New Transaction Attributes

  • errorMessages and errorTypes for PHP Agents: If you’re running the latest version of the PHP agent, you can now see error messages and the types of errors that have occurred on your Transactions for PHP. Error types represent the class of the error, whereas the error message is the trace for the error itself. Perhaps you want to see a count of users that have experienced errors over the past seven days:
SELECT uniqueCount(user) FROM Transaction WHERE errorMessage is NOT null SINCE 7 days ago

Or maybe you want to look at which error type was most prevalent:

SELECT uniqueCount(user) FROM Transaction FACET errorType SINCE 7 days ago
  • httpResponseCode for Java and PHP Agents: Java and PHP agents are now also reporting the httpResponseCode for a given Transaction, which means that you can also segment by standard HTTP responses. For example, you might want to know how many Transactions have occurred and didn’t have a “200 OK” response:
SELECT count(*) FROM Transaction WHERE httpResponseCode != '200' SINCE 1 day ago
  • usernames for Java and .NET Agents: If you’re running the latest version of the Java or .NET agents, you can now configure the agent to report user attributes. This is an extremely valuable piece of data that we are able to automatically generate by detecting certain classes within your application. You can read more about how to set this up here:

These new attributes allow you to get even more insights from your data without having to do any additional work to collect the information. Our goal is to reduce the complexity and friction associated with getting meaningful data out of your applications. As we continue to see common attributes across New Relic Insights’ customer base, we will continue to add relevant attributes and provide even stronger out-of-the-box reporting capabilities.

Image of business workplace courtesy

Henry Shapiro is Vice President of Product, Observability Tools at New Relic. He’s spent most of his career in the data analytics and monitoring space, primarily in product and engineering roles. When he’s not working, he’s on any number of two-wheeled motorized vehicles. View posts by .

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