How do I use request attributes to set up functional error detection?

There are many cases where requests fail for reasons that are related to business logic. While such situations often aren’t detectable via exceptions or HTTP response codes, they are nevertheless indicative of problems. In fact, these situations may be even more important than situations that are detected via exceptions and response codes. To handle these situations, Dynatrace allows you to use request attributes as indicators for error situations. For example, you might have a business function in your Java code that indicates an error via a return value. In other situations, you might have your own error handling functionality that, when called, indicates a functional business error. All of these situations can be captured via request attributes.

To create a custom error rule

  1. Select Transactions & services from the navigation menu.

  2. Select the service for which you need to adapt failure detection.

  3. Click the browse button () and select Edit.

  4. Select the Error detection tab.

  5. Within the Custom errors section of the page, click the Add custom error rule button.

  6. Select a request attribute from the displayed list (note that not all listed attributes may be available for the respective service).

  7. Define a condition for the rule. You can define a simple exists rule or a greater than, or a contains rule.

In the example below, a value of -1 in the Amount of recommendations attribute indicates an error. If Dynatrace detects such an error, it will mark the respective service request as failed and explain that the rule match is the reason for the failure.

request attributes