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, Collect custom business data, before starting this one.
With your app recording custom business data, you're now ready to get insights from your data. Particularly, you look up:
- Orders from the past 24 hours
- Most popular restaurants
- Most active customers
- Average order amount
- Customers that spend the most money
- Most popular items
In this procedure, you create a dashboard, query your custom data, gather it in charts, and add those charts to your dashboard to have quick view into these data points.
With New Relic dashboards, you observe and interpret the data you collect from your application. You gather the data you want to see into charts to customize the way you see it.
Navigate to New Relic and sign in with your account.
Under Dashboards, click Create a dashboard in the top right corner.
Select Create a new dashboard.
Name your dashboard "FoodMe", and click Create.
Once the dashboard is in place, you can start creating charts to answer your business related questions.
Hover over the dashboard, and click Add a new chart.
From this screen, you add charts using our query builder, or you choose to add text, images, or links using Markdown.
Click Add a chart.
This opens a query builder.
Switch to the NRQL editor.
Edit the query as follows.
SELECT count(*) AS 'Orders' FROM Transaction WHERE appName='food-me' AND name LIKE '%/api/order' SINCE 1 day ago
Here, you see the number of orders for the past 24 hours.
Name your chart "Orders in past 24 hours", and click save.
The chart is now visible on your dashboard.
You can add more charts to your dashboard following the same pattern. To do so, click + in upper right-hand corner.
This takes you to the same Add to your dashboard page.
Add another chart to your dashboard.
Run the following query to view the most popular restaurants for your FoodMe app.
SELECT count(*) FROM Transaction WHERE appName='food-me' AND name LIKE '%/api/order' AND restaurant IS NOT NULL FACET restaurant SINCE 1 day ago
This chart shows you the most popular restaurants. Change the chart type to Pie, name it "Most popular restaurants", and click save to add it to your dashboard.
For a chart showing the most active customers, use the following query.
SELECT count(*) FROM Transaction WHERE appName='food-me' AND name LIKE '%/api/order' AND customer IS NOT NULL FACET customer SINCE 1 day ago
Here, you observe your most active customers.
Use the following query to calculate the average order amount.
SELECT average(orderTotal) FROM Transaction WHERE appName='food-me' AND name LIKE '%/api/order'
Here, you see observe the average order amount.
Execute the following query to view which customers spend the most money ordering food from your app.
SELECT sum(orderTotal) FROM Transaction WHERE appName='food-me' AND name='WebTransaction/Expressjs/POST//api/order' FACET customer
Here, you observe the most money spending customers.
Use the following query to view the most popular items.
SELECT sum(qty) FROM PageAction WHERE actionName='orderItem' FACET item
Here, you observe the most popular items for your app.
Your final dashboard looks something like this:
You now know how well your business is performing. You can filter your dashboard by restaurant, and get a closer look.
Click ... in front of your "Most popular restaurants" chart, and select Edit.
Toggle Filter the current dashboard to enable the filter and save.
Now, you see the option to filter dashboard by most popular restaurant.
The dashboard now shows you business data related to that restaurant.
In this procedure, you created a dashboard and added multiple charts to it to get business insights.
This procedure is part of a lab that teaches you how to monitor your application with New Relic. Continue on to next procedure, Add alerts.