Build StatusCoverage Status

Discorelic

Discorelic is an Elixir implementation of the NewRelic intrumentation PaaS. It's based on erlang newrelic, which basically has reversed engineering the python client, so its integration with NewRelic is not 100% perfect.

Why?

There are a few implementations out there written in Elixir to publish metrics in NewRelic. However, all of them are using either the NewRelic SDK client, which wasn't very easy to work with, or requiring libraries that are not always required for all projects, like Plug or Ecto, as new-relixir is doing.

The aim of this project it to create a library that contains the minimal dependencies and has a consistent way to interact with NewRelic transactions.

Installation

  1. Add discorelic to your list of dependencies in mix.exs:

    
    def deps do
     [ { :discorelic, "~> 0.0.1", github: "nogates/discorelic" } ]
    end
    
  2. Ensure discorelic is started before your application:


    def application do
      [ applications: [ :discorelic ] ]
    end
  1. Set up your application name and license key in your config.exs

    config :discorelic,
      application_name: "MyAwesomeApplication",
      license_key: System.get_env("NEW_RELIC_LICENSE_KEY")

Usage

Discorelic uses Elixir's macros in order to provide an easy way to record transactions. Currently it supports:

  # Basic module transaction
  defmodule MyModule do
    import Discorelic.Tracker

    def request_with_tracking do
      record_transaction! "my_request" do
        my_request
      end
    end
  end

TODO

License

Please see LICENSE