Identify transactions with error traces

Hello

I have a dashboard that shows the percent between the total attended transactions and the transactions that have atleast an error within the relationed span traces in the transaction sent by the infinite tracing module

In the begin, I was using the property newrelic.sampling.strategy with error value a that worked excelent

but now I see that my traces does not have this attribute anymore

That broke my dashboard

So, I need a way to handle this, getting the number of transactions with at least one error, If I count the total span traces with errors this number does not works because one transaction could have more than one error trace span.

This is my query

SELECT 100 - ( 100 * filter(count(), where eventType() = ‘Span’ AND newrelic.sampling.strategy = ‘error’) / filter(count(), where eventType() = ‘Transaction’ )) as ‘%’ FROM Transaction, Span SINCE 1 day ago

Thanks

How about:

SELECT filter(count(*), WHERE error IS true) / count(*) FROM Transaction

Hi @philweber, Thanks by your answer
The problem with this approach is that the transactions source does not have the error atributte in all the cases, this error exists in the distributted tracing source as an span

And I have to correlate the both sources, this needs to filter by application or client attribute in the transactions and spans.

The attributes was added by a custom implementation within the transactions.

This is the real query:

SELECT 100 - ( 100 * filter(count(), where eventType() = ‘Span’ and customer.name = ‘NameOfClient’ AND newrelic.sampling.strategy = ‘error’) / filter(count(), where eventType() = ‘Transaction’ and customer.name = ‘NameOfClient’)) as ‘%’ FROM Transaction, Span SINCE 1 day ago

1 Like

Hey there @santiago11 - It looks like you figured it out. Thanks so much for sharing what worked for you so that others can learn from you! :smile:

Hi @hross, I have the problem yet, I posted the original query that now does not works, because newrelic.sampling.strategy property doesnot exists now.

Do you know why this propperty was deleted?

Thanks

Gotcha - I misunderstood you completely. So sorry!

@philweber - with the original query here for reference - any ideas?

Searching the Span docs for attributes containing “error”, I find four of them:

@santiago11: Can you use one of the above attributes in your query instead of newrelic.sampling.strategy?

yes I use by now error attribute, but when I count the true error spans this number is incorrect because One transaction could have more than one error span, Mi interest is count the number of transactions with error

I cant use error.class and error.message because is the same case than error attribute

I cant use error.StatusCode because the statusCode is always 200 in a legacy application

I tried to use uniqueCount(transactionId) instead count(*) but this approach is only an aproximation number as the documentation says uniqueCount is not exact from 255 registers and the result is only an aproximation

OK. Unfortunately I do not have any other suggestions.

Thanks @philweber,
Do you know why the previous attribute was deleted?

Thanks so much by your help

Greetings

No, I don’t know why.