You are viewing the Apigee Management API reference documentation. For the main product docs, and to search all docs, go to https://docs.apigee.com. For cross-site search, click Search all in the search results.

Create Alert

Resource Summary

Security

Content Type

application/json, text/plain

Category

CreateAlert

POST

Create Alert

Create an alert.

 

For more information and examples of this API, see Managing alerts and notifications using the API.

 

The example below in the Request Body shows the JSON payload for this API. The following sections describe this payload in more detail:

Alerts JSON

Property Type Description
organization string Organization name.
environment string Environment name.
name string, maximum length=20 Alert name.
enabled boolean, default=true If true, this alert is triggered when conditions are met, and any configured notifications are sent.
description string Alert description.
playbook string A message for consumers of this alert that contains instructions and links for how to resolve the cause.
conditions array, minLength=1, maxLength=5 An array of conditions that must all be satisfied for this alert to trigger. See the Conditions table below.
notifications string, minimum length=0 An array of notification endpoints that the alert is sent to when triggered. Notifications fire repeatedly, at most throttleIntervalSeconds apart, while triggered. For example:
"notifications": [ 
 {
  "channel": "email", 
  "destination": "user@example.com" 
 }
]
Where:
  • channel - A string specifying the channel on which to notify as:
    • email
    • pagerduty
    • slack
    • webhook
  • destination - A string specifying the destination to which the notification is sent based on the value of channel.
reportEnabled boolean, default=true If true, a custom report is created based on alert condition.
throttleIntervalSeconds integer The minimum amount of time, in seconds, between repeated notifications for a triggered alert.

Conditions JSON

Property Type Description
description string, maximum length=1000 Alert condition description.
dimensions object An object of key-value pairs that identify the metric resources. For example, an environment, proxy, or a set of targets in a proxy. See the dimensions table below.
metric number Metric monitored for the resources specified by dimension. Possible value:
  • rate
  • count
  • tps
  • totalLatency
  • targetLatency
threshold number Threshold value that is compared against the metric value using comparator to determine if this condition is met. For rate metric, this value is in the range 0-1.
durationSeconds number Duration, in seconds, for which the metric value must continuously match the threshold value using the comparator operator to determine if this condition is met. For example, given the following parameters:
{ 
 "durationSeconds": 30, 
 "threshold": 0.015,
 "comparator":
 ">=" 
} 

The condition is met when the metric is greater than or equal to 0.015 for 30 seconds, and not below that value at any time within that duration.

comparator string Operator that is used to compare the metric value against the threshold value to determine if this condition is met. Possible values:
  • > or gt (greater than)
  • < or lt (less than)
  • >= or gte (greater than or equal to)
  • <= or lte (less than or equal to)
  • == (equal to)

Dimensions JSON

Key Value
env Environment name.
proxy Proxy name, or the special value ANY or ALL, to monitor any proxy in the environment.
target Target name, or the special value ANY or ALL, to monitor any target in the proxy.
developerApp Developer app name, or the special value ANY, to monitor any developer app in the environment.
collection Collection ID, to monitor collection of targets or proxy.
statusCode Status code, such as 5xx, 4xx, 404, 2xx on whose rate or count if violated the alert should be fired. Not valid for latency alerts.
percentile Percentile (50, 90, 95, 99) of the latency value that, if violated, the alert is fired.
faultCodeCategory Fault code category. Valid in conjunction with faultCodeSubCategory. Not valid if statusCode is present. Not valid for latency alerts.
faultCodeSubCategory Fault code subcategory. Can only be specified if you specify a value to faultCodeCategory. Specify a specific subcategory, ALL, or ANY. ALL specifies that all subcategories must have been violated for the alert to trigger. ANY specifies to trigger the alert if any subcategory fault has been violated.
faultCodeName

Fault code name. Can only be specified if you specify a value to faultCodeSubCategory. Specify a specific name, ALL, or ANY. You can only specify a name if you specified an explicit subcategory to faultCodeSubCategory. That is, faultCodeSubCategory cannot be set to ALL or ANY.

ALL specifies that all fault code names must have been violated for the alert to trigger. ANY specifies to trigger the alert if any fault code name has been violated.

 

Resource URL

https://apimonitoring.enterprise.apigee.com /alerts

Header Parameters

Name Values Description
Authorization
(required)

OAuth token. Replace $TOKEN with your access token. See Get the tokens.

Content-Type
(required)

Specify Content Type.

Request Body

HTTP Basic

OAuth 2.0

API Key

Reset

Make a request and see the response.

Make a request and see the response.

Make a request and see the response.

Working...

Help or comments?

  • If something's not working: Ask the Apigee Community or see Apigee Support.
  • If something's wrong with the docs: Click the "Send Feedback" button.
    (Incorrect? Unclear? Broken link? Typo?)