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

Feature Idea: Synthetics GitHub Version Control




I’ve been looking around on the forum to see if anyone had previously posted about synthetic script version control. In particularly a connection to GitHub or possibly even some in-house version control functionality.

Features could include:

  • Ability to select previous versions of a script.
  • See the author of a specific script.
  • View who last edited/updated the script.
  • Visibly see the changes they have made. (Highlighted code + initials?)
  • Space for posting a reason for any changes made.
  • Space for comments or notes.

This level of functionality would be a great addition to the synthetic script creation process as some scripts can become longer and more complex over time.

I found this topic posted back in 2014:

I was just wondering if anything has been implemented since then?


New Relic edit

  • I want this, too
  • I have more info to share (reply below)
  • I have a solution for this

0 voters

We take feature ideas seriously and our product managers review every one when plotting their roadmaps. However, there is no guarantee this feature will be implemented. This post ensures the idea is put on the table and discussed though. So please vote and share your extra details with our team.

Synthetic API Test source control
Import & access custom javascript(.js) file in synthetics API test script
Are the monitor scripts under New Relic source control?

Hey there, @rhalliwell!

Thank you for your detailed request. I have added a poll so others in the community can vote on this as well! :blush:



This hasn’t been tested, however it was suggested that the VM module is used to allow functions to be called from an external synthetic script for example a gist.

You can use NodeJS vm module

const vm = require(‘vm’);
const runner = { };
var req = require(‘urllib-sync’).request;
var res = req(‘’);
const code =;
vm.runInContext(code, runner);



This would mean that the VM module would need enabling on the next Scripted monitor version runtime environment being released. This would be a huge help and allow for a easy to implement version control work around.


Hey @rhalliwell - Thanks so much for posting this potential solution here. This looks great!! I’ll go ahead and add a feature request internally to open up the VM module in a future release. :smiley:


tried running above script, vm module not loaded exception is coming in synthetic api test script.
what should i do to run the above script?


Hi Kinzal,

Currently the VM module isn’t enabled on New Relic synthetics, I’ve requested for it to be enabled and we will have to wait and see…

Until then try:

var req = require(‘urllib-sync’).request;
var res = req(‘insert script url here EG raw gist url’);
var monitorBody = new Function(’$browser’,;


The above code runs your script from a remote location allowing you to have your own version control running in the back-end.

Hopefully this helps you in the mean time.




I am able to access the file but the data is in buffer format so not able to access the exact data of js file.
var req = require(‘urllib-sync’).request;
var apiUrl = “test/api/url/”;
var res = req(‘’);

//prints data in buffer format

//it prints entire js file in string form

How will I acess the functions of js file now & execute it?


Hi Kinzal,

The VM Module will allow you to access functions from within the external script. However it currently isn’t enabled meaning that the you cant currently access the functions. We will have to wait and see if it gets added. Sounds like its in the pipeline though.



@rhalliwell, @kinzal.ostwal - The VM module is definitely a feature request we have filed here internally :smiley: - I don’t know if that’s on the roadmap yet, and we certainly don’t have a timeline on that yet. our Synthetics team are currently focussed on getting a number of features ready for GA, and we’ll likely see some of the other, smaller features come after that.