重要
As of April 12, 2021, we are upgrading Insights to an improved web and mobile experience! All of your Insights URLs will be redirected automatically to the corresponding dashboards in New Relic One. For more details about this migration and how you can easily plan for this transition, see our Explorers Hub post.
New Relic's $util.insights
is a set of tools to set and manipulate events reported from synthetic monitoring. The $util.insights
toolset includes the word insights
because Insights was historically how New Relic saved queryable event data.
You can add custom data as custom attributes, with the prefix custom
, to the SyntheticCheck
event. These attributes are in addition to the event's default attributes.
Compatibility
This functionality is available for monitor versions 0.2.0 or later.
Functions
Function | Return value |
---|---|
Sets a key/value pair. | void |
Returns the value for the provided key. | object |
Returns an array of keys currently set. | object |
Returns | boolean |
Removes the key/value pair. | void |
Removes all custom data. | void |
Example
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('https://status.newrelic.com/history.rss', function(err, response, body) { parseString(body, function(err, result){ // Parse the RSS, and get the latest incident var latestIncident = result.rss.channel[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) WHERE monitorName = "Monitor Name Here"
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicの とandドキュメント をご確認ください。