Installing and Configuring AppDynamics APM

This topic explains how to install and configure AppDynamics APM for Pivotal Cloud Foundry (PCF) through a PCF service broker. Service brokers allow Cloud Foundry applications to bind to and consume the services from the Apps Manager console or command line.

The AppDynamics Machine Agent extension is a separate application that can consume management metrics (exposed via JMX MBeans) and expose it on the AppDynamics management dashboard.

The Pivotal Cloud Foundry (PCF) tile for AppDynamics installs the AppDynamics Service Broker as an application, registers it as a Service Broker on Cloud Foundry, and exposes its service plans on the Marketplace. It also installs the Machine Agent Extension.

Components

Installing the AppDynamics Tile

  1. Download the product file from the AppDynamics Product page on the Pivotal Network.
  2. Log in to the PCF Operations Manager (Ops Manager).
  3. Click Import a Product and import the AppDynamics product file.

    Import product

  4. Select the AppDynamics Service Broker.

    Select appdynamics

  5. Click Add on the AppDynamics Service Broker tile to add this product to your staging area.

  6. Click the newly added tile to review any configurable options. For more information, see Configuring the AppDynamics Tile.

    Configure appdynamics

  7. Click Apply Changes to apply the configuration.

Configuring the AppDynamics Tile

  1. From the Ops Manager Installation Dashboard, click the AppDynamics Service Broker tile. Select

  2. Select Service Broker Application. Default

    1. Before creating Service Plans, you must collect the license keys from the AppDynamics Dashboard.
      1. Log in to your AppDynamics account and click the “Settings” gear icon in the upper right corner of the page.
        Settings
      2. Select License.
        License
      3. Record the details of the license access key and controller. Details
    2. Click Add on the far right of the Service Plan screen to create a new service plan.
    3. Enter the Account Name and Account Access Key from the license page along with controller binding credentials (ip, port, ssl-enabled). The plan name and plan description are user-defined.

      Create plan

    4. Optionally, create additional service plans for the same account key.

    5. Follow the instructions in the Configuring Database Monitoring topic to complete the database fields.

    6. Click Save to save the information for this plan.

  3. Select Machine Agent Extension.

    1. Ensure that the Pivotal Ops Metrics/JMX Bridge tile has been installed and JMX VM is running.

      Note: In PCF v1.7 and later, Pivotal Ops Metrics is renamed JMX Bridge.

    2. Ensure that the Collector instance is set to 1 in the Pivotal Elastic Runtime tile.
    3. Give a user-defined Application Name. This name should be unique across multiple PCF installations.
    4. Complete the AppDynamics Controller, Account Name, and Account Access Keys fields. Machine agent
    5. If you do not want to override the default configuration, select Disable. If you want to override the default configuration, select Enable and specify the metrics that you want to pull in from JMX Bridge in your Cloud Foundry config.yml file. Use this template to override the config YAML file. Overridejmx
    6. Fill in the JMX Bridge Server IP and Port (default: 44444). Jmx bridge
    7. Fill in the credentials to connect to the server. Select the JMX Authentication checkbox.
    8. The AppDynamics tile does not support communication with JMX Bridge over SSL. In the JMX Provider section of the JMX Bridge tile, clear the Enable SSL checkbox. Disabledjmxbridge
    9. Disable SSL in the AppDynamics tile. Disabledssl
    10. Save the changes.
  4. Select Analytics Agent. Follow the instructions in the Configuring Transaction Analytics topic to complete this section of the tile.

  5. Select Web Proxy Configuration. ProxyServerConfig

  6. To use a proxy server between your PCF instance and the AppDynamics Controller, select Enable and complete the following fields:

    • Web Proxy Host Name/IP: Enter the IP address or host name of the proxy server, for example 10.40.23.54 OR testproxyserver.com
    • Web Proxy Port: Enter the port number on which the proxy server listens.
    • HTTP Web Proxy Auth Enabled: If your proxy server requires authentication, select this checkbox and complete the following fields:
      • Web Proxy Username: Enter the username for authenticating with the proxy server. The default for no authentication _none_.
      • Web Proxy Password: Enter the password for authenticating with the proxy.
  7. Click Save.

  8. Apply your changes.

  9. For new applications, use the cf push command to deploy your application, using the appropriate language buildpack.

    • Java:
      $ cf push APPNAME -b  https://github.com/appdynamics/java-buildpack
      
    • PHP:
      $ cf push APPNAME -b  https://github.com/appdynamics/php-buildpack
      
  10. When finished configuring the AppDynamics tile, return to the Ops Manager Installation Dashboard and click Apply Changes.

  11. Log in to Apps Manager and navigate to the Services Marketplace.

    Marketplace

  12. View AppDynamics Service Plans.

    Plans

  13. Bind the AppDynamics Service to an Application.

    Bind

  14. In a terminal window, use the cf restage command to make the changes effective.

      $ cf restage APPNAME
    
  15. Confirm that your application node is reporting to the Controller by logging in to AppDynamics. Your application should appear in the Applications list or as a node in the Application Dashboard:

    Dashboard

  16. Select Top Business Transactions, Network Dashboard, and Transaction Snapshots to display other views of the AppDynamics Application Dashboard. Dashboard2 Dashboard3 Dashboard4

  17. To check PCF Ops Metrics, check for an application named AppDynamicsPCFOpsMetrics in the controller UI. The Application Dashboard for this application would be empty since it only reports metrics of PCF. To see the metrics, select Home > AppDynamicsPCFOpsMetrics > Metric Browser > Application Infrastructure Performance > MachineAgentTier > Custom Metrics > CF. This lists all underlying components of PCF such as CloudController and Router.

    View12.2.1

