A confugurable stats reporter.
Rheostat has the same functional interface as Metrix and Statix and includes adapters for each.
Rheostat can be configured to use one or the other (or any other adapter you want to configure).
Metrix is good for logdrain style metrics. Statix is good for StatsD metrics.
The latter means it works great with DataDog through the DataDog Heroku buildpack.
def deps do
[
{:rheostat, "~> 0.1.0"},
]
end
The most common way to use Rheostat is to configure it to use Metrix in
the dev
and test
profiles and to use Statix in prod
.
# dev, test
config :metrix,
prefix: "my-app."
config :rheostat, adapter: Rheostat.Adapter.Metrix
# prod
config :statix,
prefix: "my-app"
config :rheostat, adapter: Rheostat.Adapter.Statix
The Metrix adapter is also the default.
Finally, the Statix
addapter requires initialization, so add this to your application start
:
def start(_type, _args) do
:ok = Rheostat.connect()
end
Because Rheostat has the same function interface as Metrix you can replace:
import Metrix
with:
import Rheostat
Or globaly replace Metrix
with Rheostat
.
There may be other more clever ways to do that as well.