---
title: Manage errors in APM: Collect, ignore, or mark as expected
source: https://docs.newrelic.com/docs/apm/agents/manage-apm-agents/agent-data/manage-errors-apm-collect-ignore-or-mark-expected
---

APM agents automatically report error data for [supported frameworks](https://docs.newrelic.com/docs/agents/manage-apm-agents/installation/compatibility-requirements). To optimize error reporting and alerting, you can further manage errors in order to:

-   Catch errors that we don't instrument by default.
-   Ignore errors that you don't want reported at all.
-   Filter out noise from expected errors so you can focus on the errors that are affecting performance. (Java, Ruby, Node, Python, and .NET agents only)

> #### 💡 TIP
>
> Check out our three-part [error tracking tutorial](https://docs.newrelic.com/docs/tutorial-error-tracking/respond-outages). The tutorial uses an example scenario for an app outage in order to walk you through responding and solving critical errors.

## Collect errors not instrumented by default [#error-collection]

APM agents include API calls to report (or "notice") errors. These are useful when APM doesn't instrument your framework automatically or when there are particular errors that aren't caught for your supported framework.

To learn how to get an APM agent to report an error, see the agent-specific API documentation:

-   **Go**: [`NoticeError()`](https://github.com/newrelic/go-agent/blob/master/v3/newrelic/transaction.go)
-   **Java**: [`NoticeError()`](http://newrelic.github.io/java-agent-api/javadoc/index.html?com/newrelic/api/agent/NewRelic.html)
-   **.NET**: [`NoticeError()`](https://docs.newrelic.com/docs/apm/agents/net-agent/net-agent-api/net-agent-api/#NoticeError)
-   **Node.js**: [`noticeError()`](https://newrelic.github.io/node-newrelic/API.html#noticeError)
-   **PHP**: [`newrelic_notice_error()`](https://docs.newrelic.com/docs/agents/php-agent/php-agent-api/newrelic_notice_error)
-   **Python**: [`notice_error()`](https://docs.newrelic.com/docs/agents/python-agent/python-agent-api/noticeerror-python-agent-api/)
-   **Ruby**: [`notice_error()`](https://www.rubydoc.info/gems/newrelic_rpm/NewRelic/Agent#notice_error-instance_method)

## Ignore errors [#ignore]

Sometimes the APM agent instruments an error that you don't want reported, such as errors that contain sensitive information like user login errors. If you don't want an error to report to our [collector](https://docs.newrelic.com/docs/accounts-partnerships/education/getting-started-new-relic/glossary#collector), you can ignore the error, and the APM agent discards the error entirely.

> #### 💡 TIP
>
> For Java, .NET, Ruby, Node.js, Go, and Python: If you want to report errors to APM but don't want those errors to affect your Apdex or error rate, [mark them as expected](#expected) instead.

There are two ways to ignore errors: through the agent configuration or through server-side configuration in the UI:

**Ignore errors using server-side configuration in the UI**

This option depends on whether the agent supports [server-side configuration](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/server-side-agent-configuration).

1.  If it is not already enabled, [enable server-side configuration](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/server-side-agent-configuration#enable-ssc).
2.  [Go to the **Server-side configuration** menu](https://docs.newrelic.com/docs/agents/manage-apm-agents/configuration/server-side-agent-configuration#customize-ssc) for the application that has errors that you want to ignore.
3.  Under **Error collection**, look for **Ignore from error collection**. Add the **HTTP code** or the **Error class** for the errors that you want to ignore.
4.  Select **Save server-side configuration**.

**Ignore errors using agent configuration**

To ignore an error using the agent configuration, see the configuration documentation for your agent:

-   **Go**: [`ErrorCollector.IgnoreStatusCodes`](https://docs.newrelic.com/docs/agents/go-agent/instrumentation/go-agent-configuration#error-ignore-status).
-   **Java**: `error_collector.ignore_classes`, `error_collector.ignore_classes.message`, or `error_collector.ignore_status_codes`. For additional information, see [Java agent error configuration](https://docs.newrelic.com/docs/agents/java-agent/configuration/java-agent-error-configuration).
-   **.NET**: [`ignoreClasses`](https://docs.newrelic.com/docs/apm/agents/net-agent/configuration/net-agent-configuration/#error-ignoreClasses), [`ignoreMessages`](https://docs.newrelic.com/docs/apm/agents/net-agent/configuration/net-agent-configuration/#error-ignoreMessages), or [`ignoreStatusCodes`](https://docs.newrelic.com/docs/apm/agents/net-agent/configuration/net-agent-configuration/#error-ignoreStatusCodes).
-   **Node.js**: [`ignore_classes`](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration/#error_ignore_classes), [`ignore_messages`](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration/#error_ignore_messages), or [`ignore_status_codes`](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration/#error_ignore).
-   **PHP**: [`error_collector.ignore_exceptions`](https://docs.newrelic.com/docs/apm/agents/php-agent/configuration/php-agent-configuration/#inivar-err-ignore-exceptions) or [`error_collector.ignore_errors`](https://docs.newrelic.com/docs/apm/agents/php-agent/configuration/php-agent-configuration/#inivar-err-ignore-errors).
-   **Python**: [`error_collector.ignore_classes`](https://docs.newrelic.com/docs/agents/python-agent/configuration/python-agent-configuration/#error-ignore) or [`error_collector.ignore_status_codes`](https://docs.newrelic.com/docs/agents/python-agent/configuration/python-agent-configuration/#error-ignore-status-codes).
-   **Ruby**: [`error_collector.ignore_classes`](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#error_collector-ignore_classes),[`error_collector.ignore_messages`](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#error_collector-ignore_messages), or [`error_collector.ignore_status_codes`](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#error_collector-ignore_status_codes)

## Expected errors (Java, Node.js, Python, Ruby, Go, and .NET only) [#expected]

For the below APM agents, you can mark errors as expected. These errors will be reported to APM and available for viewing, but they won't affect the [Apdex](https://docs.newrelic.com/docs/apm/new-relic-apm/apdex/apdex-measuring-user-satisfaction) or [error rate](https://docs.newrelic.com/docs/apm/applications-menu/error-analytics/error-analytics-explore-events-behind-errors) (or [alert conditions](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/define-alert-conditions) based on error rate).

To configure errors as expected, see the agent-specific documentation:

-   [Java](https://docs.newrelic.com/docs/agents/java-agent/configuration/java-agent-error-configuration)
-   [Ruby](https://docs.newrelic.com/docs/agents/ruby-agent/configuration/ruby-agent-configuration/#error-collector)
-   [Node.js](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/installation-configuration/nodejs-agent-configuration/#error_config)
-   [.NET](https://docs.newrelic.com/docs/apm/agents/net-agent/configuration/net-agent-configuration/#error_collector)
-   [Go](https://docs.newrelic.com/docs/apm/agents/go-agent/configuration/go-agent-configuration/#error-collector)
-   [Python](https://docs.newrelic.com/docs/agents/python-agent/configuration/python-agent-configuration/#error-collector-settings)

If expected errors are enabled, APM's [**Error analytics**](https://docs.newrelic.com/docs/apm/applications-menu/error-analytics/error-analytics-explore-events-behind-errors) page will, by default, have a filter applied with the `error.expected` attribute set to `false`, meaning expected errors will not be displayed. To view expected errors, turn off the `error.expected` filter.

To view expected errors, [query your data](https://docs.newrelic.com/docs/using-new-relic/data/understand-data/query-new-relic-data):

-   To view charts of expected errors, create a query for the [`error.expected`](https://docs.newrelic.com/docs/insights/insights-data-sources/default-events-attributes/apm-default-event-attributes#transerror-expected) attribute.
-   To create [alert conditions for NRQL queries](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/create-alert-conditions-nrql-queries), use the `error.expected` attribute.

## Error fingerprinting with errors inbox [#error-fingerprinting]

Errors inbox intelligently groups error occurrences to reduce noise and highlight important errors.

Error events get grouped into an error group when they share the [same fingerprint](https://docs.newrelic.com/docs/errors-inbox/errors-inbox/#how-groups-work). While our managed rules are able to provide automatic error grouping based on a predefined set of patterns, it is impossible to recognize every possible combination. For this reason, customers can also set their own fingerprint via a callback function if they find that our managed rules are not grouping occurrences accurately.

To configure custom fingerprint logic, see the agent-specific documentation:

-   [Go](https://docs.newrelic.com/docs/apm/agents/go-agent/api-guides/guide-using-go-agent-api/#error-fingerprinting)
-   [Java](https://docs.newrelic.com/docs/apm/agents/java-agent/api-guides/java-agent-api-register-error-group-callback-to-set-fingerprint)
-   [Node.js](https://docs.newrelic.com/docs/apm/agents/nodejs-agent/api-guides/guide-using-nodejs-agent-api/#errors)
-   [.Net](https://docs.newrelic.com/docs/apm/agents/net-agent/net-agent-api/seterrorgroupcallback-net-agent-api)
-   [PHP](https://docs.newrelic.com/docs/apm/agents/php-agent/php-agent-api/newrelic_set_error_group_callback)
-   [Python](https://docs.newrelic.com/docs/apm/agents/python-agent/python-agent-api/seterrrorgroupcallback-python-agent-api)
-   [Ruby](https://docs.newrelic.com/docs/apm/agents/ruby-agent/api-guides/sending-handled-errors-new-relic/#error-fingerprinting)

## View errors in the UI [#view-errors]

Among other places, error data appears in these parts of the UI:

-   [Error analytics page](https://docs.newrelic.com/docs/apm/applications-menu/error-analytics/introduction-error-analytics): shows in-depth charts and visual analysis of errors.
-   [APM **Overview** page](https://docs.newrelic.com/docs/apm/applications-menu/monitoring/apm-overview-page): shows a high-level view of your application, which includes errors.
-   [Alert conditions](https://docs.newrelic.com/docs/alerts/new-relic-alerts/defining-conditions/define-alert-conditions): can be based on error rate.
-   The [`transactionError`](https://docs.newrelic.com/docs/insights/insights-data-sources/default-events-attributes/apm-default-event-attributes#transactionerror-event) event: contains underlying error data, which can be used in [NRQL queries](https://docs.newrelic.com/docs/insights/nrql-new-relic-query-language/using-nrql/introduction-nrql).
