Use Insights to get a list of my slowest running database queries over the past week

###Insights Question Template

  • There are many ways to achieve a goal in Insights, tell us a bit about your end goal. What insights are you hoping to gain?

I want to get a list of my slowest running database queries over the past week.

I know that I can use the Database Reports option to see this information in APM for a specific App but I was wanting to get the results for all of my apps, if possible.

Helpful Resources:

1 Like

Hi, @terry.soles: New Relic does not send individual query execution times to Insights. Unless you time them yourself and send the times as custom events, you will not be able to get this information via NRQL.

Database query performance is, however, recorded as a metric (which is what you see on the New Relic APM Databases page):

You may either add several metric charts to a dashboard, or use the REST API to download the metric data.

3 Likes

@philweber, thank you for your response. I will spend some time looking into the metric charts and see if I can get some details for this.

1 Like

Hi @philweber why can’t we create a query to access the Metrics that contains the info and displayed ing Database query performance is, however, recorded as a metric (which is what you see on the New Relic APM Databases page): ?

1 Like

I suspect querying of APM metric timeslice data wasn’t widely available at the time, as evidenced by this introductory forum post on the topic in May '20.

With that said, followed-up your query in the relevant thread.

1 Like