Estimated Time: 25 minutes

1. Preface

In the previous labs, we learned how to setup log analysis for our application, and how to autoscale our app. We also must be able to monitor it. Configuring your application for monitoring becomes effortless with integration from monitoring tools such as newrelic and appdynamics. In this lab, we’ll use the newrelic managed service to setup application performance monitoring for our app.

2. Exercises

2.1. Setup

  1. APM solutions cause applications to consume more memory. Increase the memory limit for each application.

    cf scale articulate -m 768M -i 1

    ..and:

    cf scale attendee-service -m 768M -i 1

2.2. Provision a New Relic Service Instance

Read the documentation on New Relic integration with the Java Buildpack.

2.2.1. Pivotal Cloud Foundry Instructions

Create a New Relic Service instance.

cf create-service newrelic standard newrelic
  1. Signup for a 60 day free trial license with New Relic.

  2. Obtain license key.

    This can be found under Account Settings from the drop down menu in the upper right corner of the page.

  3. Create a user provided service instance. This will create an interactive prompt.

    cf create-user-provided-service newrelic -p license_key

2.3. Bind the New Relic Service Instance

  1. Bind the newrelic service instance to articulate.

    cf bind-service articulate newrelic
  2. Restage articulate.

    cf restage articulate
  3. Bind the newrelic service instance to attendee-service.

    cf bind-service attendee-service newrelic
  4. Restage attendee-service.

    cf restage attendee-service

2.3.1. Questions

  • Why must articulate & attendee-service be restaged as oppose to restarted?

2.4. Create Some Web Traffic and View in New Relic

  1. Refresh the articulate Service web page multiple times.

    Optionally use the JMeter script from the Application Autoscaler lab.

  2. Observe and explore the performance metrics in the New Relic console under the APM tab.

Pivotal Web Services users can access the New Relic console via the Manage link in Apps Manager:

Manage New Relic
Figure 1. New Relic Manage link
Monitor Articulate in New Relic
Figure 2. articulate
Monitor Attendee Service
Figure 3. attendee-service

2.5. Clean up

  1. Unbind newrelic service instance.

    cf unbind-service articulate newrelic

    ..and:

    cf unbind-service attendee-service newrelic
  2. Delete newrelic service instance.

    cf delete-service newrelic
  3. Scale back down to our original settings.

    cf scale articulate -m 512M -i 1

    ..and:

    cf scale attendee-service -m 512M -i 1
  4. Restage applications.

    cf restage articulate

    ..and:

    cf restage attendee-service

2.6. Questions

  • How do you manage APM tools today? How is this different?

3. Beyond the Class

Pivotal Cloud Foundry offers a marketplace experience with both New Relic and App Dynamics. Try it with your Pivotal Cloud Foundry installation.