This package is based on Statix with one major difference - it receives settings when on GenServer init, allowing to use packages like Confex to resolve configuration from environment at start-time.
The package can be installed as:
- Add
dogstat
to your list of dependencies inmix.exs
:
def deps do
[{:dogstat, "~> 0.1.0"}]
end
- Ensure
dogstat
is started before your application:
def application do
[applications: [:dogstat]]
end
- Add it to your supervision tree:
def start(_type, _args) do
import Supervisor.Spec, warn: false
config = [
host: "localhost",
port: 8125
]
children = [
...
worker(Annon.Monitoring.MetricsCollector, [config]),
...
]
opts = [strategy: :one_for_one, name: Annon.Supervisor]
Supervisor.start_link(children, opts)
end
The docs can be found at https://hexdocs.pm/dogstat
See LICENSE.md.