NewRelic.Api.Agent.NewRelic.RecordCustomEvent(string eventType, IEnumerable<string, object> attributeValues)
Records a custom event with the given name and attributes.


Agent version or higher.

Compatible with all app types.


Records a custom event with the given name and attributes, which you can query in New Relic Insights. To verify if an event is being recorded correctly, look for the data in the Insights event data explorer.

For related API calls, see the .NET agent API guide.

  • Sending a lot of events can increase the memory overhead of the agent.
  • Additionally, posts greater than 1MB in size will not be recorded regardless of the maximum number of events.
  • Custom Events are limited to 64-attributes.
  • For more information about how custom attribute values are processed, see the custom attributes guide.


Parameter Description



Required. The name of the event type to record. Strings over 255 characters will result in the API call not being sent to Insights. The name can only contain alphanumeric characters, underscores _, and colons :. For additional restrictions on event type names, see Reserved words.


IEnumerable<string, object>

Required. Specify key/value pairs of attributes to annotate the event.


Record values

var eventAttributes = new Dictionary<string, object>() 
    {"foo", "bar"},
    {"alice", "bob"}, 
    {"age", 32}, 

NewRelic.Api.Agent.NewRelic.RecordCustomEvent("MyCustomEvent", eventAttributes);

For more help

Recommendations for learning more: