# NewrelicInsights

We are used to NewRelic custom dashboards to monitor our integrations system, but elixir does not have an official package, and the ones that are out there cant do what we need. I hope we can give this awesome community something back! We still learning elixir so be kind :)

**What this isn't**

It's not a NewRelic monitoring tool

**What is this?**

A way to publish custom events data to New Relici Insights data explorer. With this we can create great graphic's to help with the monitoring of our integrations.


## Installation

The package can be installed
by adding `newrelic_insights` to your list of dependencies in `mix.exs`:

def deps do
    {:newrelic_insights, "~> 1.0.4"}

### Configuration

Leave it at your `config.ex` while developing.
In deployed apps place it at `prod.ex`

config :newrelic_insights,
  api_key: "NEWRELIC_API_KEY",
  account_id: "NEW_RELIC_ACCOUNT_ID"

### Usage


#### Sample Data

data = [ %{ "eventType": "Workers/MyWorker", "account": 3, "amount": 259.54 }, %{ "eventType": "Sample", "account": 5, "amount": 12309, "product": "Item" }]


* Every map inside the list MUST HAVE the key: `eventType`
* The value of `eventType` can't be blank.
* Use something useful to identify your event on the `eventType`, like your module/class.

The docs can be found at [](

### Newrelic references

1.  [Data Reference and Sample](
2.  To generate an `API KEY` ``
3.  To see the event data you're sending `` click on the `PAGE VIEW` drop down and select the `EVENT TYPE` you've sended.