AWS anomaly detection API - PUT configuration

Updates the configuration of anomaly detection for AWS.

The request consumes an application/json payload.

PUTSaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/aws
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/anomalyDetection/aws

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

ParameterTypeDescriptionInRequired
bodyAwsAnomalyDetectionConfig

JSON body of the request, containing parameters of the AWS anomaly detection configuration.

bodyoptional

Request body objects

The AwsAnomalyDetectionConfig object

The configuration of anomaly detection for AWS.

ElementTypeDescriptionRequired
ec2CandidateCpuSaturationDetectionEc2CandidateCpuSaturationDetectionConfig

The configuration of the high CPU saturation on EC2 without installed agent (monitoring candidate). If null, then this configuration won't be changed.

optional
elbHighConnectionErrorsDetectionElbHighConnectionErrorsDetectionConfig

The configuration of the high number of backend connection errors on ELB detection.

required
lambdaHighErrorRateDetectionLambdaHighErrorRateDetectionConfig

The configuration of the AWS Lambda high error rate detection.

required
metadataConfigurationMetadata

Metadata useful for debugging

optional
rdsHighCpuDetectionRdsHighCpuDetectionConfig

The configuration of the high CPU utilization on RDS detection.

required
rdsHighMemoryDetectionRdsHighMemoryDetectionConfig

The configuration of RDS running out of memory detection.

required
rdsHighWriteReadLatencyDetectionRdsHighWriteReadLatencyDetectionConfig

The configuration of the high RDS write/read latency detection.

required
rdsLowStorageDetectionRdsLowStorageDetectionConfig

The configuration of the low free storage space on RDS detection.

required
rdsRestartsSequenceDetectionRdsRestartsSequenceDetectionConfig

The configuration of the restarts sequence on RDS detection.

required

The Ec2CandidateCpuSaturationDetectionConfig object

The configuration of the high CPU saturation on EC2 without installed agent (monitoring candidate). If null, then this configuration won't be changed.

ElementTypeDescriptionRequired
customThresholdsEc2CandidateCpuSaturationThresholds

Custom thresholds for high CPU saturation on EC2 monitoring candidate. If not set, automatic mode is used.

optional
enabledboolean

The detection is enabled (true) or disabled (false).

required

The Ec2CandidateCpuSaturationThresholds object

Custom thresholds for high CPU saturation on EC2 monitoring candidate. If not set, automatic mode is used.

ElementTypeDescriptionRequired
cpuUsagePercentageinteger

Alert if CPU usage is higher than X% in 3 out of 5 samples.

required

The ElbHighConnectionErrorsDetectionConfig object

The configuration of the high number of backend connection errors on ELB detection.

ElementTypeDescriptionRequired
customThresholdsElbHighConnectionErrorsThresholds

Custom thresholds for high number of backend connection errors on ELB. If not set, automatic mode is used.

optional
enabledboolean

The detection is enabled (true) or disabled (false).

required

The ElbHighConnectionErrorsThresholds object

Custom thresholds for high number of backend connection errors on ELB. If not set, automatic mode is used.

ElementTypeDescriptionRequired
connectionErrorsPerMinuteinteger

Alert if number of backend connection errors is higher than X per minute in 3 out of 5 samples.

required

The LambdaHighErrorRateDetectionConfig object

The configuration of the AWS Lambda high error rate detection.

ElementTypeDescriptionRequired
customThresholdsLambdaHighErrorRateThresholds

Custom thresholds for AWS Lambda high error rate. If not set, automatic mode is used.

optional
enabledboolean

The detection is enabled (true) or disabled (false).

required

The LambdaHighErrorRateThresholds object

Custom thresholds for AWS Lambda high error rate. If not set, automatic mode is used.

ElementTypeDescriptionRequired
failedInvocationsRateinteger

Alert if failed invocations rate is higher than X% in 3 out of 5 samples.

required

The ConfigurationMetadata object

Metadata useful for debugging

ElementTypeDescriptionRequired
clusterVersionstring

Dynatrace version.

optional
configurationVersionsinteger[]

A sorted list of the version numbers of the configuration.

optional
currentConfigurationVersionsstring[]

A sorted list of version numbers of the configuration.

optional

The RdsHighCpuDetectionConfig object

The configuration of the high CPU utilization on RDS detection.

ElementTypeDescriptionRequired
customThresholdsRdsHighCpuThresholds

Custom thresholds for high CPU utilization on RDS. If not set, automatic mode is used.

optional
enabledboolean

The detection is enabled (true) or disabled (false).

required

The RdsHighCpuThresholds object

Custom thresholds for high CPU utilization on RDS. If not set, automatic mode is used.

ElementTypeDescriptionRequired
cpuUsagePercentageinteger

Alert if CPU usage is higher than X% in 3 out of 5 samples.

required

The RdsHighMemoryDetectionConfig object

The configuration of RDS running out of memory detection.

ElementTypeDescriptionRequired
customThresholdsRdsHighMemoryThresholds

Custom thresholds for RDS running out of memory. If not set, automatic mode is used.

All conditions must be fulfilled to trigger an alert.

optional
enabledboolean

The detection is enabled (true) or disabled (false).

required

The RdsHighMemoryThresholds object

