Skip to content

New Relic monitoring integration for SBT with sbt-native-packager

License

Notifications You must be signed in to change notification settings

majkiw/sbt-newrelic

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbt-newrelic

newrelic support for any artifacts built with sbt-native-packager

Useful Links

The following is a list of useful links related to newrelic:

Prerequisites

The plugin assumes that sbt-native-packager 0.7.x or 0.8.x has been included in your SBT build configuration, and its settings have been initialized. This can by done by adding the plugin following instructions at http://www.scala-sbt.org/sbt-native-packager/ or by adding another plugin that includes and initializes it (e.g. the SBT plugin for Play 2.3.x).

Installation

Add the following to your project/plugins.sbt file:

addSbtPlugin("com.gilt.sbt" % "sbt-newrelic" % "0.0.3")

Configuration

The following represents the minimum amount of code required in a build.sbt to use sbt-newrelic

To use the NewRelic settings in your project, add NewRelic.packagerSettings to your build. If you are manually adding sbt-native-packager archetypes, you should add this line after the archetype has set default values for settings.

NewRelic.packagerSettings

To use a specific New Relic Java Agent version, add the following to your build.sbt file:

newrelicVersion := "3.10.0"

To add a New Relic license key to the generated newrelic.yml file, add the following to your build.sbt file:

newrelicLicenseKey := Some("1234567890abcdef")

An alternative approach is to pass the license key to your application via the NEW_RELIC_LICENSE_KEY environment variable.

To enable custom tracing, add the following to your build.sbt file:

newrelicCustomTracing := true

To include the New Relic client API in your project's library dependencies, add to your build:

newrelicIncludeApi := true

To provide a static newrelic.yml file instead of a generated file, place the file somewhere (e.g. resourceDirectory, which is conf/ by default for Play applications, or src/main/resources for many other builds), and refer to it from your build like this:

newrelicConfig := (resourceDirectory in Compile).value / "newrelic.yml"

The application name reported to New Relic may be modified by setting newrelicAppName, the default value is the name of the project.

newrelicAppName := "My Application"

About

New Relic monitoring integration for SBT with sbt-native-packager

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 100.0%