lab
This procedure is part of a lab that teaches you how to monitor your application with New Relic.
Each procedure in the lab builds upon the last, so make sure you've completed the last procedure, instrument your application with our browser agent, before starting this one.
With your app reporting data to New Relic, you want to understand the collected data and get insights into your app. For example, you want to know how many users are active on your site. For that, you explore your data using NRQL, New Relic's query language; gather it; and visualize it in interactive charts.
In this procedure, you explore your data in New Relic. Specifically, you:
- View your page views
- Count active sessions
- View your transactions
- Count total transactions
- View your slowest transactions
- Count your transactions with different response codes
Query your data
Use NRQL to explore and retrieve detailed New Relic data and get insights into your application.
Tip
NRQL is New Relic's SQL-like query language. Read our documentation to know more about what it is and when to use it.
View your pageviews
Navigate to New Relic and sign in with your account. On the top navigation bar, click Query your data.
This opens an interactive Query builder to explore your data.
Click NRQL to use a custom query.
Execute the following query to view PageView
records for your app.
SELECT * FROM PageView WHERE appName='food-me'
Click Run to see results.
Here, you observe all the pageviews for your app.
Count active sessions
Use the following query to count your active sessions.
FROM PageView SELECT count(session) WHERE appName='food-me'
Here, you see the number of active sessions.
View your transactions
Use the following query to view all your transactions.
SELECT * FROM Transaction WHERE appName='food-me'
Here, you see all your transactions for food-me app.
Count total transactions
Use the following query to count your total transactions.
SELECT count(*) FROM Transaction WHERE appName='food-me'
Here, you see the total number of transactions for your food-me app.
View slowest transactions
Execute the following query to view your slowest transactions.
SELECT max(duration) FROM Transaction Where appName='food-me' FACET name
Here, you see your slowest transactions.
The chart is hard to see in this format. You can choose to present your results in different formats such as table, billboard, or pie chart.
Change the chart type to Pie.
Now, you see your slowest transaction in the form of a pie chart.
Count your transactions with different response codes
Use the following query to view all your transactions with different response codes.
SELECT count(*) FROM Transaction WHERE http.statusCode!='200' FACET http.statusCode
You've now seen your application's performance data. Next, you collect custom business data from your application.
lab
This procedure is part of a lab that teaches you how to monitor your application with New Relic. Now that you've explored your application's performance related data, collect custom business data from your application.