AppDynamics Application Intelligence Platform

3.9.x Documentation

PDFs

Learn by Watching

Doc Maps

Information points (aka "business metrics", "code metrics") are available in version 3.9 of the PHP Agent. The PHP Agent uses a different UI from the Java and .NET agents to configure information points. This UI provides a text field in which you paste the information point definition in JSON notation.

Configuring an Information Point

  1. Select your application.
  2. Click Analyze -> Information Points.
  3. Click Add (the + symbol).
  4. Enter a name for the information point.
  5. Select PHP as the agent type.
  6. In an editor, create the information point definition in JSON format. See Creating an Information Point Definition for the details on how to construct this definition.
  7. Copy and paste the JSON into the text field in the UI.
  8. Click Create Information Point at the bottom of the screen.

Creating an Information Point Definition

An information point definition contains the following objects:

An information point used for a business metric (to track some aspect of the performance of a business) requires that you create the metricDefinitions object described below.

An information point used for a code metric (to track how a method in your application code is performing) requires a methodMatch object to specify the method.

classMatch

The "classMatch" defines the class on which the information point is based. It contains a className, which you provide, and a type, which specifies how to match the className.

The class must be defined is a separate file from the file in which it is instantiated and invoked.

The only supported type for the PHP agent is MATCHES_CLASS.

This object is optional.

If you are accustomed to configuring information points in the AppDynamics UI for other agents, this is where the className and MATCHES_CLASS type appear in the UI:

JSON Example:

Creates an information point on a class for which the class name equals "CheckoutManager".

"classMatch": {
    "type": "MATCHES_CLASS",
    "className": "CheckoutManager"
 },

If your class names are defined in a namespace, you need to escape the backslashes in the namespace with an escape backslash. For example, if the full class name  is:

"Bundy\ShoesBundle\Entity\CheckoutManager"

configure the class name as

"classMatch": {
    "type": "MATCHES_CLASS",
    "className": "Bundy\\ShoesBundle\\Entity\\CheckoutManager"
 },"

methodMatch

The methodMatch defines the method on which the information point is based.

It contains a required methodName and an optional matchCondition expression.

This object is required.

If you are accustomed to configuring information points in the AppDynamics UI for other agents, this is where the methodName and matchConditions objects appear in the UI:

JSON Examples:

Creates an information point on a method named "process".

"methodMatch": {
        "methodName": "process",
         . . . 

If you are creating an information point to implement a simple code metric, for example to track how many times a method is called, the methodName object may be the only configuration you need. For example, the following code metric information point counts the number of calls to the method named "deleteCartItems".

"methodMatch": {
        "methodName": "deleteCartItems"
}

matchConditions

The matchConditions object is the part of the methodMatch that restricts the information point to invocations that match the configured matches conditions.

There can be multiple conditions inside the matchConditions object.

This object is optional. If it is not provided, the information point includes all invocations of the specified method.

A condition consists of:

  • an operation type used to compare the left and right sides of the match condition. Valid types are:
    • EQUALS
    • NOT_EQUALS
    • LT
    • GT
    • LE 
    • GE
    • NOT
    • AND
    • OR
  • a comparisonOp with expression nodes on the left side (lhs) and right side (rhs) of the operation
    An expression node contains
    • a type, which is ENTITY, STRING, or INTEGER
    • a value, which is an entityValue, stringValue, or integerValue

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.

JSON Example:

The information point matches only invocations of the process method in which parameter 1 equals  "VISA".

"methodMatch": {
        "methodName": "process",
        "matchCondition": {
          "type": "EQUALS",
          "comparisonOp": {
            "lhs": {
              "type": "ENTITY",
              "entityValue": {
                "type": "PARAMETER",
                "parameterIndex": 1
              }
            },
            "rhs": {
              "type": "STRING",
              "stringValue": "VISA"
            }
          }
        }

metricDefinitions

The metricDefinitions object contains one or more definitions of custom metrics.

A custom metric defines a special metric for the data captured by the information point. This metric appears in the Metric Browser and in the information point's dashboard. You can create health rules based on a custom metric and retrieve its value using the AppDynamics REST API, just like any other metric.

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.

Metric definitions are optional. If you do not configure a custom metric for an information point, the information point captures only the generic KPIs (response time, calls and calls per minute, errors an errors per minute) for the method. Custom metrics are typically configured for information points that are used as Business Metrics.

A metricDefinitions objects consists of one or more definitions, each having the following structure:

    • a name
    • a rollup type (AVERAGE or SUM)
    • data, which consists of a type, (ENTITY, STRING, or INTEGER) and a value (entityValue, stringValue, or integerValue)

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.

JSON Example:

This 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"
        }
      }
    }
    
  ]

Sample JSON Information Point Configuration

This is an example that could be copied and pasted into the JSON text field in the PHP information point window. It produces two metrics, named VisaTotal and VisaAverage.

{
  "probe": {
    "phpDefinition": {
      "classMatch": {
        "type": "MATCHES_CLASS",
        "className": "CheckoutManager"
      },
      "methodMatch": {
        "methodName": "process",
        "matchCondition": {
          "type": "EQUALS",
          "comparisonOp": {
            "lhs": {
              "type": "ENTITY",
              "entityValue": {
                "type": "PARAMETER",
                "parameterIndex": 1
              }
            },
            "rhs": {
              "type": "STRING",
              "stringValue": "VISA"
            }
          }
        }
      }
    }
  },
  "metricDefinitions": [
    {
      "name": "VisaTotal",
      "rollup": "SUM",
      "data": {
        "type" : "ENTITY",
        "entityValue": {
          "type": "RETURN_VALUE"
        }
      }
    },
    {
      "name": "VisaAverage",
      "rollup": "AVERAGE",
      "data": {
        "type" : "ENTITY",
        "entityValue": {
          "type": "RETURN_VALUE"
        }
      }
    }
    
  ]
}

Learn More