Search code examples
newrelic

Can I reuse same variables in multiple New Relic widgets?


I have a list of relevant IDs that I want to reuse for different queries. Is there a way to specify them and reuse them in each of the queries/widgets or do I have to copy them each time?

E.g. I'd like to avoid specifying client ids and their names in each query

SELECT * from Transaction where appName='appname' and client_id IN ('1', '2')  
facet cases(where client_id = '1' as 'Client1', where client_id = '2' as 'Client2') timeseries 1 minute SINCE 5 hours ago

Solution

  • This is not something that can be achieved using the UI to craft NRQL queries, but there is a way to do this. You can do this programmatically using NerdGraph.