Application anomaly detection API - PUT configuration
Updates the configuration of anomaly detection for applications.
The request consumes an application/json
payload.
PUT | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/applications |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/applications | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/anomalyDetection/applications |
Authentication
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | ApplicationAnomalyDetectionConfig | The JSON body of the request, containing parameters of the application anomaly detection configuration. | body | optional |
Request body objects
The ApplicationAnomalyDetectionConfig
object
The configuration of anomaly detection for applications.
Element | Type | Description | Required |
---|---|---|---|
failureRateIncrease | FailureRateIncreaseDetectionConfig | Configuration of failure rate increase detection. | required |
metadata | ConfigurationMetadata | Metadata useful for debugging | optional |
responseTimeDegradation | ResponseTimeDegradationDetectionConfig | Configuration of response time degradation detection. | required |
trafficDrop | TrafficDropDetectionConfig | The configuration of traffic drops detection. | required |
trafficSpike | TrafficSpikeDetectionConfig | The configuration of traffic spikes detection. | required |
The FailureRateIncreaseDetectionConfig
object
Configuration of failure rate increase detection.
Element | Type | Description | Required |
---|---|---|---|
automaticDetection | FailureRateIncreaseAutodetectionConfig | Parameters of failure rate increase auto-detection. Required if detectionMode is The absolute and relative thresholds both must exceed to trigger an alert. Example: If the expected error rate is 1.5%, and you set an absolute increase of 1%, and a relative increase of 50%, the thresholds will be: Absolute: 1.5% + 1% = 2.5% Relative: 1.5% + 1.5% * 50% = 2.25% | optional |
detectionMode | string | How to detect failure rate increase: automatically, or based on fixed thresholds, or do not detect.
| required |
thresholds | FailureRateIncreaseThresholdConfig | Fixed thresholds for failure rate increase detection. Required if detectionMode is | optional |
The FailureRateIncreaseAutodetectionConfig
object
Parameters of failure rate increase auto-detection. Required if detectionMode is DETECT_AUTOMATICALLY
. Not applicable otherwise.
The absolute and relative thresholds both must exceed to trigger an alert.
Example: If the expected error rate is 1.5%, and you set an absolute increase of 1%, and a relative increase of 50%, the thresholds will be: Absolute: 1.5% + 1% = 2.5% Relative: 1.5% + 1.5% * 50% = 2.25%
Element | Type | Description | Required |
---|---|---|---|
failingServiceCallPercentageIncreaseAbsolute | integer | Absolute increase of failing service calls to trigger an alert, %. | required |
failingServiceCallPercentageIncreaseRelative | integer | Relative increase of failing service calls to trigger an alert, %. | required |
The FailureRateIncreaseThresholdConfig
object
Fixed thresholds for failure rate increase detection.
Required if detectionMode is DETECT_USING_FIXED_THRESHOLDS
. Not applicable otherwise.
Element | Type | Description | Required |
---|---|---|---|
sensitivity | string | Sensitivity of the threshold. With With
| required |
threshold | integer | Failure rate during any 5-minute period to trigger an alert, %. | required |
The ConfigurationMetadata
object
Metadata useful for debugging
Element | Type | Description | Required |
---|---|---|---|
clusterVersion | string | Dynatrace version. | optional |
configurationVersions | integer[] | A sorted list of the version numbers of the configuration. | optional |
currentConfigurationVersions | string[] | A sorted list of version numbers of the configuration. | optional |
The ResponseTimeDegradationDetectionConfig
object
Configuration of response time degradation detection.
Element | Type | Description | Required |
---|---|---|---|
automaticDetection | ResponseTimeDegradationAutodetectionConfig | Parameters of the response time degradation auto-detection. Required if the detectionMode is Violation of any criterion triggers an alert. | optional |
detectionMode | string | How to detect response time degradation: automatically, or based on fixed thresholds, or do not detect.
| required |
thresholds | ResponseTimeDegradationThresholdConfig | Fixed thresholds for response time degradation detection. Required if detectionMode is | optional |
The ResponseTimeDegradationAutodetectionConfig
object
Parameters of the response time degradation auto-detection. Required if the detectionMode is DETECT_AUTOMATICALLY
. Not applicable otherwise.
Violation of any criterion triggers an alert.
Element | Type | Description | Required |
---|---|---|---|
loadThreshold | string | Minimal service load to detect response time degradation. Response time degradation of services with smaller load won't trigger alerts.
| required |
responseTimeDegradationMilliseconds | integer | Alert if the response time degrades beyond X milliseconds. | required |
responseTimeDegradationPercent | integer | Alert if the response time degrades beyond X %. | required |
slowestResponseTimeDegradationMilliseconds | integer | Alert if the response time of the slowest 10% degrades beyond X milliseconds. | required |
slowestResponseTimeDegradationPercent | integer | Alert if the response time of the slowest 10% degrades beyond X %. | required |
The ResponseTimeDegradationThresholdConfig
object
Fixed thresholds for response time degradation detection.
Required if detectionMode is DETECT_USING_FIXED_THRESHOLDS
. Not applicable otherwise.
Element | Type | Description | Required |
---|---|---|---|
loadThreshold | string | Minimal service load to detect response time degradation. Response time degradation of services with smaller load won't trigger alerts.
| required |
responseTimeThresholdMilliseconds | integer | Response time during any 5-minute period to trigger an alert, in milliseconds. | required |
sensitivity | string | Sensitivity of the threshold. With With
| required |
slowestResponseTimeThresholdMilliseconds | integer | Response time of the 10% slowest during any 5-minute period to trigger an alert, in milliseconds. | required |
The TrafficDropDetectionConfig
object
The configuration of traffic drops detection.
Element | Type | Description | Required |
---|---|---|---|
enabled | boolean | The detection is enabled ( | required |
trafficDropPercent | integer | Alert if the observed traffic is less than X % of the expected value. | optional |
The TrafficSpikeDetectionConfig
object
The configuration of traffic spikes detection.
Element | Type | Description | Required |
---|---|---|---|
enabled | boolean | The detection is enabled ( | required |
trafficSpikePercent | integer | Alert if the observed traffic is more than X % of the expected value. | optional |
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
1{2 "failureRateIncrease": {3 "detectionMode": "DETECT_USING_FIXED_THRESHOLDS",4 "thresholds": {5 "sensitivity": "LOW",6 "threshold": 107 }8 },9 "responseTimeDegradation": {10 "automaticDetection": {11 "loadThreshold": "ONE_REQUEST_PER_MINUTE",12 "responseTimeDegradationMilliseconds": 250,13 "responseTimeDegradationPercent": 90,14 "slowestResponseTimeDegradationMilliseconds": 500,15 "slowestResponseTimeDegradationPercent": 20016 },17 "detectionMode": "DETECT_AUTOMATICALLY"18 },19 "trafficDrop": {20 "enabled": true,21 "trafficDropPercent": 9522 },23 "trafficSpike": {24 "enabled": false25 }26}
Response
Response codes
Code | Type | Description |
---|---|---|
204 | - | Success. Configuration has been updated. Response doesn't have a body. |
400 | ErrorEnvelope | Failed. The input is invalid |
Validate payload
We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.
The request consumes an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/applications/validator |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/applications/validator | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/anomalyDetection/applications/validator |
Authentication
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Response
Response codes
Code | Type | Description |
---|---|---|
204 | - | Validated. The submitted configuration is valid. Response does not have a body. |
400 | ErrorEnvelope | Failed. The input is invalid |
Example
In this example, the request updates the configuration of anomaly detection for applications from the GET request example. It activates traffic spikes detection and sets the threshold of 200%.
The API token is passed in the Authorization header.
You can download or copy the example request body to try it out on your own. Be sure to create a backup copy of your current configuration with the GET application anomaly detection configuration call.
Curl
1curl -X PUT \2 https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/applications \3 -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \4 -H 'Content-Type: application/json' \5 -d '{6 "responseTimeDegradation": {7 "detectionMode": "DETECT_AUTOMATICALLY",8 "automaticDetection": {9 "responseTimeDegradationMilliseconds": 100,10 "responseTimeDegradationPercent": 50,11 "slowestResponseTimeDegradationMilliseconds": 1000,12 "slowestResponseTimeDegradationPercent": 10,13 "loadThreshold": "TEN_REQUESTS_PER_MINUTE"14 }15 },16 "trafficDrop": {17 "enabled": true,18 "trafficDropPercent": 5019 },20 "trafficSpike": {21 "enabled": true,22 "trafficSpikePercent": 20023 },24 "failureRateIncrease": {25 "detectionMode": "DETECT_AUTOMATICALLY",26 "automaticDetection": {27 "failingServiceCallPercentageIncreaseAbsolute": 5,28 "failingServiceCallPercentageIncreaseRelative": 5029 }30 }31}32'
Request URL
1https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/applications
Request body
1{2 "responseTimeDegradation": {3 "detectionMode": "DETECT_AUTOMATICALLY",4 "automaticDetection": {5 "responseTimeDegradationMilliseconds": 100,6 "responseTimeDegradationPercent": 50,7 "slowestResponseTimeDegradationMilliseconds": 1000,8 "slowestResponseTimeDegradationPercent": 10,9 "loadThreshold": "TEN_REQUESTS_PER_MINUTE"10 }11 },12 "trafficDrop": {13 "enabled": true,14 "trafficDropPercent": 5015 },16 "trafficSpike": {17 "enabled": true,18 "trafficSpikePercent": 20019 },20 "failureRateIncrease": {21 "detectionMode": "DETECT_AUTOMATICALLY",22 "automaticDetection": {23 "failingServiceCallPercentageIncreaseAbsolute": 5,24 "failingServiceCallPercentageIncreaseRelative": 5025 }26 }27}
Response code
204
Result
The updated configuration has the following parameters: