Can't use ErrorTrace in NRQL alerts?

I went and tried to set up a NRQL alert with this query:
SELECT count(*) FROM ErrorTrace WHERE appName = 'DAM Api' and request.uri LIKE '/dam/imageserve/%' AND message LIKE 'image file is truncated%'

It looks great. I hit “Save condition.” I get this:

We couldn’t save this condition

An unexpected error occurred: PROHIBITED_EVENT_TYPES: Invalid event type(s): [errortrace]

So…is using ErrorTrace just right out in NRQL alerts? It seems like then the UI should be throwing an error earlier then, like it does if you try and use TIMESERIES. Or is there some other issue with my query/alert? (I was able to get the same data out of TransactionError, but still.)

Hi, @jdweiner: ErrorTrace (and SqlTrace) are undocumented event types used internally by New Relic. They should not be visible to you, and we apologize for the inconvenience.

1 Like

@philweber

What is the alternative to this ?

I’m using the Java API, and I have a “NewRelic.notifyError(msg)” in my code.

Now if this was inside a transaction, I can easily do "FROM Transaction SELECT count(*) WHERE appName = ‘myAppName’ AND name = ‘myTransactionName’ " and create an NRQL alert.

But my scenario is OUTSIDE a transaction, and so, these "notifyError"s do not show up under “FROM Transaction …”. The only place I could find these error trace events (as mentioned in the javadoc) was in ErrorTrace, but NRQL alerts does not allow "FROM ErrorTrace SELECT … WHERE error.class = ‘myCustomNonTransactionError’ ". How do I make this NRQL alert work ? What alternative FROM clause can I use ?

Hi, @ppanchal: I think you will have to send your error information as a custom event.

1 Like

@philweber That sounds ok, but it still leaves me with the same question.

I record a non-transaction custom event for Java using: NewRelic.getAgent().getInsights().recordCustomEvent(“test_nr”, Map.of(“k1”, “v1”));

but how do I build the NRQL query for alerting on this?

This won’t show up under “FROM Transaction …” so how do I get this event ?

Select * from test_nr...

2 Likes