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

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?

@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);
3 Likes

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

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.

@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