Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Erlang library for sending metrics to New Relic

branch: master

Merge pull request #14 from chrisavl/error_cb

Add option to start poller with custom error callback
latest commit fa9634f14c
Sukumar Yethadka sthadka authored February 20, 2014
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore Fix crash due to case clause December 19, 2012
Octocat-spinner-32 rebar WIP Statman integration. September 19, 2012
Octocat-spinner-32 rebar.config Statman is needed and should be started before newrelic. January 16, 2013

NewRelic for Erlang

This library implements the New Relic API and allows sending arbitrary metrics directly to their collectors from Erlang. New Relic is a paid "application monitoring" service.

You need to supply the metrics on the correct format. If you happen to be using statman you can use the included newrelic_statman transformer. It is fairly easy to transform the metrics, so if you're using Folsom, estatsd or your own tools, have a look at newrelic_statman to see how it's done.


Two application environment variables must be set in the newrelic app:

  • application_name: human readable name of the app, will show up in the web interface
  • license_key: secret license key

Statman integration

If you're using Statman and use the following conventions for naming your keys, you can use New Relic "for free".

  • {<<"/hello/world">>, {class, segment}} - Web transaction, class and segment can be anything and will show up in the "Performance breakdown"
  • {<<"/hello/world">>, {db, <<"something">>}} - Web transaction with database access, will show up in the "Performance breakdown" as well as "Overview". Unfortunately not in "Database" yet
  • {<<"/hello/world">>, total} - Total time of the transaction, inclusive any children. Will show up in the "Overview"
  • {<<"/hello/world">>, {ext, <<"">>}} - External call inside a web transaction, will show up in the "Performance breakdown" and "External services"
  • {foo, bar} - Background task - old format
  • {background, <<"foo">>}, {class, segment}} - Background task segment.
  • {background, <<"foo">>}, total} - Background task total time.
  • {<<"/hello/world">>, {error, {type, message}}} - Error, counters with keys like this will show up in under "Errors"
Something went wrong with that request. Please try again.