Configuration with HTTP Proxy

If the Cloud Foundry environment needs to use an HTTP(S) proxy for external outbound communication, the Service Broker itself does not need to know anything about the http proxy, as it just relays the license keys to the consumer apps. The consumer application should specify the http_proxy or https_proxy as an environment variable for the agent to communicate externally with non-java applications, and use JAVA_OPTS for Java applications.

  • Specify using http_proxy for the AppDynamics non-Java application agent to talk to its controller via the proxy.

    $ cf set-env APPNAME http_proxy ‘http://user:password@proxy-server.customer.com:8080'
    ...
    $ cf set-env APPNAME https_proxy ‘http://user:password@proxy-server.customer.com:8080'
    

  • Specify using JAVA_OPTS for the AppDynamics Java application agent to talk to its controller via the proxy.

    $ cf set-env APPNAME JAVA_OPTS "
    -D test.value=barbar
    -D appdynamics.http.proxyHost=proxy.customer.com
    -D appdynamics.http.proxyPort=8080 "
    

  • If a Java application also needs to talk through a proxy, provide standard Java http arguments.

    $ cf set-env APPNAME JAVA_OPTS "
    -D test.value=barbar -D appdynamics.http.proxyHost=proxy.customer.com
    -D appdynamics.http.proxyPort=8080  -D http.proxyHost=proxy.customer.com
    -D http.proxyPort=8080 -D https.proxyHost=proxy.customer.com
    -D https.proxyPort=8080  "
    

Whenever making changes to Cloud Foundry environment variables, you must restage your application(s) to make the changes effective.

  $ cf restage APPNAME

These environment variables can either be set individually per app, or via env variable groups to be set for all apps as part of staging, running environments, etc., using the cf CLI.

Environment Variable Groups

  • running-environment-variable-group, revg: Retrieve the contents of the running environment variable group
  • staging-environment-variable-group, sevg: Retrieve the contents of the staging environment variable group
  • set-staging-environment-variable-group, ssevg: Pass parameters as JSON to create a staging environment variable group
  • set-running-environment-variable-group, srevg: Pass parameters as JSON to create a running environment variable group

Use the JAVA_OPTS environment variable to specify AppDynamics Agent-specific environment variables in the Staging environment group so the Java Buildpack can use that and push it in the correct place. Specifying JAVA_OPTS in the Runtime environment variable group will not yield anything, as the buildpack will not know about it.

Example:

  $ cf ssevg '{ "JAVA_OPTS" : " -Dtest.value=barbar
  -Dappdynamics.http.proxyHost=proxy.customer.com
  -Dappdynamics.http.proxyPort=8080 -Dhttp.proxyHost=proxy.customer.com
  -Dhttp.proxyPort=8080 -Dhttps.proxyHost=proxy.customer.com
  -Dhttps.proxyPort=8080 -Dspring.profiles.active=dev ", "test_env_profile" :
  "Staging" }'

Machine Agent

If the machine agent does not expose any metrics in the AppDynamics dashboard:

  • Ensure the collector instance is running in Elastic Runtime tile.
  • Ensure the JMX Bridge tile is installed and verify the admin credentials, IP address, and port of the Metrics instance.
  • If a proxy exists, the machine agent might not be able to reach out. Add the following environment variable parameters to the “AppDynamicsPCFOpsMetrics” app in the AppDynamicsPCFOpsMetrics-related Org and Space:
  $ cf set-env AppDynamicsPCFOpsMetrics JAVA_OPTS "
  -Dappdynamics.http.proxyHost=proxy.customer.com
  -Dappdynamics.http.proxyPort=8080 -Dhttp.proxyHost=proxy.customer.com
  -Dhttp.proxyPort=8080 -Dhttps.proxyHost=proxy.customer.com
  -Dhttps.proxyPort=8080
  -Dextension.pcf.jmx.serviceURL=service:jmx:rmi:///jndi/rmi://10.x.y.z:44444/jmxrmi
  -Dextension.pcf.jmx.username=admin
  -Dextension.pcf.jmx.password=OpsMetricsAdminPassword
  -Dappdynamics.agent.maxMetrics=5000
  -Dlog4j.configuration=file:/home/vcap/app/conf/logging/log4j.xml
  -DanyAdditionalParameter=Value"

Edit the above values as needed for IP addresses, passwords, proxy host, and port.

Further Reference

For more information, see the following:

Was this helpful?
What can we do to improve?
Create a pull request or raise an issue on the source for this page in GitHub