Using Data Explorer to build out NRQL queries, and understanding terminology

I’m newer to NRQL as well as application monitoring. I’ve been recently playing around with the Data Explorer and it’s great for actually building out some queries from there using actual application data. However, I’m not 100% sure that that I’m matching what I’ve been asked with that I see in Data Explorer.

This is for a Java application and here is what I have going so far for different pieces of information sought:

Error rate - Tends of error rates over time

Drill-down of what I see in Data Explorer: TransactionErrorhttpReponseCode

Sample query:

SELECT count(*) FROM TransactionError WHERE appName = ‘My-App-name’ FACET httpReponseCode SINCE 180 MINUTES AGO TIMESERIES

Average transaction duration, with the Ability to see data by endpoint

Drill-down of what I see in Data Explorer: TransactionEndpoint

Sample query:

SELECT average(duration) FROM Transaction WHERE appName = ‘My-App-name’ FACET name SINCE 60 MINUTES AGO TIMESERIES

  • Note: I don’t seem to be able to select a FACET of Endpoint here. Am I doing something wrong?

Nice to have: Able to break down by error, starting with status_code

Drill-down of what I see in Data Explorer: TransactionErrorhttpResponseCode, transactionName

Sample query:

SELECT count(*) FROM TransactionError WHERE appName = ‘My-App-name’ FACET transactionName, httpReponseCode SINCE 180 MINUTES AGO TIMESERIES

Trend of Latency by endpoint over time(specify a time range)

is this going to be avg 200 response time? (see this article with an image for latency widget):

https://docs.newrelic.com/docs/new-relic-solutions/new-relic-solutions/optimize-your-cloud-native-environment/analyze-distributed-systems/

Drill-down of what I see in Data Explorer: TransactionhttpResponseCode

Sample query:

SELECT average(duration) FROM Transaction FACET httpResponseCode WHERE appName = 'My-App-name' AND httpResponseCode = 200 SINCE 60 MINUTES AGO TIMESERIES

Request Volume - Requests rate by transaction, over time

Drill-down of what I see in Data Explorer: Transactionname

Sample query:

SELECT rate(count(*), 1 minute) FROM Transaction WHERE appName = ‘My-App-name’ FACET name

I can also add TIMESERIES here too which is nice.


So, are there suggestions and modifications anyone might suggest to correct/improve the above queries?

Also, under our account we have multiple applications, is there a way to pin down the Data Explorer to just a single application instead of all the applications under an account? It wasn’t clear how to do so, so I would edit the queries in the Data explorer and add the WHERE appName = ‘My-App-name’ part.