How do I create or update a plugin or custom event threshold?

The Thresholds REST endpoints enable 3rd party tools to manage all configured plugin and custom event thresholds within a monitored environment.

The following HTTP PUT request either creates or updates a custom event threshold with the identifier mytechnology.performance.myeventtype:

https://{id}.live.dynatrace.com/api/v1/thresholds/mytechnology.performance.myeventtype

Payload

{
    "timeseriesId": "custom:raspberry.files.count",
    "threshold": 3,
    "alertCondition": "ABOVE",
    "samples": 1,
    "violatingSamples": 1,
    "dealertingSamples": 1,
    "eventType": "ERROR_EVENT",
    "eventName": "Motion detected",
    "description": "Oh we dicovered some motion of {severity} that is {alert_condition} the threshold of {threshold}"
}

The threshold definition payload must contain the following attributes:

  • timeseriesId: Unique identifier of the metric that this threshold applies to. You can find the metric IDs within our timeseries export API.
  • threshold: The actual threshold that should be checked.
  • alertCondition: Alert if actual metric value is either ABOVE or BELOW the defined threshold.
  • samples: Number of minute samples that defines the sliding window.
  • violatingSamples: Number of minute-long sliding window samples that have to be violated within the sliding window before the event is raised.
  • dealertingSamples: Number of minute-long samples that have to return to normal before the event is closed again.
  • eventType: Semantic event type which can be either 'ERROR_EVENT', 'PERFORMANCE_EVENT', 'AVAILABILITY_EVENT'.
  • eventName: The human-readable name of the event.
  • filter: Shows the source of the threshold that can either be API or a PLUGIN.
  • description: A placeholder-filled, human-readable description of the event. Placeholder are: {severity} representing the actual metric value, {alert_condition} represents the above or below condition and the threshold {threshold}.

Result

  • HTTP 201: If threshold was successfully created, returns the complete threshold definition as JSON.
  • HTTP 400: If anything within your threshold config JSON is misplaced or missing. Refer to the return message to see details of what went wrong.