newrelicnrql

New Relic - NRQL query to group error.class with a count not working


I am trying to run the following NRQL query:

FROM TransactionError SELECT count(*) AS 'ErrorCount', error.class, error.message SINCE 24 hours ago FACET error.class

But I am getting the following error :

Unknown expression error.class (at line 0 column 0)

Why can I not group this way ? I know for a fact that error.class does exist, but seems it doesnt when trying to use FACET ?

Anyone able to help ?

Thanks!


Solution

  • Isnt that typical, directly after I posted this, I found something that helped me see what needs to be done. Leaving it here for anyone else that may want to know:

    FROM TransactionError SELECT count(*) AS 'ErrorCount' SINCE 24 hours ago FACET error.class, error.message

    It seems only the count(*) needs to be in the Select, but if you add the required fields you want to group by, you add this to the FACET.

    Hope this helps anyone else!