Last week we added support for Traced Errors and Custom Attributes to the Agent SDK 0.4 beta, which you can download here.
Traced Errors are errors that agents identify during a transaction and send to the New Relic service for viewing. You can view information about your application’s exceptions and receive alerts if error rates exceed a certain threshold.
The image above shows a monitored application with an error rate that has exceed 1.0% for extended time period.
In addition to error rates and alerts, you gain insight into when and where an error occurred by viewing the Traced Error page that displays the request url, custom attributes, stack trace information, and more.
To track exceptions, the Agent SDK provides an API function called newrelic_transaction_notice_error to report errors. You pass it an exception type, error message, and a stack trace.
Custom Attributes are key-value pairs that are associated with a slow or failing transaction. They show up in Traced Errors as well as Transaction Traces and help create a better picture of what happened during a transaction. For instance, you might want to view form inputs to understand why a form validation error occurred.
To get custom attributes to show up, you call an API function called newrelic_transaction_add_attribute. Just specify the key name and value and look for it in a section called “Custom Attributes” in your Traced Errors or Transaction Traces.
There you have it! The Agent SDK supports yet another New Relic feature and continues to improve the current set of supported features. More to come soon!