Metric Definitions
You can define custom metrics for data captured by an information point using the
metricDefinitions
object in your information point definition.
Custom metrics appear in the Metric Browser and in the dashboard for the information
point. You can create health rules based on a custom metric and retrieve custom metric
values using the AppDynamics REST API.
There can be multiple custom metrics for a single information point. For example, one metric might be based on the average and one on the accumulated (sum) of the information point's values.
A metricDefinitions
object consists of one or more definitions, each
having the following structure:
- a name
- a rollup type (
AVERAGE
orSUM
) - data, which consists of a type, (
ENTITY
,STRING
, orINTEGER
) and a value (entityValue
,stringValue
, orintegerValue
)
If the type is ENTITY
, the entityValue
has a type, which is
INVOKED_OBJECT
, RETURN_VALUE
, or
PARAMETER
. If the type of the entityValue
is
PARAMETER
, the zero-based parameterIndex
indicates
the parameter on which to base the match. A return value or parameter metric cannot be
an array.
For example, the following metricDefinitions
object defines two custom metrics:
VisaTotal
, which reports the sum of the Visa payments processed and
VisaAverage
, which reports the average value of the Visa payments
processed.
"metricDefinitions": [
{
"name": "VisaTotal",
"rollup": "SUM",
"data": {
"type" : "ENTITY",
"entityValue": {
"type": "RETURN_VALUE"
}
}
},
{
"name": "VisaAverage",
"rollup": "AVERAGE",
"data": {
"type" : "ENTITY",
"entityValue": {
"type": "RETURN_VALUE"
}
}
}
]