Database anomaly detection API - PUT configuration

Updates the configuration of anomaly detection for database services.

The request consumes an application/json payload.

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

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
bodyDatabaseAnomalyDetectionConfig

The JSON body of the request. Contains parameters of the database service anomaly detection configuration.

bodyoptional

Request body objects

The DatabaseAnomalyDetectionConfig object

The configuration of the anomaly detection for database services.

ElementTypeDescriptionRequired
databaseConnectionFailureCountDatabaseConnectionFailureDetectionConfig

Parameters of the failed database connections detection.

The alert is triggered when failed connections number exceeds connectionFailsCount during any timePeriodMinutes minutes period.

required
failureRateIncreaseFailureRateIncreaseDetectionConfig

Configuration of failure rate increase detection.

required
loadDropLoadDropDetectionConfig

The configuration of load drops detection.

optional
loadSpikeLoadSpikeDetectionConfig

The configuration of load spikes detection.

optional
metadataConfigurationMetadata

Metadata useful for debugging

optional
responseTimeDegradationResponseTimeDegradationDetectionConfig

Configuration of response time degradation detection.

required

The DatabaseConnectionFailureDetectionConfig object

Parameters of the failed database connections detection.

The alert is triggered when failed connections number exceeds connectionFailsCount during any timePeriodMinutes minutes period.

ElementTypeDescriptionRequired
connectionFailsCountinteger

Number of failed database connections during any timePeriodMinutes minutes period to trigger an alert.

optional
enabledboolean

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

required
timePeriodMinutesinteger

The X minutes time period during which the connectionFailsCount is evaluated.

optional

The FailureRateIncreaseDetectionConfig object

Configuration of failure rate increase detection.

ElementTypeDescriptionRequired
automaticDetectionFailureRateIncreaseAutodetectionConfig

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%

optional
detectionModestring

How to detect failure rate increase: automatically, or based on fixed thresholds, or do not detect.

  • DETECT_AUTOMATICALLY
  • DETECT_USING_FIXED_THRESHOLDS
  • DONT_DETECT
required
thresholdsFailureRateIncreaseThresholdConfig

Fixed thresholds for failure rate increase detection.

Required if detectionMode is DETECT_USING_FIXED_THRESHOLDS. Not applicable otherwise.

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%

ElementTypeDescriptionRequired
failingServiceCallPercentageIncreaseAbsoluteinteger

Absolute increase of failing service calls to trigger an alert, %.

required
failingServiceCallPercentageIncreaseRelativeinteger

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.

ElementTypeDescriptionRequired
sensitivitystring

Sensitivity of the threshold.

With low sensitivity, high statistical confidence is used. Brief violations (for example, due to a surge in load) won't trigger alerts.

With high sensitivity, no statistical confidence is used. Each violation triggers alert.

  • HIGH
  • LOW
  • MEDIUM
required
thresholdinteger

Failure rate during any 5-minute period to trigger an alert, %.

required

The LoadDropDetectionConfig object

The configuration of load drops detection.

ElementTypeDescriptionRequired
enabledboolean

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

required
loadDropPercentinteger

Alert if the observed load is less than X % of the expected value.

optional
minAbnormalStateDurationInMinutesinteger

Alert if the service stays in abnormal state for at least X minutes.

optional

The LoadSpikeDetectionConfig object

The configuration of load spikes detection.

ElementTypeDescriptionRequired
enabledboolean

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

required
loadSpikePercentinteger

Alert if the observed load is more than X % of the expected value.

optional
minAbnormalStateDurationInMinutesinteger

Alert if the service stays in abnormal state for at least X minutes.

optional

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 ResponseTimeDegradationDetectionConfig object

Configuration of response time degradation detection.

ElementTypeDescriptionRequired
automaticDetectionResponseTimeDegradationAutodetectionConfig

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.

optional
detectionModestring

How to detect response time degradation: automatically, or based on fixed thresholds, or do not detect.

  • DETECT_AUTOMATICALLY
  • DETECT_USING_FIXED_THRESHOLDS
  • DONT_DETECT
required
thresholdsResponseTimeDegradationThresholdConfig

Fixed thresholds for response time degradation detection.

Required if detectionMode is DETECT_USING_FIXED_THRESHOLDS. Not applicable otherwise.

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.

ElementTypeDescriptionRequired
loadThresholdstring

Minimal service load to detect response time degradation.

Response time degradation of services with smaller load won't trigger alerts.

  • FIFTEEN_REQUESTS_PER_MINUTE
  • FIVE_REQUESTS_PER_MINUTE
  • ONE_REQUEST_PER_MINUTE
  • TEN_REQUESTS_PER_MINUTE
