• Home
  • Dynatrace API
  • Configuration
  • Anomaly detection
  • Services
  • PUT configuration

Services anomaly detection API - PUT configuration

This API is deprecated. Use the Settings API instead. Look for the Anomaly detection for services (builtin:anomaly-detection.services) schema.

Updates the configuration of anomaly detection for services.

The request consumes an application/json payload.

PUTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/services
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/services
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/services

Authentication

To execute this request, you need an access token with Write configuration (WriteConfig) scope. To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
bodyServiceAnomalyDetectionConfig

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

bodyoptional

Request body objects

The ServiceAnomalyDetectionConfig object

Dynatrace automatically detects service-related performance anomalies such as response time degradations and failure rate increases. Use these settings to configure detection sensitivity, set alert thresholds, or disable alerting for certain services.

ElementTypeDescription
metadataConfigurationMetadata

Metadata useful for debugging

Can be null.

responseTimeDegradationResponseTimeDegradationDetectionConfig

Configuration of response time degradation detection.

loadDropLoadDropDetectionConfig

The configuration of load drops detection.

Can be null.

loadSpikeLoadSpikeDetectionConfig

The configuration of load spikes detection.

Can be null.

failureRateIncreaseFailureRateIncreaseDetectionConfig

Configuration of failure rate increase detection.

The ConfigurationMetadata object

Metadata useful for debugging

ElementTypeDescription
configurationVersionsinteger[]

A sorted list of the version numbers of the configuration.

Can be null.

currentConfigurationVersionsstring[]

A sorted list of version numbers of the configuration.

Can be null.

clusterVersionstring

Dynatrace version.

Can be null.

The ResponseTimeDegradationDetectionConfig object

Configuration of response time degradation detection.

ElementTypeDescription
detectionModestring

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

The element can hold these values
  • DETECT_AUTOMATICALLY
  • DETECT_USING_FIXED_THRESHOLDS
  • DONT_DETECT
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.

Can be null.

thresholdsResponseTimeDegradationThresholdConfig

Fixed thresholds for response time degradation detection.

Required if detectionMode is DETECT_USING_FIXED_THRESHOLDS. Not applicable otherwise.

Can be null.

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.

ElementTypeDescription
responseTimeDegradationMillisecondsinteger

Alert if the response time degrades beyond X milliseconds.

responseTimeDegradationPercentinteger

Alert if the response time degrades beyond X %.

slowestResponseTimeDegradationMillisecondsinteger

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

slowestResponseTimeDegradationPercentinteger

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

loadThresholdstring

Minimal service load to detect response time degradation.

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

The element can hold these values
  • FIFTEEN_REQUESTS_PER_MINUTE
  • FIVE_REQUESTS_PER_MINUTE
  • ONE_REQUEST_PER_MINUTE
  • TEN_REQUESTS_PER_MINUTE

The ResponseTimeDegradationThresholdConfig object

Fixed thresholds for response time degradation detection.

Required if detectionMode is DETECT_USING_FIXED_THRESHOLDS. Not applicable otherwise.

ElementTypeDescription
responseTimeThresholdMillisecondsinteger

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

slowestResponseTimeThresholdMillisecondsinteger

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

loadThresholdstring

Minimal service load to detect response time degradation.

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

The element can hold these values
  • FIFTEEN_REQUESTS_PER_MINUTE
  • FIVE_REQUESTS_PER_MINUTE
  • ONE_REQUEST_PER_MINUTE
  • TEN_REQUESTS_PER_MINUTE
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.

The element can hold these values
  • HIGH
  • LOW
  • MEDIUM

The LoadDropDetectionConfig object

The configuration of load drops detection.

ElementTypeDescription
enabledboolean

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

loadDropPercentinteger

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

Can be null.

minAbnormalStateDurationInMinutesinteger

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

Can be null.

The LoadSpikeDetectionConfig object

The configuration of load spikes detection.

ElementTypeDescription
enabledboolean

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

loadSpikePercentinteger

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

Can be null.

minAbnormalStateDurationInMinutesinteger

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

Can be null.

