To set up how errors are captured, edit your application and expand the Errors section. Select the required error type and then configure an error to be captured, included in Apdex calculations, or considered for Davis AI problem detection and analysis.
Dynatrace categorizes errors into the following types.
By default, Dynatrace considers all 4xx
and 5xx
HTTP status codes to be request errors. CSP violations and errors with failed image requests are also captured as request errors. In addition, the RUM JavaScript can also use custom status codes to inform you of framework issues.
You can change the default settings by configuring request error rules.
To add a request error rule
Go to Web.
Select the application that you want to configure.
In the upper-right corner of the application overview page, select More (…) > Edit.
From the application settings, select Errors > Request errors.
Select Add request error rule.
Use at least one of the following options:
404
, or a whole error code range, such as 400-499
.optional To apply the request error rule only to certain URLs, adjust the options under Filter settings.
Specify if you want to Capture this error. Also, you can Include error in Apdex calculations and Include error in Davis AI problem detection and analysis.
If you opt for including the error in Davis AI analysis, Davis may report this error as a new open problem.
The request error rules are executed in the order of their appearance in the error list. Select and hold Drag row next to the rule name, and move the rule up or down in the list to change its priority.
You can also turn on Ignore request errors in Apdex calculations to override Apdex settings for individual request error rules.
Besides capturing standard HTTP error codes, the RUM JavaScript can also use custom status codes to signal that it detected a framework issue.
For applications created with Dynatrace version 1.238+, the RUM JavaScript reports some request errors using custom status codes 970
–979
when the real HTTP status code can't be captured. Note that these custom status codes are not real HTTP status codes; they just mean that the RUM JavaScript detected an error fired by the framework you use.
Whether such request errors affect your users depends on your application. For example, if you send a request to a tracking service and the request is canceled, such an error hardly impacts the users of your application. However, a failed payment request would definitely inconvenience them.
The RUM JavaScript uses the following custom status codes:
For applications created starting with Dynatrace version 1.238, these custom status codes are detected automatically. They're included in Apdex calculations but are not considered for Davis AI analysis.
If you want to ignore these custom status codes, delete or disable the HTTP 970-979 request error rule.
To delete or disable the HTTP 970-979 request error rule
For applications created with Dynatrace versions earlier than 1.238, the custom status codes are not used. If you want to capture these codes, add a request error rule with the following settings:
970-979
Enabled
Enabled
or Disabled
based on your needsEnabled
or Disabled
based on your needsCustom errors allow you to detect your own errors. An example of this is an error that is triggered during a form field validation.
For setting up a custom error, configure how Dynatrace should treat the error, and then trigger the error in your application using the RUM JavaScript API.
To add a custom error rule
Go to Web.
Select the application that you want to configure.
In the upper-right corner of the application overview page, select More (…) > Edit.
From the application settings, select Errors > Custom errors.
Select Add custom error rule.
Provide the conditions that Dynatrace should use to identify the custom error.
key
.value
.
Custom error rules are case-insensitive. For example, values such as mykey
and MyKeY
are treated the same.
Specify if you want to Capture this error. Also, you can Include error in Apdex calculations and Include error in Davis AI problem detection and analysis.
If you opt for including the error in Davis AI analysis, Davis may report this error as a new open problem.
The custom error rules are executed in the order of their appearance in the error list. Select and hold Drag row next to the rule name, and move the rule up or down in the list to change its priority.
You can also turn on Ignore custom errors in Apdex calculations to override Apdex settings for individual custom error rules.
After adding or excluding a custom error in Dynatrace, you must trigger the error in your application using the dtrum.reportCustomError()
method of the RUM JavaScript API.
For example, a form field error would require the following JavaScript method parameters:
key
custom_buying_form_number_of_travelers_field
value
availability exceeded - e3434
hint
1000
Only key
and value
can be used to group and analyze custom errors; hint
is optional information.
For more information on how to report custom errors, see RUM JavaScript API - reportCustomError.
Browsers detect JavaScript errors automatically, so you don't have to add these errors. If you configure JavaScript errors to be captured, they are automatically included in Apdex calculations and Davis analysis.
To ignore JavaScript errors on an individual level, select Ignore this JavaScript error on the respective JavaScript error details page.
To ignore all JavaScript errors in Apdex calculations
If the out-of-the-box alerting on request, custom, and JavaScript errors is not sensitive enough for you, or if you want to focus on an individual error, you can create additional error alerts.
To create additional error alerts
Go to Web and select the application to display the application overview page.
In the infographic, select Errors.
Under Errors by type, select Analyze by type.
Under Detail analysis for selected timeframe, set filters in the Filter by… box. Available filters in the Errors category are Custom error name
, Custom error type
, Error type
, Errors
, Request error code
, Request error resource
, and Request error type
.
Select Create metric.
In the opened overlay, adjust the metric settings, and select Create metric.
For details on creating and charting calculated metrics, see Create calculated metrics for web applications.
Select Create alert.
Configure the alert settings. When done, select Create custom event for alerting.
For details on creating an alert, see Metric events.
Use a static threshold of 1
if you want Davis to always raise a problem when a particular error occurs. If you're interested only in anomalies for that error, use auto-baselining.