Heavily modified fork of the Opscode estatsd, able to publish metrics to Librato and StatHat.
Even though estatsd comes as a node you can add it as a dependency:
-
Clone or submodule estatsd into your
priv/directory or whatever have you -
Include it in
sub_dirsin yourrebar.config, e.g.:{sub_dirs, [ "apps/my_app", "priv/estatsd/apps/estatsd", "rel" ]}. -
Add an
include_condto your reltool.config:% ... {app, my_app, [{incl_cond, include}]}, {app, estatsd, [{incl_cond, include}]} % ...
-
Make sure you have a
estatsdsection, like the one inrel/files/app.config, in your environment.
Should you know a better way, let me know!
I recommend you run estatsd as a standalone node to which you talk from your various clients. Otherwise, include estatsd into your project, then make sure you start the application, e.g.:
application:start(estatsd).See rel/files/app.config for a list of configuration options and their descriptions.
% Increment `num_foos` by one:
estatsd:increment(num_foos).
% Decrement `num_bars` by 3:
estatsd:decrement(<<"num_bars">>, 3).
% Increment `tcp.bytes_in` by 512:
estatsd:increment("tcp.bytes_in", 512).% Report that `sometask` took 1534ms:
estatsd:timing(sometask, 1534).% Let estatsd know that only 10% are being reported.
% 125 * (1/0.1) = value actually incremented by.
estatsd:increment(num_foos, 125, 0.1).Librato does not (yet) support combining several different metrics into one chart.
This has been implemented! :)
To achieve this effect the Librato Adapter introduces the notion of groups:
estatsd:increment("myapp.calls-failure").
estatsd:increment("myapp.calls-success").
estatsd:increment("myapp.calls-unknown").As a result you get one metric named myapp.calls including three different graphs, namely failure, success and unknown.