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

사용자의 편의를 위해 제공되는 기계 번역입니다.

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

문제 신고

맞춤 이벤트 만들기(이동)

사용자 지정 이벤트는 특정 시점에 외부 소스의 데이터를 포함하여 관심 있는 단일 이벤트에 대한 데이터를 탐색하는 데 유용합니다. New Relic Go 에이전트가 모니터링하는 앱의 임의 이벤트 데이터 를 추적하려면 앱에 RecordCustomEvent 를 추가하세요. 그런 다음 이벤트 데이터를 쿼리하고 시각화 할 수 있습니다.

RecordCustomEvent 매개변수

Go 앱에 RecordCustomEvent 를 추가하려면 다음 형식을 사용하세요.

RecordCustomEvent(eventType string, params map[string]interface{})

매개변수

설명

eventType

필수의. 기록할 이벤트 유형의 이름입니다.

  • 영숫자, 밑줄 _ 또는 콜론 : 으로 구성되어야 합니다.
  • 255바이트를 넘지 않아야 합니다.
  • 이름, 제한 및 제한된 문자 에 대한 New Relic 데이터 요구 사항을 따라야 합니다.

params map

숫자 , 문자열 또는 부울

필수의. 이벤트에 주석을 추가할 속성의 키/값 쌍을 지정하십시오.

  • params map 의 각 값은 숫자, 문자열 또는 부울이어야 합니다.
  • 키는 255바이트 미만이어야 합니다.
  • params map 은(는) 64개 이상의 속성을 포함할 수 없습니다.

예시

다음은 Go 앱에 대한 사용자 지정 이벤트의 예입니다.

func customEvent(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "recording a custom event")
app.RecordCustomEvent("my_event_type", map[string]interface{}{
"myString": "hello",
"myFloat": 0.603,
"myInt": 123,
"myBool": true,
})
}
Copyright © 2024 New Relic Inc.

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