Add the Elastic APM Java Agent to your sbt project.
This project is heavily inspired by the sbt-datadog project.
Given the similar nature of the projects this plugin was quick to setup. Merci @guizmaii!
The plugin assumes that sbt-native-packager has been included in your SBT build configuration. This can be 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.
Add the following to your project/plugins.sbt
file:
resolvers += Resolver.bintrayIvyRepo("shadiramadan", "sbt-plugins")
addSbtPlugin("com.shadiramadan.sbt" % "sbt-elastic-apm" % "1.0.0")
To enable the Elastic APM for your project, add the ElasticApmPlugin
auto-plugin to your project.
enablePlugins(ElasticApmPlugin)
To use a specific Elastic APM Java Agent version, add the following to your build.sbt
file:
elasticApmVersion := "1.6.1"
By default, the agent will use the sbt project name
value as elastic.apm.service_name
.
To use another value, add the following to your build.sbt
file:
elasticApmServiceName := "another name"
By default, the agent elastic.apm.application_packages
value is com.example
.
To use another value, add the following to your build.sbt
file:
elasticApmAgentApplicationPackages := Seq("com.example")
By default, the agent elastic.apm.server_urls
value is http://localhost:8200
.
To use another value, add the following to your build.sbt
file:
elasticApmAgentServerUrls := Seq(url("http://localhost:8200"))