Custom events are useful to explore data for a single event you are interested in, including data from external sources, at a particular moment in time. To track arbitrary event data for apps monitored by your New Relic Go agent, add RecordCustomEvent
to the apps. You can then query and visualize the event data.
RecordCustomEvent
parameters
To add RecordCustomEvent
to your Go app, use this format:
RecordCustomEvent(eventType string, params map[string]interface{})
Parameter | Description |
---|---|
string | Required. The name of the event type to record.
|
number, string, or boolean | Required. Specify key/value pairs of attributes to annotate the event.
|
Example
Here is an example of a custom event for a Go app:
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,
})
}
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicの とandドキュメント をご確認ください。