required
responseTimeDegradationMillisecondsinteger

Alert if the response time degrades beyond X milliseconds.

required
responseTimeDegradationPercentinteger

Alert if the response time degrades beyond X %.

required
slowestResponseTimeDegradationMillisecondsinteger

Alert if the response time of the slowest 10% degrades beyond X milliseconds.

required
slowestResponseTimeDegradationPercentinteger

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.

ElementTypeDescriptionRequired
loadThresholdstring

Minimal service load to detect response time degradation.

Response time degradation of services with smaller load won't trigger alerts.

  • FIFTEEN_REQUESTS_PER_MINUTE
  • FIVE_REQUESTS_PER_MINUTE
  • ONE_REQUEST_PER_MINUTE
  • TEN_REQUESTS_PER_MINUTE
required
responseTimeThresholdMillisecondsinteger

Response time during any 5-minute period to trigger an alert, in milliseconds.

required
sensitivitystring

Sensitivity of the threshold.

With low sensitivity, high statistical confidence is used. Brief violations (for example, due to a surge in load) won't trigger alerts.

With high sensitivity, no statistical confidence is used. Each violation triggers an alert.

  • HIGH
  • LOW
  • MEDIUM
required
slowestResponseTimeThresholdMillisecondsinteger

Response time of the 10% slowest during any 5-minute period to trigger an alert, in milliseconds.

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.

{
"databaseConnectionFailureCount": {
"connectionFailsCount": 5,
"enabled": "true",
"timePeriodMinutes": 5
},
"failureRateIncrease": {
"detectionMode": "DETECT_USING_FIXED_THRESHOLDS",
"thresholds": {
"sensitivity": "LOW",
"threshold": 10
}
},
"loadDrop": {
"enabled": true,
"loadDropPercent": 40,
"minAbnormalStateDurationInMinutes": 5
},
"loadSpike": {
"enabled": false
},
"responseTimeDegradation": {
"automaticDetection": {
"loadThreshold": "ONE_REQUEST_PER_MINUTE",
"responseTimeDegradationMilliseconds": 250,
"responseTimeDegradationPercent": 90,
"slowestResponseTimeDegradationMilliseconds": 500,
"slowestResponseTimeDegradationPercent": 200
},
"detectionMode": "DETECT_AUTOMATICALLY"
}
}

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/databaseServices/validator
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/anomalyDetection/databaseServices/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 database services from the GET request example. It activates response time degradation detection in automatic mode and sets the following thresholds:

  • Alert if the response time degrades by more than 5 ms and by 50%.
  • Alert if the response time of the slowest 10% degrades by more than 20 ms and by 100%.
  • To avoid over-alerting, do not alert for low-load services with fewer than 10 requests per minute.

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

Curl

curl -X PUT \
https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/databaseServices \
-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
-d '{
"responseTimeDegradation": {
"detectionMode": "DETECT_AUTOMATICALLY",
"automaticDetection": {
"responseTimeDegradationMilliseconds": 5,
"responseTimeDegradationPercent": 50,
"slowestResponseTimeDegradationMilliseconds": 5,
"slowestResponseTimeDegradationPercent": 100,
"loadThreshold": "TEN_REQUESTS_PER_MINUTE"
}
},
"failureRateIncrease": {
"detectionMode": "DETECT_USING_FIXED_THRESHOLDS",
"thresholds": {
"threshold": 0,
"sensitivity": "LOW"
}
},
"databaseConnectionFailureCount": {
"enabled": true,
"connectionFailsCount": 5,
"timePeriodMinutes": 5
}
}
'

Request URL

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

Request body

{
"responseTimeDegradation": {
"detectionMode": "DETECT_AUTOMATICALLY",
"automaticDetection": {
"responseTimeDegradationMilliseconds": 5,
"responseTimeDegradationPercent": 50,
"slowestResponseTimeDegradationMilliseconds": 5,
"slowestResponseTimeDegradationPercent": 100,
"loadThreshold": "TEN_REQUESTS_PER_MINUTE"
}
},
"failureRateIncrease": {
"detectionMode": "DETECT_USING_FIXED_THRESHOLDS",
"thresholds": {
"threshold": 0,
"sensitivity": "LOW"
}
},
"databaseConnectionFailureCount": {
"enabled": true,
"connectionFailsCount": 5,
"timePeriodMinutes": 5
}
}

Response code

204

Result

The updated configuration has the following parameters:

Anomaly detection config - database - updated