Filtering graphs by transaction type

A feature which I find quite useful for basically all reports and graphs in NR is the ability to filter out data by transaction type, ie. separate transactions between web / command-line / all.

If I recall correctly, a toggle allowing the user to do so in an easy way was present above most of the graphs displayed by the standard interface, but it seems to be now available only in the APM “Summary” page.
I find that toggle more useful than the other one, which is still be available in many places, allowing to filter the data by server instance (as our production web-farm instances are all set up the same way, unless major issues arise, they all exhibit a similar behaviour).

I tried to achieve the same filtering by creating my own graph using the NRQL, but I could not find how to add a WHERE condition which filters out the data by transaction type.
Is that possible? And, if so, where can I find the relevant documentation?

Thanks
Gaetano

Can you share the query you have built thus far. I am able to filter Transactions based on type

SELECT * FROM Transaction WHERE transactionType = ‘Web’ AND transactionSubType = ‘Custom’

This is the current query I have - it’s not necessarily showing the data I want, just something generated by the NR gui when browsing for specific data. What I’d like to see in this case is the nr. of calls made to an external webservice and/or the total time spent

SELECT count(newrelic.timeslice.value) AS External/analyticsreporting.googleapis.com/allFROM Metric WHERE metricTimesliceName = 'External/analyticsreporting.googleapis.com/all' ANDentity.guid = '...' TIMESERIES

Hi @ggiunta1

Thanks for sharing, im not sure why this isnt showing the data that you desire. I have to loop in engineering to have a look at why.

Please note they will reach out soon via this post. If you have any updates or questions please let us know.

Hi @ggiunta1 - It sounds like you are using the data explorer which has very limited filter functionality. I would recommend using the metric explorer to find a query that might work for you and tune it with additional NRQL query syntax to get the data you are looking for in query builder.

I guess what I am looking for is a way to do the equivalent of a join between the Metric and Transaction data types. Is that possible at all?

Hi, @ggiunta1: I don’t think it is possible to correlate event and metric data.

What I’d like to see in this case is the nr. of calls made to an external webservice and/or the total time spent

This data is available in the Span event if you have distributed tracing enabled for your application:

SELECT count(*), sum(duration) 
FROM Span 
WHERE appName = 'Your Application' 
  AND category = 'http'
  AND http.url = 'http://my.service/endpoint' 
  AND span.kind = 'client'

Thanks!

Trying to think outside the box: I could maybe achieve what I want by abusing the application-name, which seems to be a “top-level filter” available everywhere in the existing NR graphs and dashboards.
It seems that the php agent is able to set it programmatically, and it would not be too hard to have it modified for all php scripts running in a cli environment.

I would of course loose the ability to see the complete metrics in an aggregated form, but in general we have different optimization targets for webpages/api-calls than we have for cli commands and cron-jobs, so that could be an acceptable tradeoff…

1 Like