Custom thresholds for RDS running out of memory. If not set, automatic mode is used.

All conditions must be fulfilled to trigger an alert.

ElementTypeDescriptionRequired
freeMemorynumber

Freeable memory is lower than X Megabytes in 3 out of 5 samples.

required
swapUsagenumber

Swap usage is higher than X Gigabytes in 3 out of 5 samples.

required

The RdsHighWriteReadLatencyDetectionConfig object

The configuration of the high RDS write/read latency detection.

ElementTypeDescriptionRequired
customThresholdsRdsHighLatencyThresholds

Custom thresholds for high RDS write/read latency. If not set, automatic mode is used

optional
enabledboolean

The detection is enabled (true) or disabled (false).

required

The RdsHighLatencyThresholds object

Custom thresholds for high RDS write/read latency. If not set, automatic mode is used

ElementTypeDescriptionRequired
writeReadLatencyinteger

Alert if read/write latency is higher than X milliseconds in 3 out of 5 samples.

required

The RdsLowStorageDetectionConfig object

The configuration of the low free storage space on RDS detection.

ElementTypeDescriptionRequired
customThresholdsRdsLowStorageThresholds

Custom thresholds for low free storage space on RDS. If not set, automatic mode is used.

optional
enabledboolean

The detection is enabled (true) or disabled (false).

required

The RdsLowStorageThresholds object

Custom thresholds for low free storage space on RDS. If not set, automatic mode is used.

ElementTypeDescriptionRequired
freeStoragePercentageinteger

Alert if free storage space divided by allocated storage is lower than X% in 3 out of 5 samples.

required

The RdsRestartsSequenceDetectionConfig object

The configuration of the restarts sequence on RDS detection.

ElementTypeDescriptionRequired
customThresholdsRdsRestartsThresholds

Custom thresholds for restarts sequence on RDS. If not set, automatic mode is used.

optional
enabledboolean

The detection is enabled (true) or disabled (false).

required

The RdsRestartsThresholds object

Custom thresholds for restarts sequence on RDS. If not set, automatic mode is used.

ElementTypeDescriptionRequired
restartsPerMinuteinteger

Alert if number of restarts is X per minute or higher in 3 out of 20 samples.

required

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.

{
"ec2CandidateCpuSaturationDetection": {
"customThresholds": {
"cpuUsagePercentage": 98
},
"enabled": true
},
"elbHighConnectionErrorsDetection": {
"customThresholds": {
"connectionErrorsPerMinute": 4
},
"enabled": true
},
"lambdaHighErrorRateDetection": {
"customThresholds": {
"failedInvocationsRate": 2
},
"enabled": true
},
"metadata": {
"clusterVersion": "Mock version",
"configurationVersions": [
4,
2
]
},
"rdsHighCpuDetection": {
"customThresholds": {
"cpuUsagePercentage": 99
},
"enabled": true
},
"rdsHighMemoryDetection": {
"customThresholds": {
"freeMemory": 96.99,
"swapUsage": 5.5
},
"enabled": true
},
"rdsHighWriteReadLatencyDetection": {
"customThresholds": {
"writeReadLatency": 800
},
"enabled": true
},
"rdsLowStorageDetection": {
"customThresholds": {
"freeStoragePercentage": 7
},
"enabled": true
},
"rdsRestartsSequenceDetection": {
"customThresholds": {
"restartsPerMinute": 3
},
"enabled": true
}
}

Response

Response codes

CodeTypeDescription
204-

Success. Configuration has been updated. Response doesn't have a body.

400ErrorEnvelope

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.

POSTSaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/aws/validator
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/anomalyDetection/aws/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

CodeTypeDescription
204-

Validated. The submitted configuration is valid. Response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid.

Example

In this example, the request updates the configuration of anomaly detection for AWS from the GET request example. It switches high CPU utilization on RDS detection to custom threshold mode and sets a threshold of 90%. It also disables RDS running out of memory detection.

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 AWS anomaly detection configuration call.

Curl

curl -X PUT \
https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/aws \
-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
-d '{
"rdsHighCpuDetection": {
"enabled": true,
"customThresholds": {
"cpuUsagePercentage": 90
}
},
"rdsHighWriteReadLatencyDetection": {
"enabled": true
},
"rdsLowStorageDetection": {
"enabled": true
},
"rdsHighMemoryDetection": {
"enabled": false
},
"elbHighConnectionErrorsDetection": {
"enabled": true
},
"rdsRestartsSequenceDetection": {
"enabled": true
},
"lambdaHighErrorRateDetection": {
"enabled": true
}
}
'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/aws

Request body

{
"rdsHighCpuDetection": {
"enabled": true,
"customThresholds": {
"cpuUsagePercentage": 90
}
},
"rdsHighWriteReadLatencyDetection": {
"enabled": true
},
"rdsLowStorageDetection": {
"enabled": true
},
"rdsHighMemoryDetection": {
"enabled": false
},
"elbHighConnectionErrorsDetection": {
"enabled": true
},
"rdsRestartsSequenceDetection": {
"enabled": true
},
"lambdaHighErrorRateDetection": {
"enabled": true
}
}

Response code

204

Result

The updated configuration has the following parameters:

Anomaly detection config - AWS - updated