Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

How to add static value in a table for NRQL query involving facet



Requirement : Synthetic monitoring script was developed and scheduled to run across 5 different locations. We would like to see the load times of any page in a table and provide a comparison against the expected load time for that location. For example, lets say a website is accessed from 5 different locations, the expected load time from location1 could be 5 seconds, while from location2 could be 7 seconds, location3 could be 2 seconds, location4 could be 4 seconds, location5 could be 10 seconds.

How can we achieve this in NRQL (refer to the attachment )Capture ?

Please refer to dashboard which is currently worked upon


Hi, @VithalKumar.Akunuri1: In your script, you can create an array containing the expected load time for each location:

const expectedLoadTimes = {
  'location1': 5,
  'location2': 7,
  'location3': 2,
  'location4': 4,
  'location5': 10

Then use $env.LOCATION to get the location of the currently-running monitor, and add the expected load time as a custom attribute:

var currentLocation = $env.LOCATION;
$util.insights.set('expectedLoadTime', expectedLoadTimes[currentLocation]);


Thanks @philweber , it really helped.