Introducing the AppDynamics Service Broker Tile for Pivotal Cloud Foundry

As customers and partners are making the transition of their applications from monoliths to microservices using Platform as a Service (PaaS) providers such as Pivotal Cloud Foundry (PCF), AppDynamics has made a significant investment in providing first-class integrations with such providers. Pivotal Cloud Foundry helps enterprises make the transition to cloud native enterprise with a complete platform for delivering software rapidly, consistently and reliably at scale.

PCF continues to be amongst the fastest growing open source PaaS platform ever (launched in 2014). It uses a flexible approach called language buildpacks to dynamically assemble and configure a complete runtime environment for executing a particular class of applications. Once an application is deployed into PCF, it automatically supports vertical and horizontal application tier scaling. AppDynamics has been a pioneer member of the Cloud Foundry Foundation since it’s inception in 2014.

Here’s an overview of the Pivotal Cloud Foundry architecture:

The AppDynamics PCF Service Broker Tile

We have now added a new AppDynamics Service Broker PCF Product tile. This tile automates the BOSH deployment and configuration of AppDynamics agents and controller for PCF applications. Cloud Foundry BOSH is an open source tool chain for release engineering, deployment and lifecycle management of large scale distributed services.

This tile is available on the Pivotal Network: https://network.pivotal.io/products/p-appdynamics

Workflow

The overall workflow for using the AppDynamics Service Broker tile is shown below:

Step 1: Import the AppDynamics Service Broker Tile into the PCF Ops Manager

Step 2: Configure the AppDynamics Service Broker Tile in PCF Ops Manager and create Service Plans

From the Service Broker Application tab, one or more service plans can then be added. Each service plan will correspond to a pre-provisioned AppDynamics license, that was either purchased or obtained on a trial basis.

Application administrators/managers or Application developers who are the users PCF to build and manage their applications will find these service plans listed in Services Marketplace in Apps Manager.

Next, the Machine Agent Extension for PCF OPS Metrics tab can be configured as shown below:

Step 3: Deploy application using the appropriate language buildpack using “cf push” CLI.

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

Then create a AppDynamics Service instance either using the CLI or in PCF Apps Manager Services Marketplace using a Service Plan and bind that instance to a PCF Application by re-deploying it using “cf restage” CLI.

Using CF CLI:

$ cf marketplace -s appdynamics
Getting service plan information for service appdynamics as admin…
OK

service plan       description                                 free or paid
Gold                   Service Plan for Gold                   free
Demo-Staging   Service Plan for Demo-Staging   free
Demo1               Service Plan for Demo1               free

$ cf create-service appdynamics Demo-Staging adsvc

$  cf bind-service APPNAME adsvc

Using PCF Apps Manager

This can also be achieved by using the PCF Apps Manager UI as shown below. After deploying application on Pivotal, to bind an application to a service, either select already existing service or click on Add from Marketplace.

Once the service instance is bound to your application, you can then redeploy it using the CLI ‘cf restage’ as shown below:

$  cf restage APPNAME

Once this is done, you should be able to start monitoring the PCF application on the AppDynamics controller. As an example, we used the spring-music application and by following the above steps, we were able to see the following application dashboard in the AppDynamics Controller:

For more detailed instructions on getting started, configure the PCF and monitor applications deployed in the PCF environment, please visit: http://docs.pivotal.io/appdynamics/index.html

Monitoring the PCF infrastructure

In addition, PCF administrators can monitor PCF Ops Metrics using AppDynamics Machine agent by configuring the controller tab and adding the JMX details.

To check PCF Ops metrics, check for an application named AppDynamicsPCFOpsMetrics in the controller UI. 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 the DEA, Cloud Controller, Router, etc.

view12.2.1.png

Alternatively, a subset of these PCF infrastructure metrics can be plotted on a Custom Dashboard such as the one shown below:

If you’re already using Pivotal Cloud Foundry but are new to AppDynamics, here’s where you can sign-up for a free trial: https://portal.appdynamics.com/account/signup/signupForm/

Getting Started with Pivotal Cloud Foundry and AppDynamics

This post originally appeared on Pivotal’s blog

