kamon-io / kamon-newrelic

Kamon New Relic Integration

Website GitHub

New Relic Integration

This repository provides an integration with the New Relic platform. It provides two reporters capable of sending trace spans and dimensional metrics to New Relic data ingest APIs.

Installation

In order to use the New Relic reporters in your application, you must first add the kamon-newrelic reporter dependency to your build.sbt:

libraryDependencies ++= Seq(
    "io.kamon" %% "kamon-bundle" % "2.0.2",
    "com.newrelic.telemetry" %% "kamon-newrelic-reporter" % "0.0.3",
    ...
)

Once the dependency is included in your project, Kamon will automatically register the reporters.

Configuration

In order for the reporters to send data, they require a New Relic Insights API key.
You should populate an environment variable called INSIGHTS_INSERT_KEY with your API key, and configure it in your application.conf like this:

kamon.newrelic {
    # A New Relic Insights API Insert Key is required to send trace data to New Relic
    # https://docs.newrelic.com/docs/apis/get-started/intro-apis/types-new-relic-api-keys#insert-key-create
    nr-insights-insert-key = ${?INSIGHTS_INSERT_KEY}
}

If you can't use an environment variable, you can replace the above with the actual key like
nr-insights-insert-key = abc123secretvalue123.

Note: This is less secure and additional precautions must be taken (like considering file permissions and excluding from source control).

Data

For a detailed explanation of what data is exported and how it appears inside the New Relic platform, please see the documentation in the New Relic exporter specs repo.

Development

Great! You have cloned this repository and want to build it in order to test things out, experiment, and make changes...awesome!

First, make sure that you have a working installation of scala 2.13.0 and sbt. Then you can run:

$ sbt compile  

If you are developing locally, you may also be interested in:

  • sbt publishLocal - (publish to local Ivy repo)
  • sbt publishM2 - (publish to local Maven repo)
  • sbt package - (build a local jar, output in kamon-newrelic/target/scala-2.13/)

Contributing

Please see CONTRIBUTING.md for information on helping out with this project.