The FailureRateIncreaseDetectionConfig object

Configuration of failure rate increase detection.

ElementTypeDescription
detectionModestring

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

The element can hold these values
  • DETECT_AUTOMATICALLY
  • DETECT_USING_FIXED_THRESHOLDS
  • DONT_DETECT
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%

Can be null.

thresholdsFailureRateIncreaseThresholdConfig

Fixed thresholds for failure rate increase detection.

Required if detectionMode is DETECT_USING_FIXED_THRESHOLDS. Not applicable otherwise.

Can be null.

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%

ElementTypeDescription
failingServiceCallPercentageIncreaseAbsoluteinteger

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

failingServiceCallPercentageIncreaseRelativeinteger

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

The FailureRateIncreaseThresholdConfig object

Fixed thresholds for failure rate increase detection.

Required if detectionMode is DETECT_USING_FIXED_THRESHOLDS. Not applicable otherwise.

ElementTypeDescription
thresholdinteger

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

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.

The element can hold these values
  • HIGH
  • LOW
  • MEDIUM

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.

json
{ "metadata": { "configurationVersions": [ 4, 2 ], "clusterVersion": "Mock version" }, "responseTimeDegradation": { "detectionMode": "DETECT_AUTOMATICALLY", "automaticDetection": { "responseTimeDegradationMilliseconds": 250, "responseTimeDegradationPercent": 90, "slowestResponseTimeDegradationMilliseconds": 500, "slowestResponseTimeDegradationPercent": 200, "loadThreshold": "ONE_REQUEST_PER_MINUTE" } }, "loadDrop": { "enabled": true, "loadDropPercent": 40, "minAbnormalStateDurationInMinutes": 5 }, "loadSpike": { "enabled": false }, "failureRateIncrease": { "detectionMode": "DETECT_USING_FIXED_THRESHOLDS", "thresholds": { "threshold": 10, "sensitivity": "LOW" } } }

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.

POSTManaged https://{your-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/services/validator
SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/services/validator
Environment ActiveGate https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/services/validator

Authentication

To execute this request, you need an access token with Write configuration (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 services from the GET request example. It changes the Detect increase in failure rate mode to used fixed thresholds and sets the following threshold with high sensitivity:

  • Alert if 3% of custom failure rate threshold is exceeded during any 5-minute period.

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

Curl

shell
curl -X PUT \ https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/services \ -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \ -H 'Content-Type: application/json' \ -d '{ "responseTimeDegradation": { "detectionMode": "DETECT_AUTOMATICALLY", "automaticDetection": { "responseTimeDegradationMilliseconds": 100, "responseTimeDegradationPercent": 50, "slowestResponseTimeDegradationMilliseconds": 100, "slowestResponseTimeDegradationPercent": 100, "loadThreshold": "TEN_REQUESTS_PER_MINUTE" } }, "failureRateIncrease": { "detectionMode": "DETECT_USING_FIXED_THRESHOLDS", "thresholds": { "threshold": 3, "sensitivity": "HIGH" } } } '

Request URL

plaintext
PUT https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/services

Request body

json
{ "responseTimeDegradation": { "detectionMode": "DETECT_AUTOMATICALLY", "automaticDetection": { "responseTimeDegradationMilliseconds": 100, "responseTimeDegradationPercent": 50, "slowestResponseTimeDegradationMilliseconds": 100, "slowestResponseTimeDegradationPercent": 100, "loadThreshold": "TEN_REQUESTS_PER_MINUTE" } }, "failureRateIncrease": { "detectionMode": "DETECT_USING_FIXED_THRESHOLDS", "thresholds": { "threshold": 3, "sensitivity": "HIGH" } } }

Response code

204

Result

The updated configuration has the following parameters:

Anomaly detection config - services - updated

Related topics
  • Adjust the sensitivity of anomaly detection for services

    Learn how to adapt the sensitivity of problem detection for services.

  • Problem detection and analysis

    Understand the basic concepts related to how Dynatrace detects and raises alerts for problems detected in your environment.

  • Services

    Learn how to monitor and analyze your services, how to define and use request attributes, and more.