The primary objective of a platform should be to provide a high-level of automation. This provides easy management of applications and services, while delivering consistent and error-free deployment of applications. While this high level automation provides a critical foundation, additional specialized services can be added to increase manageability of the applications deployed on the platform. To assist operators in this pursuit the Pivotal Cloud Foundry platform provides a number of integrated services out-of-the-box, including AppDynamics, New Relic, and CloudBees Jenkins. This blog will focus on the “out-of-the-box” integration between Pivotal Cloud Foundry and AppDynamics.

Pivotal Cloud Foundry Buildpacks and Agent Integration

A buildpack in Pivotal Cloud Foundry provides the framework and runtime support for your application. As applications are deployed or “pushed”, the platform detects the language and includes the appropriate versions of the runtime, as well as any additional application infrastructure. The buildpack also contains the AppDynamics agent, with numerous versions to support different deployments. To successfully deploy the agent we need to provide the proper configuration based on the environment during the deployment.

To create the proper configuration a User Provided Service (UPS) is created. A UPS is an external service created for an organization and space and is bound to an application in Pivotal Cloud Foundry. Once the service is bound to the application and the application is restaged, a process to prepare an application for deployment, the AppDynamics agent has the proper configuration to register with the AppDynamics controller and to transmit metrics to the designated endpoint.

A common practice in AppDynamics is to create a logical model representing different layers of an application. AppDynamics uses the application name, tier name and node name to align the deployed applications with the AppDynamics logical model. The Pivotal Cloud Foundry platform, specifically the buildpacks and UPS, provide the mechanism to align deployed applications to the logical model.

The diagram below depicts the Spring Trader application deployed on Pivotal Cloud Foundry. Spring Trader includes three Spring-based applications that are designed to represent a simple trading platform. The deployment artifacts include a web UI component written in Spring MVC, a RESTful API component that provides portfolio and trade data via a persistent store and RabbitMQ, and an asynchronous service for quote generation. Each of these applications are deployed into their own container, and each have their own UPS to define a tier within AppDynamics. This deployment aligns the applications to the AppDynamics logical model using the application and tier name.

image04

To establish a deeper understanding let’s walk through the process and commands required to create the user-provided service and applications on Pivotal Cloud Foundry.

Configure and Push Applications onto Pivotal Cloud Foundry

Before we can “cf push” the application, we need to create a user-provided service in the organization and space where we deploy our applications. In the example below, we use the Cloud Foundry CLI to create the user-provided service providing the required information in name/value format. Notice the application and tier name are configured, and we have created three different user-provided services to represent different tiers in our application.

cf cups app-dynamics-ST-web -p '{"account-name":"myacct","account-access-key":"key","host-name":"myacct.saas.appdynamics.com ","port":"80","tier-name":"web","application-name":"SpringTrader"}'

cf cups app-dynamics-ST-rest -p '{"account-name":"myacct","account-access-key":"key","host-name":"myacct.saas.appdynamics.com ","port":"80","tier-name":"rest","application-name":"SpringTrader"}'

cf cups app-dynamics-ST-asynch -p '{"account-name":"myacct","account-access-key":"key","host-name":"myacct.saas.appdynamics.com ","port":"80","tier-name":"asynch","application-name":"SpringTrader"}'

With our services defined, let’s deploy the Spring Trader application. Using the command line, issue the following commands:

## Create required managed services for deployment
cf create-service p-rabbitmq standard tradermessaging
cf create-service p-mysql 100mb-dev tradersql

## Deploying Rest component, binding services and restaging application
### Note the -b option to use the latest Java buildpack from github.com/cloudfoundry/java-buildpack
cf push -p dist/spring-nanotrader-services-1.0.1.BUILD-SNAPSHOT.war -b https://github.com/cloudfoundry/java-buildpack.git --no-start stfront
### Binds Services
cf bind-service stfront tradersql
cf bind-service stfront tradermessaging
cf bind-service stfront app-dynamics-ST-rest
### Specify which JVM version to use in the Java Buildpack
cf set-env stfront JBP_CONFIG_OPEN_JDK_JRE '[version: 1.7.0_+]'
### Specify which AppDynamics agent to use in the Java Buildpack
cf set-env stfront JBP_CONFIG_APP_DYNAMICS_AGENT '[version: 4.0.1_+]'
cf restage stfront.

