NRQL to find transactions with particular span

Hi,

I am trying to find all transactions for a particular appName which has span of type database (e.g. Oracle) and with insert/update statements.

Is it possible to query such data by writing NRQL on both Transaction and Span event types?
If no, is there any other solution for this?

Hi @arathi - The query below can help start you in the right direction, just replace [Your App Name] with the relevant information. The db.statement will enable you to filter down onto the database transaction types.

SELECT * FROM Span WHERE category='datastore' AND appName = '[Your App Name]'

Thanks @stefan_garnham for a quick response.

Is there a way where I can use customParameter of a transaction in above query.
e.g.:
SELECT * FROM Span WHERE category='datastore' AND appName = '[Your App Name]' AND customParam1 = 'true'

Is there a way where I can use custom parameters of a transaction in above query? OR is there is a way where there can a SQL join kind of a query in NRQL on Transaction and Span event types?

Unfortunately there is no SQL JOIN functionality in NRQL. Although you can pull attributes from the transaction by adding that to the query, you probably would want to also limit the attributes from the Span event as well.

1 Like