Migrate from Metric events API to Settings API
Anomaly detection API - Metric events has been deprecated with Dynatrace version 1.266. Its replacement is Settings API with the Metric events (builtin:anomaly-detection.metric-events
) schema. We recommend that you migrate to the new API at your earliest convenience.
The migration affects endpoint URLs, query parameters, and response/request body parameters, as well as the scope of the token for the request.
Base URL
/api/v2/settings
/config/v1/anomalyDetection/metricEvents
Authentication token scope
settings.read
)Write settings (
settings.write
)ReadConfig
)Write configuration (
WriteConfig
)Parameters
To learn about new query/body parameters, see the documentation of individual requests in Settings API.
In the Settings 2.0 framework, each metric event is represented by a settings object. An object contains some metadata (like the scope or creation timestamp) and the configuration itself, encapsulated in the value object. To learn about the parameters of a metric event configuration, query the Metric events (builtin:anomaly-detection.metric-events
) schema with the GET a schema request. The configuration differs from the Metric events API—check the examples below to see the differences.
Examples
Here are some examples of differences in API usage.
List metric events
Create a metric event
In this example, we create a metric event that monitors the free disk space on hosts belonging to a certain management zone. We use the static threshold of 10%
and raise an informational event if the metric goes below this value.
Edit a metric event
In this example, we modify the metric event created in the previous example. We lower the threshold to 10%
and modify the event message.