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
-
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
-
Signup for a 60 day free trial license with New Relic.
-
Obtain
license key
.This can be found under
Account Settings
from the drop down menu in the upper right corner of the page. -
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
-
Bind the
newrelic
service instance toarticulate
.cf bind-service articulate newrelic
-
Restage
articulate
.cf restage articulate
-
Bind the
newrelic
service instance toattendee-service
.cf bind-service attendee-service newrelic
-
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
-
Refresh the
articulate
Service
web page multiple times.Optionally use the JMeter script from the Application Autoscaler lab.
-
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
linkarticulate
attendee-service
2.5. Clean up
-
Unbind
newrelic
service instance.cf unbind-service articulate newrelic
..and:
cf unbind-service attendee-service newrelic
-
Delete
newrelic
service instance.cf delete-service newrelic
-
Scale back down to our original settings.
cf scale articulate -m 512M -i 1
..and:
cf scale attendee-service -m 512M -i 1
-
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.