|
| 1 | +--- |
| 2 | +layout: "" |
| 3 | +page_title: dynatrace_service_failure Resource - terraform-provider-dynatrace" |
| 4 | +description: |- |
| 5 | + The resource `dynatrace_service_failure` covers configuration for service-level general failure detection parameters |
| 6 | +--- |
| 7 | + |
| 8 | +# dynatrace_service_failure (Resource) |
| 9 | + |
| 10 | +## Dynatrace Documentation |
| 11 | + |
| 12 | +- Configure service failure detection - https://www.dynatrace.com/support/help/platform-modules/applications-and-microservices/services/service-monitoring-settings/configure-service-failure-detection |
| 13 | + |
| 14 | +- Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId: `builtin:failure-detection.service.general-parameters`) |
| 15 | + |
| 16 | +## Export Example Usage |
| 17 | + |
| 18 | +- `terraform-provider-dynatrace -export dynatrace_service_failure` downloads all existing service-level general failure detection parameters |
| 19 | + |
| 20 | +The full documentation of the export feature is available [here](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/guides/export-v2). |
| 21 | + |
| 22 | +## Resource Example Usage |
| 23 | + |
| 24 | +```terraform |
| 25 | +resource "dynatrace_service_failure" "#name#" { |
| 26 | + enabled = true |
| 27 | + service_id = "SERVICE-1234567890000000" |
| 28 | + exception_rules { |
| 29 | + ignore_all_exceptions = false |
| 30 | + ignore_span_failure_detection = true |
| 31 | + custom_error_rules { |
| 32 | + custom_error_rule { |
| 33 | + request_attribute = "00000000-0000-0000-0000-000000000000" |
| 34 | + condition { |
| 35 | + compare_operation_type = "STRING_EXISTS" |
| 36 | + } |
| 37 | + } |
| 38 | + } |
| 39 | + custom_handled_exceptions { |
| 40 | + custom_handled_exception { |
| 41 | + class_pattern = "ClassPatternExample" |
| 42 | + message_pattern = "ExceptionMessagePatternExample" |
| 43 | + } |
| 44 | + } |
| 45 | + ignored_exceptions { |
| 46 | + custom_handled_exception { |
| 47 | + class_pattern = "ClassPatternExample" |
| 48 | + message_pattern = "ExceptionMessagePatternExample" |
| 49 | + } |
| 50 | + } |
| 51 | + success_forcing_exceptions { |
| 52 | + custom_handled_exception { |
| 53 | + class_pattern = "ClassPatternExample" |
| 54 | + message_pattern = "ExceptionMessagePatternExample" |
| 55 | + } |
| 56 | + } |
| 57 | + } |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +<!-- schema generated by tfplugindocs --> |
| 62 | +## Schema |
| 63 | + |
| 64 | +### Required |
| 65 | + |
| 66 | +- `enabled` (Boolean) This setting is enabled (`true`) or disabled (`false`) |
| 67 | +- `service_id` (String) The scope of this settings. If the settings should cover the whole environment, just don't specify any scope. |
| 68 | + |
| 69 | +### Optional |
| 70 | + |
| 71 | +- `exception_rules` (Block List, Max: 1) Customize failure detection for specific exceptions and errors (see [below for nested schema](#nestedblock--exception_rules)) |
| 72 | + |
| 73 | +### Read-Only |
| 74 | + |
| 75 | +- `id` (String) The ID of this resource. |
| 76 | + |
| 77 | +<a id="nestedblock--exception_rules"></a> |
| 78 | +### Nested Schema for `exception_rules` |
| 79 | + |
| 80 | +Required: |
| 81 | + |
| 82 | +- `ignore_all_exceptions` (Boolean) Ignore all exceptions |
| 83 | +- `ignore_span_failure_detection` (Boolean) Ignore span failure detection |
| 84 | + |
| 85 | +Optional: |
| 86 | + |
| 87 | +- `custom_error_rules` (Block List, Max: 1) Some custom error situations are only detectable via a return value or other means. To support such cases, [define a request attribute](https://dt-url.net/ys5k0p4y) that captures the required data. Then define a custom error rule that determines if the request has failed based on the value of the request attribute. (see [below for nested schema](#nestedblock--exception_rules--custom_error_rules)) |
| 88 | +- `custom_handled_exceptions` (Block List, Max: 1) There may be situations where your application code handles exceptions gracefully in a manner that these failures aren't detected by Dynatrace. Use this setting to define specific gracefully-handled exceptions that should be treated as service failures. (see [below for nested schema](#nestedblock--exception_rules--custom_handled_exceptions)) |
| 89 | +- `ignored_exceptions` (Block List, Max: 1) Some exceptions that are thrown by legacy or 3rd-party code indicate a specific response, not an error. Use this setting to instruct Dynatrace to treat such exceptions as non-failed requests.. If an exception matching any of the defined patterns occurs in a request, it will not be considered as a failure. Other exceptions occurring at the same request might still mark the request as failed. (see [below for nested schema](#nestedblock--exception_rules--ignored_exceptions)) |
| 90 | +- `success_forcing_exceptions` (Block List, Max: 1) Define exceptions which indicate that a service call should not be considered as failed. E.g. an exception indicating that the client aborted the operation.. If an exception matching any of the defined patterns occurs on the entry node of the service, it will be considered successful. Compared to ignored exceptions, the request will be considered successful even if other exceptions occur in the same request. (see [below for nested schema](#nestedblock--exception_rules--success_forcing_exceptions)) |
| 91 | + |
| 92 | +<a id="nestedblock--exception_rules--custom_error_rules"></a> |
| 93 | +### Nested Schema for `exception_rules.custom_error_rules` |
| 94 | + |
| 95 | +Required: |
| 96 | + |
| 97 | +- `custom_error_rule` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--exception_rules--custom_error_rules--custom_error_rule)) |
| 98 | + |
| 99 | +<a id="nestedblock--exception_rules--custom_error_rules--custom_error_rule"></a> |
| 100 | +### Nested Schema for `exception_rules.custom_error_rules.custom_error_rule` |
| 101 | + |
| 102 | +Required: |
| 103 | + |
| 104 | +- `condition` (Block List, Min: 1, Max: 1) Request attribute condition (see [below for nested schema](#nestedblock--exception_rules--custom_error_rules--custom_error_rule--condition)) |
| 105 | +- `request_attribute` (String) Request attribute |
| 106 | + |
| 107 | +<a id="nestedblock--exception_rules--custom_error_rules--custom_error_rule--condition"></a> |
| 108 | +### Nested Schema for `exception_rules.custom_error_rules.custom_error_rule.condition` |
| 109 | + |
| 110 | +Required: |
| 111 | + |
| 112 | +- `compare_operation_type` (String) Apply this comparison |
| 113 | + |
| 114 | +Optional: |
| 115 | + |
| 116 | +- `case_sensitive` (Boolean) Case sensitive |
| 117 | +- `double_value` (Number) Value |
| 118 | +- `int_value` (Number) Value |
| 119 | +- `text_value` (String) Value |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | +<a id="nestedblock--exception_rules--custom_handled_exceptions"></a> |
| 125 | +### Nested Schema for `exception_rules.custom_handled_exceptions` |
| 126 | + |
| 127 | +Required: |
| 128 | + |
| 129 | +- `custom_handled_exception` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--exception_rules--custom_handled_exceptions--custom_handled_exception)) |
| 130 | + |
| 131 | +<a id="nestedblock--exception_rules--custom_handled_exceptions--custom_handled_exception"></a> |
| 132 | +### Nested Schema for `exception_rules.custom_handled_exceptions.custom_handled_exception` |
| 133 | + |
| 134 | +Optional: |
| 135 | + |
| 136 | +- `class_pattern` (String) The pattern will match if it is contained within the actual class name. |
| 137 | +- `message_pattern` (String) Optionally, define an exception message pattern. The pattern will match if the actual exception message contains the pattern. |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | +<a id="nestedblock--exception_rules--ignored_exceptions"></a> |
| 142 | +### Nested Schema for `exception_rules.ignored_exceptions` |
| 143 | + |
| 144 | +Required: |
| 145 | + |
| 146 | +- `custom_handled_exception` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--exception_rules--ignored_exceptions--custom_handled_exception)) |
| 147 | + |
| 148 | +<a id="nestedblock--exception_rules--ignored_exceptions--custom_handled_exception"></a> |
| 149 | +### Nested Schema for `exception_rules.ignored_exceptions.custom_handled_exception` |
| 150 | + |
| 151 | +Optional: |
| 152 | + |
| 153 | +- `class_pattern` (String) The pattern will match if it is contained within the actual class name. |
| 154 | +- `message_pattern` (String) Optionally, define an exception message pattern. The pattern will match if the actual exception message contains the pattern. |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | +<a id="nestedblock--exception_rules--success_forcing_exceptions"></a> |
| 159 | +### Nested Schema for `exception_rules.success_forcing_exceptions` |
| 160 | + |
| 161 | +Required: |
| 162 | + |
| 163 | +- `custom_handled_exception` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--exception_rules--success_forcing_exceptions--custom_handled_exception)) |
| 164 | + |
| 165 | +<a id="nestedblock--exception_rules--success_forcing_exceptions--custom_handled_exception"></a> |
| 166 | +### Nested Schema for `exception_rules.success_forcing_exceptions.custom_handled_exception` |
| 167 | + |
| 168 | +Optional: |
| 169 | + |
| 170 | +- `class_pattern` (String) The pattern will match if it is contained within the actual class name. |
| 171 | +- `message_pattern` (String) Optionally, define an exception message pattern. The pattern will match if the actual exception message contains the pattern. |
| 172 | + |
0 commit comments