Magento Cloud Response Times as measured by Fastly in New Relic

Published: December 29, 2020

Tags:

Recently I’ve been dealing with a Magento performance issue that appears to been caused by Fastly (more on that in another post). Here I wanted to share a quick tip on how to view Fastly response times for Magento Cloud in New Relic.

Somewhat recently, Magento has begun leveraging New Relic logs to aggregate log data (an excellent addition to the platform!). The logs being aggregated include Fastly logs.

While your first instinct may be to click the “Logs” link in the top menu, I’ve generally found New Relic Insights NRQL searches to be much more powerful for analyzing log data.

Here’s an example NRQL query to view average response times for the home page for the past day:

SELECT average(numeric(time_elapsed)) / 1000000 FROM Log WHERE url = '/' SINCE 1 day ago TIMESERIES 5 minutes

Here’s an example of the result

Graph of query result

A few notes:

  • We convert to numeric as Magento ships the data to New Relic as a string
  • We divide by 1 million as time_elapsed is in microseconds
  • TIMESERIES 5 minutes adds more precision to the graph…New Relic will otherwise show in 30 minute buckets

While in my case this was helpful for troubleshooting the performance issue this can also be helpful for getting a better picture of your site speed vs. New Relic APM as this data is inclusive of cached responses (which would otherwise not be included when just viewing APM data).


Max Chadwick Hi, I'm Max!

I'm a software developer who mainly works in PHP, but loves dabbling in other languages like Go and Ruby. Technical topics that interest me are monitoring, security and performance. I'm also a stickler for good documentation and clear technical writing.

During the day I lead a team of developers and solve challenging technical problems at Rightpoint where I mainly work with the Magento platform. I've also spoken at a number of events.

In my spare time I blog about tech, work on open source and participate in bug bounty programs.

If you'd like to get in contact, you can find me on Twitter and LinkedIn.