• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

이 한글 문서는 사용자의 편의를 위해 기계 번역되었습니다.

영문본과 번역본이 일치하지 않는 경우 영문본이 우선합니다. 보다 자세한 내용은 이 페이지를 방문하시기 바랍니다.

문제 신고

합성 모니터링 데이터에 사용자 정의 속성 추가

New Relic의 $util.insights 은 종합 모니터링에서 보고된 이벤트 를 설정하고 조작하는 도구 세트입니다.

접두사 custom 를 사용하여 맞춤 데이터를 맞춤 속성으로 SyntheticCheck 이벤트 에 추가할 수 있습니다. 이러한 속성은 이벤트의 기본 속성 에 추가됩니다.

호환성

이 기능은 모니터 버전 0.2.0 이상 에서 사용할 수 있습니다.

기능

함수

반환 값

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

키/값 쌍을 설정합니다.

무효의

$util.insights.get(key: string)

제공된 키의 값을 반환합니다.

물체

$util.insights.getKeys()

현재 설정된 키 배열을 반환합니다.

물체

$util.insights.has(key: string)

데이터에 키가 있는 경우 true 을 반환합니다.

부울

$util.insights.unset(key: string)

키/값 쌍을 제거합니다.

무효의

$util.insights.unsetAll()

모든 사용자 지정 데이터를 제거합니다.

무효의

예시

이 예에서는 New Relic의 RSS 상태 피드에서 최신 사건을 가져와 이 이벤트에 대한 세부 정보를 저장합니다.

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]);
});
});

이 예에서 New Relic으로 전송된 인시던트 데이터를 보려면 다음 쿼리를 사용합니다.

FROM SyntheticCheck SELECT latest(custom.Date), latest(custom.Incident), latest(custom.Description) WHERE monitorName = "Monitor Name Here"
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.