Why? 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 Relic Insights data explorer. With this we can create great graphic's to help with the monitoring of our integrations.
The package can be installed
by adding newrelic_insights
to your list of dependencies in mix.exs
:
def deps do
[
{:newrelic_insights, "~> 1.0.5"}
]
end
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"
NewrelicInsights.send_event(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 https://hexdocs.pm/newrelic_insights.
- Data Reference and Sample
- To generate an
API KEY
https://insights.newrelic.com/accounts/YOUR_ACCOUNT_HERE/manage/api_keys
- To see the event data you're sending
https://insights.newrelic.com/accounts/YOUR_ACCOUNT_HERE/explorer/events
click on thePAGE VIEW
drop down and select theEVENT TYPE
you've sended.