diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2014-03-05 08:04:57 -0300 |
---|---|---|
committer | Ivan Topolnjak <ivantopo@gmail.com> | 2014-03-16 23:24:23 -0300 |
commit | 34f38dc1cc22b20f007f19a28f8c42c26e034a69 (patch) | |
tree | 68b2d31a1b64d4ab0ff7801c1bfacd64577447e8 /site/src/main/jekyll/newrelic/index.md | |
parent | a8b465358fac2534f98dcbcac6c076ac98015abc (diff) | |
download | Kamon-34f38dc1cc22b20f007f19a28f8c42c26e034a69.tar.gz Kamon-34f38dc1cc22b20f007f19a28f8c42c26e034a69.tar.bz2 Kamon-34f38dc1cc22b20f007f19a28f8c42c26e034a69.zip |
basic traces documentation
Diffstat (limited to 'site/src/main/jekyll/newrelic/index.md')
-rw-r--r-- | site/src/main/jekyll/newrelic/index.md | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/site/src/main/jekyll/newrelic/index.md b/site/src/main/jekyll/newrelic/index.md new file mode 100644 index 00000000..38a87245 --- /dev/null +++ b/site/src/main/jekyll/newrelic/index.md @@ -0,0 +1,117 @@ +--- +title: kamon | NewRelic Module | Documentation +layout: default +--- + +NewRelic Module +=============== + +If you are a Newrelic user and tried to start start your app using the Newrelic agent you probably noticed a crude reality: +nothing is shown in your dashboard, no web transactions are recognized and errors are not reported for your Spray applications. +Don't even think about detailed traces for the slowest transactions. + +We love Spray, and we love Newrelic, we couldn't leave this happening anymore! + +Currently the Newrelic Module works together with the Spray Module to get information about your Web Transactions and send +that information to Newrelic servers as a aggregate to the data already colected by Newrelic's Agent. Currently the data +being reported is: + +- Time spent for Web Transactions: Also known as `HttpDispatcher` time, represents the total time taken to process a web +transaction, from the moment the `HttpRequest` is received by spray-can, to the moment the answer is sent to the IO layer. +- Apdex +- Errors + +Differentiation between JVM and External Services is coming soon, as well as actor metrics and detailed traces. + + + +Installation +------------- + +To use the Newrelic module just make sure you put the `kamon-newrelic` and `kamon-spray` libraries in your classpath and +start your application with both, the Aspectj Weaver and Newrelic agents. Please refer to our [get started](/get-started) page +for more info on how to add the AspectJ Weaver and the [Newrelic Agent Installations Instructions](https://docs.newrelic.com/docs/java/new-relic-for-java#h2-installation). + + +Configuration +------------- + +Currently you will need to add a few settings to your `application.conf` file for the module to work: + +```scala +akka { + // Custom logger for NewRelic that takes all the `Error` events from the event stream and publish them to NewRelic + loggers = ["akka.event.slf4j.Slf4jLogger", "kamon.newrelic.NewRelicErrorLogger"] + // Make sure the NewRelic extension is loaded with the ActorSystem + extensions = ["kamon.newrelic.NewRelic"] +} + +kamon { + newrelic { + // These values must match the values present in your newrelic.yml file. + app-name = "KamonNewRelicExample[Development]" + license-key = 0123456789012345678901234567890123456789 + } +} +``` + + +Let's see it in Action! +----------------------- + +Let's create a very simple Spray application to show what you should expect from this module. The entire application code +is at [Github](https://github.com/kamon-io/Kamon/tree/master/kamon-examples/kamon-newrelic-example). + +```scala +import akka.actor.ActorSystem +import spray.routing.SimpleRoutingApp + +object NewRelicExample extends App with SimpleRoutingApp { + + implicit val system = ActorSystem("kamon-system") + + startServer(interface = "localhost", port = 8080) { + path("helloKamon") { + get { + complete { + <h1>Say hello to Kamon</h1> + } + } + } ~ + path("helloNewRelic") { + get { + complete { + <h1>Say hello to NewRelic</h1> + } + } + } + } +} +``` + +As you can see, this is a dead simple application: two paths, different responses for each of them. Now let's hit it hard +with Apache Bench: + +```bash +ab -k -n 200000 http://localhost:8080/helloKamon +ab -k -n 200000 http://localhost:8080/helloNewRelic +``` + +After a couple minutes running you should start seeing something similar to this in your dashboard: + +![newrelic](/assets/img/newrelic.png "NewRelic Screenshot") + +<div class="alert alert-info"> +Note: Don't think that those numbers are wrong, Spray is that fast! +</div> + + +Limitations +----------- +* The first implementation only supports a subset of NewRelic metrics + + +Licensing +--------- +NewRelic has [its own, separate licensing](http://newrelic.com/terms). + |