## Deploying Web UI component, binding services and restaging application.
cf push -p dist/spring-nanotrader-web-1.0.1.BUILD-SNAPSHOT.war -b https://github.com/cloudfoundry/java-buildpack.git --no-start stweb
### Bind services
cf bind-service stweb app-dynamics-ST-web
cf set-env stweb JBP_CONFIG_OPEN_JDK_JRE '[version: 1.7.0_+]'
cf restage stweb

## Deploying the asynch service component, binding services and restaging application.
cf push -p dist/spring-nanotrader-asynch-services-1.0.1.BUILD-SNAPSHOT.war -b https://github.com/cloudfoundry/java-buildpack.git --no-start stback
### Bind services
cf bind-service stback stsql
cf bind-service stback tradermessaging
cf bind-service stback app-dynamics-ST-asynch
cf set-env stback JBP_CONFIG_OPEN_JDK_JRE '[version: 1.7.0_+]'
cf restage stback

As the “cf restage” command is executed the output will show which pieces are required to create the application and prepare it for the container. In the example below, you’ll see the AppDynamics agent is added to the container along with OpenJDK and the Tomcat server. If the AppDynamics agent is not included, verify the user-provider service is properly configured and its bound to the application.

image05

Once the commands are complete you should see the applications deployed in Pivotal Cloud Foundry Apps Manager. You should also see the user-provided services, with an application bound to each service. A number of applications can be bound to the user-provided service, but in our example its one per service.

image01

image08

We’ve successfully deployed our applications and bound AppDynamics services to each application instance. Let’s review the AppDynamics dashboard to understand how our application maps to the AppDynamics logical model.

The AppDynamics Model and Dashboards

In the home dashboard below you’ll notice the Spring Trader application. This application is made up of three independent applications in Pivotal Cloud Foundry.

image00

If we click into the Spring Trader application, we’ll see the app servers and you’ll notice how each application instance uses the tier name to represent different layers of the Spring Trader application. In our example we have the web, rest and asynch tiers. If you expand each tier you’ll see the node names, in this case node name is “0” for the first instance of the application. Node names are configurable, but I prefer to use the default node names as they align with the Pivotal Cloud Foundry application instance sequence number. As we scale different tiers to support new workloads, the new application instances will register with the AppDynamics controller, each with a sequential node name.

image02

By supporting the logical model in Pivotal Cloud Foundry, we can use the application dashboard to review transactions across the different applications.

image06

Troubleshooting AppDynamics Agents in Pivotal Cloud Foundry

During my initial installation, I had misconfigured the user-provided service which prevented the agent from registering with the AppDynamics controller. As a result, I needed to troubleshoot the agent configuration and review its logs. The good news is Pivotal Cloud Foundry makes this extremely easy. To access the agent logs, or any other buildpack information, just issue a “cf files stfront” command similar to the image below replacing “stfront” with your application name.

image07

The logs are located on app/.java-buildpack/app_dynamics_agent/ver4.0.1.0/logs and each instance of your application will have its own log. At the top of the agent log you can find AppDynamic JVM arguments used to configure the agent. If you configure application security groups in Pivotal Cloud Foundry you’ll need to modify the policy to allow egress traffic for the controller port. In the example below, you can see all logs available for review and each file can be output to the screen by issuing the “cf files” command with a full path to the file.

“cf files stfront app/.java-buildpack/app_dynamics_agent/ver4.0.1.0/logs/agent.2015_03_31__14_26_55_0.log”

image03

As we’ve shown,  Pivotal Cloud Foundry makes the delivery and management of applications extremely easy and error free. Working with our partners to create an ecosystem of integrated services for customers delivers tremendous value, and provides an elegant transition to the delivery of cloud native applications while preserving and integrating with existing solutions.

AppSphere Speaker Panel: Cloudy With A Chance Of Innovation

