Download PDF
Download page Predefined Variables.
Predefined Variables
This page describes the predefined variables that can be used in an HTTP request action. The value of the variable is substituted at the run-time in the context of the triggering events when the actual request is sent.
Form Variable Names
To form a predefined variable name, combine the eventList
array with a top level object and a corresponding context field or multiple nested context fields. You can also use the top level object only to fetch any information.
- All the variables are accessed through the
eventList
array. - The
eventList
array contains a single event for a health rule violation or an anomaly.
For example:
- To get the ID of a health rule violation event, use
${eventList[0].event_id}
- To get the name of the violating conditions of a health rule, use
${eventList[0].event_details.condition_details[0].name}
- To get the details of the child entity type in a health rollup, use
${eventList[0].event_details.rollup_details.child_entities[0].child_entity_type}
- To get the metric value that triggered the health rule violation, use
${eventList[0].event_details.condition_details[0].triggering_value}
- To get the metric type that cause the anomaly, use
${eventList[0].anomaly_type}
- To get the summary of the top object on which anomaly is detected, use
${eventList[0].rca_result.top_impact_object}
- To get the value of an attribute of an entity, use
${entityAttrList[0].<attribute_name>}
The following tables provide top level object and various context field details:
Context Attributes
The following table provides a list of top level objects and corresponding details:
Top Level Object | Description | Event Type | Field Type | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
entity_id | Identifies the entity on which violation is detected. |
| string | ||||||||||||
entity_type | Indicates the type of the entity on which violation is detected. The format is For example, |
| string | ||||||||||||
event_id | Identifies the event. |
| string | ||||||||||||
event_type | Indicates the display name of different violation types. For example, VIOLATION_STARTED_WARNING , VIOLATION_STARTED_CRITICAL . |
| string | ||||||||||||
| Identifies the violation incident. |
| string | ||||||||||||
| Indicates the timestamp of the violation incident. You can display the timestamp in date and time format, epoch format, or a valid custom format. Use the following expression in the HTTP payload to display
|
| long | ||||||||||||
| Indicates the start time of the violation incident. You can display the timestamp in date and time format, epoch format, or a valid custom format. Use the following expression in the HTTP payload to display
|
| long | ||||||||||||
| Indicates the end time of the violation incident. You can display the timestamp in date and time format, epoch format, or a valid custom format. Use the following expression in the HTTP payload to display
|
| long | ||||||||||||
violation_duration | Indicates the duration of violation incident. It is the difference between the current time and the start time of the incident. |
| long | ||||||||||||
violation_severity | Indicates the severity of violation such as critical or warning. |
| string | ||||||||||||
violation_status | Indicates whether the violation incident is open or close. |
| string | ||||||||||||
violation_type | Indicates the type of MELT event for health rule or anomaly detection. For example,
|
| string | ||||||||||||
| Identifies the health rule or the Anomaly Detection configuration. |
| string | ||||||||||||
| Indicates the display name for the health rule or the Anomaly Detection configuration. |
| string | ||||||||||||
event_details | Indicates the details of the violation based on a health rule. |
|
| ||||||||||||
model_sensitivity | Indicates the alert sensitivity levels of the anomaly detection model. These are the sensitivity levels:
|
| string | ||||||||||||
anomaly_type | Indicates the metric type that causes the anomaly. For example, Errors per minute (EPM) and Average Response time (ART). |
| string | ||||||||||||
rca_result | Indicates result of the root cause analysis performed by the Anomaly Detection algorithm. |
| object | ||||||||||||
| Provides direct navigation to the entity page in your application for a health rule violation. Therefore, you can view the context of the entity at the time of the violation. You need to append the For example, |
| string |
The following table provides a list of second level context fields and corresponding details for the rca_result
variable:
Second Level Context Fields - | Description | Event Type | Field Type |
---|---|---|---|
top_impact_object | Indicates the deviating metrics and summary information of top-impacted object on which anomaly is generated. |
| object |
| Indicates the deviating metrics and summary information of the root cause objects. |
| array |
list_of_suspected_cause_paths | Indicates the path of the suspected cause of the anomaly. |
| array |
The following table provides a list of second level context fields and corresponding details for the event_details
variable:
Second Level Context Fields - | Description | Event Type | Field Type |
---|---|---|---|
condition_details | Indicates the details of health rule violation. The details are available only for metric condition. |
| array of |
| Indicates the details of the rollup entities for the health rule violation. |
| complex object |
The following table provides a list of third level context fields and corresponding details for the rollup_details
variable:
Third Level Context Fields - | Description | Event Type | Field Type |
---|---|---|---|
child_entities | Identifies the correlated incident and child entity. |
| array of |
violation_count | Indicates the count of the violating child entities. |
| long |
The following table provides a list of fourth level context fields and corresponding details for the condition_details
variable:
Fourth Level Context Fields - | Description | Event Type | Field Type |
---|---|---|---|
name | Indicates the display name of the condition. |
| string |
data_points | Indicates the number of data points used to evaluate the condition. |
| string |
eval_win_size | Indicates the health rule evaluation time frame over which the data used to evaluate the health rule is collected. |
| string |
result | Indicates the status of the condition evaluation. It returns true (1), false (0), or unknown (-1). |
| integer |
baseline_mean | Indicates the difference between the baseline and the mean value. |
| double |
baseline_std_dev | Indicates the difference between the baseline and the standard deviation. |
| double |
violation_count | Indicates the number of condition violations during the evaluation time frame. |
| string |
missing_data | Indicates the number of missing data points in the evaluation time frame. |
| string |
expression | Indicates the mathematical expression used to evaluate the metric performance. |
| string |
expression_value | Indicates the value present in the left side of the expression. |
| string |
threshold_value | Indicates the value present in the right side of the expression. |
| string |
threshold_type | Indicates the type of threshold (static or baseline). |
| string |
| Indicates the exact value of the metric that triggered the violation |
| double |
The following table provides a list of fourth level context fields and corresponding details for the rollup_result_details
variable:
Fourth Level Context Fields - | Description | Event Type | Field Type |
---|---|---|---|
child_entity_id | Identifies the evaluation child entity. |
| string |
child_entity_type | Indicates the evaluation child entity type name with namespace. |
| string |
correlated_violation_id | Indicates the violation ID of the child entity that caused the rollup rule violation. |
| string |
Attribute Value of an Entity
To get the value of an attribute of an entity, use ${entityAttrList[0].<attribute_name>}
.
You can get the values of only the attributes with names that contain dot (.), underscore (_), alphabets, and digits. If any attributes have colon ( : ) and hyphen ( - ) in their names, the value can not be fetched. For example, healthrule:0d3019af-6f5d-4d64-966d-e865836885fa
.
For example:
- To get the value of attribute k8s_pod_name, use
${entityAttrList[0].k8s_pod_name}
. - To get the value of the attribute
service.name
, use${entityAttrList[0].service_name}
.
- If the value of an attribute is dynamic, for example,
health.status
, you will not get the latest value of the attribute. - You can use the Query Builder to fetch the attribute names of your entities.
- If any attributes have dot ( . ) in their names, replace the dots (.) with underscore (_). For example, use
service_name
for the attributeservice.name.
Samples
HTTP request examples for the most recent triggering events:
Slack Event Sample
URL:
In your Slack app, you get the Incoming Webhook that looks like the following URL:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
Payload:
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*New ${eventList[0].violation_severity} Alert from AppDynamics Cloud:* ${eventList[0].config_name}\n"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Entity Type:*\n${eventList[0].entity_type}"
},
{
"type": "mrkdwn",
"text": "*When:*\n${eventList[0].event_time}"
},
{
"type": "mrkdwn",
"text": "*Entity Id:*\n${eventList[0].entity_id}"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Violating Conditions*\n"
}
},
#if(${eventList[0].event_details})
#foreach( $condition in ${eventList[0].event_details.condition_details} )
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "\n${condition.expression}"
}
},
#end
#end
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"emoji": true,
"text": "Check in AppD Cloud"
},
"style": "danger",
"value": "click_me_123",
"url": "https://your-appd-cloud-url.com${eventList[0].entity_context_path}"
}
]
},
{
"type": "divider"
}
]
}
- If you are unable to fetch a variable, include the variable within the
if
condition. For information about theif
condition, see the Apache Velocity documentation. - For information on how to configure incoming webhooks in Slack, see the Slack documentation.
PagerDuty Events API V2 Sample
URL:
https://events.pagerduty.com/v2/enqueue
Payload:
{
"payload": {
"summary": "${eventList[0].event_type} on ${eventList[0].config_name}",
"source": "AppDynamics Cloud",
"severity": "${eventList[0].violation_severity.toLowerCase()}",
"component": "${eventList[0].entity_type}",
"custom_details": {
"Event Name": "${eventList[0].event_type}",
"Event ID": "${eventList[0].event_id}",
"Entity Type": "${eventList[0].entity_type}",
"Event Time": "${eventList[0].event_time}",
"Entity ID": "${eventList[0].entity_id}"
}
},
"routing_key": "<your integration key>",
"dedup_key": "${eventList[0].violation_id}",
"event_action": "trigger",
"client": "AppDynamics Cloud",
"client_url": "https://your-appd-cloud-url.com${eventList[0].entity_context_path}"
}
The integration key (routing key) is available on the PagerDuty Events API V2 integration page.
For information on how to send an event to PagerDuty, see the PagerDuty documentation.
ServiceNow Event Sample
URL:
https://<instance_name>.service-now.com/api/global/em/jsonv2
Authentication:
Use the Basic authentication option and enter your username and password.
Payload:
{
"records": [
{
"source": "AppDynamics Cloud",
"event_class": "your-controller",
"resource": "${eventList[0].entity_id}",
"node": "${eventList[0].entity_id}",
"metric_name": "${eventList[0].config_name}",
"type": "${eventList[0].event_type}",
"message_key": "${eventList[0].violation_id}",
"description": "*New ${eventList[0].violation_severity} Alert from AppDynamics Cloud:* ${eventList[0].config_name}. Check https://your-appd-cloud-url.com${eventList[0].entity_context_path}",
#if( ${eventList[0].violation_severity} == "CRITICAL" )
"severity": "1"
#elseif( ${eventList[0].violation_severity} == "WARNING" )
"severity": "2"
#else
"severity": "0"
#end
}
]
}
For information on how to send an event to ServiceNow, see the ServiceNow documentation.
OpsGenie Event Sample
URL:
https://api.opsgenie.com/v2/alerts
Custom Headers:
- Key: Authorization
- Value: GenieKey <your_API_key>
Payload:
{
"source": "AppDynamics Cloud",
"message": "${eventList[0].event_type} on ${eventList[0].config_name}",
"alias": "${eventList[0].violation_id}",
"description": "${eventList[0].event_type} on ${eventList[0].config_name}",
"entity": "${eventList[0].entity_type}:${eventList[0].entity_id}",
#if( ${eventList[0].violation_severity} == "CRITICAL" )
"priority": "P1",
#elseif( ${eventList[0].violation_severity} == "WARNING" )
"priority": "P3",
#else
"priority": "P5",
#end
"details": {
"Event Name": "${eventList[0].event_type}",
"Event ID": "${eventList[0].event_id}",
"Entity Type": "${eventList[0].entity_type}",
"Event Time": "${eventList[0].event_time}",
"Entity ID": "${eventList[0].entity_id}",
"Link": "https://your-appd-cloud-url.com${eventList[0].entity_context_path}"
}
}
For information on how to create alerts in OpsGenie, see the OpsGenie documentation.
Webex
URL:
https://webexapis.com/v1/webhooks/incoming/<incoming_webhook_url>
Payload:
{"markdown": " \n- - - \n**${eventList[0].violation_severity}** Alert from Cisco CNAO: **${eventList[0].config_name}** \n- - - \n**Details** \n _Event Type:_ ${eventList[0].event_type} \n_Entity Type:_ ${eventList[0].entity_type} \n_Entity Id:_ ${eventList[0].entity_id} \n_Event Time:_ ${eventList[0].event_time}\n**Violation Details** #if(${eventList[0].event_details}) #foreach( $condition in ${eventList[0].event_details.condition_details} ) \n$esc.java(${condition.expression}) #end #end \n_Link:_[Click here](${appdURL}${eventList[0].entity_context_path})\n- - - \n" }
- If you are unable to fetch a variable, include the variable within the
if
condition. For information about theif
condition, see the Apache Velocity documentation. - For information on how to configure incoming webhooks in Webex, see the Webex documentation.