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

Is it possible to know at what location my monitor script is running?

synthetics-script
developer

#1

Hi folks.
We are running a monitor script same page @ three locations, but in one location (Europe) we need set special attention as there is a random failure due a pop up message.

Is it possible to know what location my script is running?


#2

@leozu - It sure is! Check out the $env property available in Synthetics. I think what you’ll be looking for can be found there.

https://docs.newrelic.com/docs/synthetics/new-relic-synthetics/scripting-monitors/scripted-monitor-runtime-environment#env-property-ref

Specifically:

console.log('running in ' + $env.LOCATION);

Prevent Synthetics Running Concurrently
#3

@RyanVeitch That page no longer contains docs on the $env property. Have they moved somewhere?


#4

Hey @timothy.kye - you can still use the $env property as described above.

We have pinged the documentation team to see what happened with the docs details for that.


#5

@timothy.kye - We have got the docs updated again, the $env property is back there.

https://docs.newrelic.com/docs/synthetics/new-relic-synthetics/using-monitors/manage-monitor-runtimes#env