• /
  • Log in
  • Free account

RecordCustomEvent (.NET agent API)


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 the query builder. To verify if an event is being recorded correctly, look for the data in dashboards.

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 (10^6 bytes) 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.






Required. The name of the event type to record. Strings over 255 characters will result in the API call not being sent to New Relic. 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

If you need more help, check out these support and learning resources:

Create issueEdit page
Copyright © 2021 New Relic Inc.