AppSphere Day One general sessions ended with a panel of cloud experts led in discussion by Jonah Kowall, research vice president – IT operations at Gartner, with questions prepared by Jonah and also submitted by the audience. The course of the discussion indicated that — like so many things in this time of transformation and generational shift — there’s still a lot of confusion and uncertainty about the vague but huge concept of “the cloud,” and at the same time, great opportunity.
unnamed (6)
Some misconceptions dispelled, guiding principles, and best practices offered by the panel:

  • The cloud can be a cost-efficient option, but innovation should be a bigger driver than any anticipated cost savings.
  • Speed, flexibility, faster time to market, speed of innovation, and efficient utilization of resources are all good drivers for cloud adoption.
  • You can’t just lift a chunk of infrastructure and drop it into the cloud. It doesn’t work that way. Assumptions about how things interact, latency, storage, etc. are no longer true. Things have to be re-architected.
  • You have to have a plan and a strategy; otherwise, don’t even start.
  • The network, and network latency, are critical factors for performance in the cloud.
  • The hour-long discussion took a number of paths: the challenges and opportunities of SaaS, IaaS, and PaaS; containers in general and Docker in particular; OpenStack; and others. The discussion ended with a five-year crystal ball look and not much agreement on which aspects of cloud will become commoditized and what services or layers will be the differentiators. But there was no disagreement that the cloud is where we’re moving, and that it will power amazing possibilities for business, and great benefits for consumers.

    The esteemed panel of cloud experts included:

    Mark Quigley, Vice President, Strategy, SoftLayer, an IBM Company
    Krishnan Subramanian, Director, OpenShift Strategy, Red Hat
    Matt Stine, Platform Engineer, Cloud Foundry, Pivotal
    Vibhor Kapoor, Director of Product Marketing, Microsoft Azure
    Allan Naim, Global Product Lead, Google Compute Engine, Google

    Stay up to date with AppDynamics AppSphere on Twitter using the hashtag #AppSphere14

    AppDynamics Joins the Cloud Foundry Foundation

    Today AppDynamics joins EMC, HP, IBM, Pivotal, Rackspace, SAP, and VMware in the Cloud Foundry Foundation to help create an open cloud ecosystem.

    The Cloud Foundry Foundation is a non-profit community focused on fostering the growth of cloud-enabled business practices such as Platform-as-a-Service (PaaS). The Foundation is working towards an enterprise-adopted open PaaS, which can run from any cloud. As enterprise businesses continue to adopt agile processes, this open PaaS will continue to innovate and become an industry-standard architecture.

    Pivotal CEO, Paul Maritz stated, “Support from exciting technology and industry users of Cloud Foundry will help ensure the growth and stability of the open PaaS movement, accelerating the development of an agile cloud architecture built for today’s enterprises,” said Maritz. “The broad ecosystem of partners, and the great user experience created through Cloud Foundry will engender new applications and services that will have a wide-reaching impact on people  and the world at large.”

    AppDynamics is also joining the Cloud Foundry Summit happening this June to provide insights to a roundtable and lead the direction for an open PaaS and help innovate the IT model. Learn more about the summit here http://cfsummit.com.

    “We are very honored to join the Cloud Foundry Foundation alongside the biggest brands and brightest minds in technology,” said Bhaskar Sunkara, chief technology officer at AppDynamics. “Defining the standards for Open Source Platform-as-a-Service will have wide ranging benefits for Enterprises adopting private and public cloud computing. AppDynamics is built from the ground up for cloud environments, and has seen tremendous growth this past year. Our customer feedback clearly points to cloud infrastructure supported by PaaS as a key IT operating model of the future.”

    We look forward to furthering cloud enablement and defining the new IT model.  Get free monitoring for your cloud based apps with AppDynamics today.

    Monitoring Apps on the Cloud Foundry PaaS

    At AppDynamics, we pride ourselves on making it easier to monitor complex applications. This is why we are excited to announce our partnership with Pivotal to make it easier to deploy built-in application performance monitoring to the cloud.

     

    Getting started with Pivotal’s Cloud Foundry Web Service

    Cloud Foundry is the open platform as a service, developed and operated by Pivotal. You can deploy applications to the hosted Pivotal Web Services (much like you host apps on Heroku) or you can run your own Cloud Foundry PaaS on premise using Pivotal CF. Naturally, Cloud Foundry is an open platform that is used and operated by many companies and service providers.

    1) Sign up for a Pivotal CF account and AppDynamics Pro SaaS account

    In the future, Pivotal Web Services will include the AppDynamics SaaS APM services, so you’ll only need to sign up for Pivotal Web Services and it will automatically create an AppDynamics account.

    2) Download the Cloud Foundry CLI (Command Line Interface)

    Pivotal Web Services has both a web based GUI as well as a full featured linux style command line interface (CLI). Once you have a PWS account, you can download a Mac, Windows or Unix CLI from the “Tools” tab in the PWS dashboard or directly for OSX, Linux, and Windows.

    Pivotal Web Services CLI

    3) Sign in with your Pivotal credentials

    Using the CLI, log in to your Pivotal Web Services account. Remember to preface all commands given to Cloud Foundry with “cf”.  Individual Cloud Foundry PaaS clouds are identified by their domain API endpoint. For PWS, the endpoint is api.run.pivotal.io. The system will automatically target your default org (you can change this later) and ask you to select a space (a space is similar to a project or folder where you can keep a collection of app(s).

    $ cf login

    Cloud Foundry CLI 

    Monitoring Cloud Foundry apps on Pivotal Web Services

    Cloud Foundry uses a flexible approach called buildpacks to dynamically assemble and configure a complete runtime environment for executing a particular class of applications. Rather than specifying how to run applications, your developers can rely on buildpacks to detect, download and configure the appropriate runtimes, containers and libraries. The AppDynamics agent is built-in to the Java buildpack for easy instrumentation so if you have AppDynamics monitoring running, the Cloud Foundry DEA will auto-detect the service and enable the agent in the buildpack. If you start the AppDynamics monitoring for an app already running, just restart the app and the DEA will autodetect the new service.

    1) Clone the Spring Trader demo application

    The sample Spring Trader app is provided by Pivotal as a demonstration. We’ll use it to show how monitoring works. First git clone the app from the Github repository.

    $ git clone https://github.com/cloudfoundry-samples/rabbitmq-cloudfoundry-samples

    2) Create a user provided service to auto-discover the AppDynamics agent

    $ cf create-user-provided-service demo-app-dynamics-agent -p “host-name,port,ssl-enabled,account-name,account-access-key”

    Cloud Foundry CLI

    Find out more about deploying on PWS in the Java buildpack docs.

    3) Use the Pivotal Web Services add-on marketplace to add a cloud based AMQP + PostgreSQL database instance

    $ cf create-service elephantsql turtle demo-db

    $ cf create-service cloudamqp lemur demo-amqp

    Cloud Foundry CLI

    4) Bind PostgreSQL, AMQP, and AppDynamics services to app

    $ git clone https://github.com/cloudfoundry-samples/rabbitmq-cloudfoundry-samples

    $ cd rabbitmq-cloudfoundry-samples/spring

    $ mvn package

    $ cf bind-service demo-app demo-app-dynamics-agent

    $ cf bind-service demo-app demo-amqp

    $ cf bind-service demo-app demo-db

    Cloud Foundry CLI

    5) Push the app to production using the Cloud Foundry CLI (Command Line Interface)

    $ cf push demo-app -i 1 -m 512M -n demo-app -p target/rabbitmq-spring-1.0-SNAPSHOT.war

    Cloud Foundry CLI

    Spring AMQP Stocks Demo App

    Spring Trader

    Pivotal Web Services Console

    Pivotal PaaS CloudFoundry

     

     

    Production monitoring with AppDynamics Pro

    Monitor your critical cloud-based applications with AppDynamics Pro for code level visibility into application performance problems.

    AppD Dashboard

    Pivotal is the proud sponsor of Spring and the related open-source JVM technologies Groovy and Grails. Spring helps development teams build simple, portable, fast, and flexible JVM-based systems and applications. Spring is the most popular application development framework for enterprise Java. AppDynamics Java agent supports the latest Spring framework and Groovy natively. Monitor the entire Pivotal stack including TC server and Web Server, GreenPlum, RabbitMQ, and the popular Spring framework:

    AppD

     

    Take five minutes to get complete visibility into the performance of your production applications with AppDynamics today.