Book Image

Play Framework Cookbook - Second Edition

By : Alexander Reelsen, Giancarlo Inductivo
Book Image

Play Framework Cookbook - Second Edition

By: Alexander Reelsen, Giancarlo Inductivo

Overview of this book

<p>As web and mobile systems become more sophisticated, anchoring systems in a mature, solid framework has become increasingly important. Play 2 provides developers with the necessary tools to build robust web applications.</p> <p>This book is a compilation of useful recipes aimed at helping developers discover the power of Play 2. The introductory section serves as a primer to Play Framework, wherein all the fundamentals of the framework are covered extensively. It then explains the usage of controllers and how modules can be leveraged for optimal performance. Next, the book walks you through creating and using APIs, followed by extensive real-world applications. Finally, you will learn to manage applications post production.</p>
Table of Contents (15 chapters)
Play Framework Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Monitoring with New Relic


For this recipe, we will deploy a Play 2.0 web app using Docker and Digital Ocean, and monitor the web app using New Relic. We will deploy the web app as a Docker container and detail out how to instrument the computer-database-scala sample web application using a New Relic JAR file integrated with our activator build script.

How to do it…

For this recipe, you need to perform the following steps:

  1. First, sign up for a New Relic account at https://newrelic.com/signup

  2. Create a new Java application in the New Relic dashboard:

  3. During the creation of the Java application, please make note of your New Relic license key:

  4. Next, download the New Relic Java agent ZIP and make note of the download location. This ZIP file should contain the Java agent library, license key file, API documentation, and other useful New Relic resources.

  5. Unzip the Java agent ZIP file and make note of two important files that we will need, newrelic.yml and newrelic.jar:

        $ ls ~/Downloads/newrelic/
    ...