With version 4.6.x of AppDynamics Application Performance Monitoring for VMware Tanzu tile is shipped with the AppDynamics extension buildpack, appdbuildpack, which can be used along with the standard buildpacks using the Cloud Foundry™ multiple buildpack workflow. The buildpack serves as a single point for AppDynamics support.

The Java buildpack does not support the multi-buildpack approach. Therefore,  AppDynamics support is implemented directly in the Java buildpack and the multi-buildpack approach is not used for Java applications.

Before You Begin

  • Cloud Foundry Command Line Interface (cf CLI) v6.38 or later is required to use multiple buildpacks. See Installing the cf CLI.
  • CloudFoundry Environment with AppDynamics Tile installed and configured with controller(s) information.
  • An application that you want to instrument. See, Sample Application.

You can also refer to the AppDynamics Application Performance Monitoring for VMware Tanzu documentation.

Sample Applications

You can find sample applications demonstrating the multi-buildpack approach in the GitHub repository.

AppDynamics Buildpack Workflow

The following workflow demonstrates the workflow for using AppDynamics BuildPack. This is used for instrumenting applications running in cloud foundry (cf) environments. 

This document contains references to the Cloud Foundry™ documentation. AppDynamics does not own any rights and assumes no responsibility for the accuracy or completeness of such third-party documentation.


  1. Install or upgrade AppDynamics Application Performance Monitoring for VMware Tanzu tile version v4.6.x or later. See Installing and Configuring AppDynamics.

    When the AppDynamics APM for VMware Tanzu tile is installed, a buildpack with the name appdbuildpack is displayed in your list of cf environment buildpacks:

    buildpacks

    $ cf buildpacks
    Getting buildpacks...
    
    buildpack                position          enabled   locked   filename                                             stack
    dotnet_core_buildpack           1          true      false    dotnet-core_buildpack-cached-cflinuxfs2-v2.2.0.zip
    hwc_buildpack                   2          true      false    hwc_buildpack-cached-windows2016-v3.0.2.zip          windows2016
    appdbuildpack                   25         true      false    appdynamics_buildpack-v4.5.513.zip
    BASH
  2. Verify if the appdynamics service is present in the environment along with the service plans created during the tile installation.

    buildpacks

    $ cf marketplace -s appdynamics
      service plan                   description                    free or paid
      pcf-appd                       pcf-appd                       free
      pcf-appd-test                  pcf-appd-test                  free
    BASH
  3. Create service instance with the following command (in this example, the service instance is appdynamics_service_instance):

    buildpacks

    $ cf create-service appdynamics pcf-appd appd
    BASH

    Non Tile Workflow

    For Cloud Foundry environments that do not support tiles, perform the following:

    1. Download AppDynamics Buildpack  from AppDynamics Application Performance Monitoring for VMware Tanzu and upload it to your environment using the cf create -buildpack  command.
    2. Create the user-provided service (for example, appdynamics_service_instance) as mentioned in AppDynamics Service Broker and Buildpacks - APM FAQs, then continue with step 4.
  4. Edit the application manifest.yml with the following details:
    See the Workflow Table for sample buildpacks.  
    1. In services section, bind to the AppDynamics service instance (in this example it is appdynamics_service_instance)
    2. In the buildpacks section, include the appdbuildpack and standard buildpack specific to the application framework or language  
    3. In the env section, set these environment variables:
      • APPD_AGENT to the type of the application you are instrumenting (in this example it is .NET Core application) 
      • (Optional) APPD_AGENT_HTTP_URL to download specific agent bits from an HTTP location
      • (Optional) APPD_CONF_HTTP_URL to download custom configuration files, corresponding to the AppDynamics agent, from an HTTP location

        manifest.yml

         cloudfoundry-apps/cf-NET-sample/ViewEnvironment (master)$ cat manifest.yml 
        ---
        applications:
        - name: cf-net-application-sample
          memory: 2G
          buildpacks:
            - appdbuildpack          # appdynamics buildpack (required) 
            - dotnet_core_buildpack  # language specific buildpack 
          services:
            - appdynamics_service_instance   # appdynamics service instance (required)
          env:
            APPD_AGENT: dotnetcore  # type of agent needed for instrumentation (required)
            APPD_AGENT_HTTP_URL: https://www.nuget.org/api/v2/package/AppDynamics.Agent.Distrib.Micro.Windows/4.5.7 # download url (optional)
            APPD_CONF_HTTP_URL: http://appdconf.apps.lawndale.cf-app.com/dotnetcore/1/  # url where configuration files are present (optional)
        BASH
  5. Push your application by using the cf CLI command

    cloudfoundry-apps/cf-NET-sample/ViewEnvironment (master)$ cf push
     
    CODE

AppDynamics Agent Values

LanguageStandard BuildPackAPPD_AGENT value
.NET Framework (Windows)hwc_buildpackdotnet
.NET Core (Linux)dotnet_core_buildpackdotnet-linux
.NET Core (Windows)binary_buildpackdotnet-windows
Pythonpython_buidpackpython
GoLanggo_buildpackgolang
NodeJSnodejs-buildpacknodejs

Downloading Agent Bits

AppDynamics Buildpack provides a way to download specific agent bits by fetching binaries from custom download URLs in addition to the default behavior of fetching agents from standard download points (such as appd dwnload server, pypi, nuget, and so on).

You can specify the  APPD_AGENT_HTTP_URL as the download URL that is hosting AppDynamics Agent.

Custom Configuration

AppDynamics Buildpack also provides a way to override basic configuration or add custom configuration files to the agent. The buildpack can fetch the configuration either locally or remotely. The buildpack fetches files with the same names that is used for a specific agent. To fetch remotely from a custom download point,  host the configuration files corresponding to the agent on a HTTP server under a url and set APPD_AGENT_HTTP_URL to that url

Workflow Table

The following table describes the language/framework specific settings that can be applied while pushing the applications with appdbuildpack.

The column descriptions are as following:

  • APPD_AGENT Value: Value of the APPD_AGENT environment variable that needs to be set while pushing the application with appdbuildpack.
  • Configuration File Names:  This list represents the names of files that will be picked by appdbuildpack when hosted locally or remotely.
    • When hosted remotely, these files should be present under URL specified by  APPD_CONF_HTTP_URL.
    • When hosted locally, the files should be present under appdynamics/conf folder, which is next to application bits.
  • Sample Manifest: An example buildpack to push an application with all the settings with appdbuildpack for instrumentation


Here, we have used appdynamics_service_instance as the service instance, which is created before running the command from service broker appdynamics service  or user-provided service (https://docs.pivotal.io/partners/appdynamics/faqs.html#s2). 

Language 

APPD_AGENT ValueAllowed Custom Configuration File NamesSample Manifest
DotNetCore (Linux)dotnetcore
  • AppDynamicsConfig.json
  • AppDynamicsAgentLog.json


edit manifest.yml

cloudfoundry-apps/cf-NET-sample/ViewEnvironment (master)$ cat manifest.yml 
---
applications:
- name: cf-net-core
  memory: 2G
  buildpacks:
    - appdbuildpack          
    - dotnet_core_buildpack
  services:
    - appdynamics_service_instance   
  env:
    APPD_AGENT: dotnetcore  
    APPD_AGENT_HTTP_URL: <optional>
    APPD_CONF_HTTP_URL: <optional>

BASH
DotNet (HWC)dotnet
  • AppDynamicsConfig.json
  • AppDynamicsAgentLog.json

edit manifest.yml

cloudfoundry-apps/cf-NET-sample/ViewEnvironment (master)$ cat manifest.yml 
---
applications:
- name: cf-net
  memory: 2G
  buildpacks:
    - appdbuildpack
    - hwc_buildpack 
  services:
    - appdynamics_service_instance   # appdynamics service instance (required)
  env:
    APPD_AGENT: dotnet
    APPD_AGENT_HTTP_URL: <optional>
    APPD_CONF_HTTP_URL: <optional>
    
BASH


Pythonpython
  • appdynamics.cfg

edit manifest.yml

cloudfoundry-apps/cf-NET-sample/ViewEnvironment (master)$ cat manifest.yml 
---
applications:
- name: cf-python
  memory: 2G
  buildpacks:
    - appdbuildpack          # appdynamics buildpack (required) 
    - python_buildpack  # language specific buildpack 
  services:
    - appdynamics_service_instance   # appdynamics service instance (required)
  env:
    APPD_AGENT: python  # type of agent needed for instrumentation (required)
    APPD_AGENT_HTTP_URL: <optional>
    APPD_CONF_HTTP_URL: <optional>

BASH


GoLanggolangN/A because it is an SDK 

edit manifest.yml

cloudfoundry-apps/cf-NET-sample/ViewEnvironment (master)$ cat manifest.yml 
---
applications:
- name: cf-net-application-sample
  memory: 2G
  buildpacks:
    - appdbuildpack
    - go_buildpack  # language specific buildpack 
  services:
    - appdynamics_service_instance   # appdynamics service instance (required)
  env:
    APPD_AGENT: golang
    APPD_AGENT_HTTP_URL: <optional>
    APPD_CONF_HTTP_URL: <optional>
BASH



Third party names, logos, marks, and general references used in these materials are the property of their respective owners or their affiliates in the United States and/or other countries. Inclusion of such references are for informational purposes only and are not intended to promote or otherwise suggest a relationship between AppDynamics and the third party.