Add custom attributes to synthetic monitoring data

New Relic's $util.insights is a set of tools to set and manipulate events reported from synthetic monitoring. Custom data is added as custom attributes, with prefix custom, to the SyntheticCheck event. These attributes are in addition to that event's default attributes.

$util.insights includes the word Insights because Insights was historically how New Relic saved queryable event data.


This functionality is available for monitor versions 0.2.0 or later.


Function Return value

$util.insights.set(key: string, value: ?)

Sets a key/value pair.


$util.insights.get(key: string)

Returns the value for the provided key.



Returns an array of keys currently set.


$util.insights.has(key: string)

Returns true if the key exists in the data.


$util.insights.unset(key: string)

Removes the key/value pair.



Removes all custom data.



The example obtains the latest incident from New Relic's RSS status feed and saves the details for this event.

var parseString = require('xml2js').parseString;
// Get the New Relic status RSS feed
$http.get('', function(err, response, body) {
  parseString(body, function(err, result){
    // Parse the RSS, and get the latest incident
    var latestIncident =[0].item[0];
    // Push the incident details to New Relic 
    $util.insights.set('Incident', latestIncident.title[0]);
    $util.insights.set('Description', latestIncident.description[0]);
    $util.insights.set('Date', latestIncident.pubDate[0]);

To view the incident data sent to New Relic in this example, use this query:

FROM SyntheticCheck SELECT latest(custom.Date), latest(custom.Incident), latest(custom.Description)

For more help

If you need more help, check out these support and learning resources: