Metric events anomaly detection API - GET an event

Gets parameters of the specified metric event rule.

The request produces an application/json payload.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

GET
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/anomalyDetection/metricEvents/{id}
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/anomalyDetection/metricEvents/{id}

Authentication

To execute this request, you need the Read configuration (ReadConfig) permission assigned to your API token. To learn how to obtain and use it, see Authentication.

Parameters

Parameter Type Description In Required
id string

The ID of the required metric event.

path required

Response format

To find all JSON models that depend on the type of the model, refer to JSON models.

The MetricEvent object

The configuration of the metric event.

Element Type Description
metadata ConfigurationMetadata
id string

The ID of the metric event.

metricId string

The ID of the metric evaluated by the metric event.

name string

The name of the metric event displayed in the UI.

description string

The description of the metric event.

aggregationType string

How the metric data points are aggregated for the evaluation.

The timeseries must support this aggregation.

The aggregationType element can hold these values.
severity string

The type of the event to trigger on the threshold violation.

The CUSTOM_ALERT type is not correlated with other alerts. The INFO type does not open a problem.

The severity element can hold these values.
enabled boolean

The metric event is enabled (true) or disabled (false).

alertingScope MetricEventAlertingScope[]

Defines the scope of the metric event. Only one filter is allowed per filter type, except for tags, where up to 3 are allowed. The filters are combined by conjunction.

metricDimensions MetricEventDimensions[]

Defines the dimensions of the metric to alert on. The filters are combined by conjunction.

monitoringStrategy MetricEventMonitoringStrategy

The MetricEventMonitoringStrategy object

A monitoring strategy for a metric event config.

This is the base version of the monitoring strategy, depending on the type, the actual JSON may contain additional fields.

Element Type Description
type string

Defines the actual set of fields depending on the value. See one of the following objects:

  • STATIC_THRESHOLD -> MetricEventStaticThresholdMonitoringStrategy
The type element can hold these values.

The MetricEventDimensions object

A single filter for the metrics dimensions.

This is the base version of the filter, depending on the type, the actual JSON may contain additional fields.

Element Type Description
filterType string

Defines the actual set of fields depending on the value. See one of the following objects:

  • ENTITY -> MetricEventEntityDimensions
  • STRING -> MetricEventStringDimensions
The filterType element can hold these values.
name string

The dimensions name. Sending this has no effect while creating a configuration, as only the index of the dimension is used here -> dimension names might change, indexes not.

index integer

The dimensions index on the metric.

The MetricEventAlertingScope object

A single filter for the alerting scope.

This is the base version of the filter, depending on the type, the actual JSON may contain additional fields.

Element Type Description
filterType string

Defines the actual set of fields depending on the value. See one of the following objects:

  • ENTITY_ID -> EntityIdAlertingScope
  • MANAGEMENT_ZONE -> ManagementZoneAlertingScope
  • TAG -> TagFilterAlertingScope
  • NAME -> NameAlertingScope
  • CUSTOM_DEVICE_GROUP_NAME -> CustomDeviceGroupNameAlertingScope
  • HOST_GROUP_NAME -> HostGroupNameAlertingScope
  • HOST_NAME -> HostNameAlertingScope
  • PROCESS_GROUP_ID -> ProcessGroupIdAlertingScope
  • PROCESS_GROUP_NAME -> ProcessGroupNameAlertingScope
The filterType element can hold these values.

The ConfigurationMetadata object

Metadata useful for debugging

Element Type Description
configurationVersions integer[]

A Sorted list of the version numbers of the configuration.

clusterVersion string

Dynatrace server version.

Possible values

Possible values for the type element in the MetricEventMonitoringStrategy object:

  • STATIC_THRESHOLD

Possible values for the filterType element in the MetricEventDimensions object:

  • ENTITY
  • STRING

Possible values for the filterType element in the MetricEventAlertingScope object:

  • CUSTOM_DEVICE_GROUP_NAME
  • ENTITY_ID
  • HOST_GROUP_NAME
  • HOST_NAME
  • MANAGEMENT_ZONE
  • NAME
  • PROCESS_GROUP_ID
  • PROCESS_GROUP_NAME
  • TAG

Possible values for the severity element in the MetricEvent object:

  • AVAILABILITY
  • CUSTOM_ALERT
  • ERROR
  • INFO
  • PERFORMANCE
  • RESOURCE_CONTENTION

Possible values for the aggregationType element in the MetricEvent object:

  • AVG
  • COUNT
  • MAX
  • MEDIAN
  • MIN
  • OF_INTEREST
  • OF_INTEREST_RATIO
  • OTHER
  • OTHER_RATIO
  • P90
  • SUM
  • VALUE

Example

In this example, the request lists the parameters of the High OS CPU usage custom metric event rule.

The API token is passed in the Authorization header.

The rule has the following parameters:

Metric event rule

Curl

curl -X GET \
  https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/metricEvents/dynatrace.remote.python.elasticsearch:node.os.cpu_percent:node.os.cpu_percent.high_usage \
  -H 'Authorization: api-token abcdefjhij1234567890'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/anomalyDetection/metricEvents/dynatrace.remote.python.elasticsearch:node.os.cpu_percent:node.os.cpu_percent.high_usage

Response body

{
  "metadata": {
    "clusterVersion": "1.164.0.20190211-085949",
    "configurationVersions": [
      2
    ]
  },
  "id": "dynatrace.remote.python.elasticsearch:node.os.cpu_percent:node.os.cpu_percent.high_usage",
  "metricId": "dynatrace.remote.python.elasticsearch:node.os.cpu_percent",
  "name": "High OS CPU usage",
  "description": "The OS CPU usage is {alert_condition} the threshold of {threshold}",
  "aggregationType": "AVG",
  "eventType": "PERFORMANCE",
  "alertCondition": "ABOVE",
  "samples": 5,
  "violatingSamples": 3,
  "dealertingSamples": 5,
  "threshold": 70,
  "enabled": true,
  "tagFilters": []
}

Response code

200